Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
663809ed
Commit
663809ed
authored
Jul 10, 2000
by
Fredrik Lundh
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
-- removed get_default compatibility kludge
-- added a few extra comments to locale.py
parent
dde61644
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
3 deletions
+4
-3
Lib/locale.py
Lib/locale.py
+3
-2
Lib/site.py
Lib/site.py
+1
-1
No files found.
Lib/locale.py
View file @
663809ed
...
...
@@ -290,9 +290,12 @@ def getdefaultlocale(envvars=('LANGUAGE', 'LC_ALL', 'LC_CTYPE', 'LANG')):
except
(
ImportError
,
AttributeError
):
pass
else
:
# make sure the code/encoding values are valid
if
sys
.
platform
==
"win32"
and
code
and
code
[:
2
]
==
"0x"
:
# map windows language identifier to language name
code
=
windows_locale
.
get
(
int
(
code
,
0
))
# ...add other platform-specific processing here, if
# necessary...
return
code
,
encoding
# fall back on POSIX behaviour
...
...
@@ -306,8 +309,6 @@ def getdefaultlocale(envvars=('LANGUAGE', 'LC_ALL', 'LC_CTYPE', 'LANG')):
localename
=
'C'
return
_parse_localename
(
localename
)
# compatibility
get_default
=
getdefaultlocale
def
getlocale
(
category
=
LC_CTYPE
):
...
...
Lib/site.py
View file @
663809ed
...
...
@@ -126,7 +126,7 @@ del exit
#
def
locale_aware_defaultencoding
():
import
locale
code
,
encoding
=
locale
.
get
_default
()
code
,
encoding
=
locale
.
get
defaultlocale
()
if
encoding
is
None
:
encoding
=
'ascii'
try
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment