Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 434648 Details for
Bug 583412
dev-lang/python:2.7: ConfigParser partially incompatible with Turkish locale
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
python-2.7-ConfigParser_turkish_locale.patch
python-2.7-ConfigParser_turkish_locale.patch (text/plain), 1.83 KB, created by
Arfrever Frehtes Taifersar Arahesis
on 2016-05-18 22:00:43 UTC
(
hide
)
Description:
python-2.7-ConfigParser_turkish_locale.patch
Filename:
MIME Type:
Creator:
Arfrever Frehtes Taifersar Arahesis
Created:
2016-05-18 22:00:43 UTC
Size:
1.83 KB
patch
obsolete
>--- Lib/ConfigParser.py >+++ Lib/ConfigParser.py >@@ -94,6 +94,7 @@ > _default_dict = dict > > import re >+import string > > __all__ = ["NoSectionError", "DuplicateSectionError", "NoOptionError", > "InterpolationError", "InterpolationDepthError", >@@ -106,6 +107,14 @@ > > MAX_INTERPOLATION_DEPTH = 10 > >+_lower_map = string.maketrans(string.ascii_uppercase, string.ascii_lowercase) >+ >+def _lower(value): >+ if isinstance(value, str): >+ return value.translate(_lower_map) >+ else: >+ return value.lower() >+ > > > # exception classes >@@ -257,7 +266,7 @@ > already exists. Raise ValueError if name is DEFAULT or any of it's > case-insensitive variants. > """ >- if section.lower() == "default": >+ if _lower(section) == "default": > raise ValueError, 'Invalid section name: %s' % section > > if section in self._sections: >@@ -366,12 +375,12 @@ > > def getboolean(self, section, option): > v = self.get(section, option) >- if v.lower() not in self._boolean_states: >+ if _lower(v) not in self._boolean_states: > raise ValueError, 'Not a boolean: %s' % v >- return self._boolean_states[v.lower()] >+ return self._boolean_states[_lower(v)] > > def optionxform(self, optionstr): >- return optionstr.lower() >+ return _lower(optionstr) > > def has_option(self, section, option): > """Check for the existence of a given option in a given section.""" >@@ -483,7 +492,7 @@ > # comment or blank line? > if line.strip() == '' or line[0] in '#;': > continue >- if line.split(None, 1)[0].lower() == 'rem' and line[0] in "rR": >+ if _lower(line.split(None, 1)[0]) == 'rem' and line[0] in "rR": > # no leading whitespace > continue > # continuation line?
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 583412
: 434648