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
2804d357
Commit
2804d357
authored
Sep 28, 2011
by
Martin v. Löwis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use eval instead of codecs.lookup to trigger UTF-8 generation.
parent
0e71acc5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
6 deletions
+4
-6
Lib/test/test_sys.py
Lib/test/test_sys.py
+4
-6
No files found.
Lib/test/test_sys.py
View file @
2804d357
...
@@ -857,12 +857,10 @@ class SizeofTest(unittest.TestCase):
...
@@ -857,12 +857,10 @@ class SizeofTest(unittest.TestCase):
s
=
chr
(
0x4000
)
# 4 bytes canonical representation
s
=
chr
(
0x4000
)
# 4 bytes canonical representation
check
(
s
,
size
(
compactfields
)
+
4
)
check
(
s
,
size
(
compactfields
)
+
4
)
try
:
try
:
# FIXME: codecs.lookup(str) calls encoding.search_function() which
# eval() will trigger the generation of the UTF-8 representation
# calls __import__ using str in the module name. __import__ encodes
# as a side effect
# the module name to the file system encoding (which is the locale
eval
(
s
)
# encoding), so test_sys fails if the locale encoding is not UTF-8.
except
NameError
:
codecs
.
lookup
(
s
)
# produces 4 bytes UTF-8
except
LookupError
:
check
(
s
,
size
(
compactfields
)
+
4
+
4
)
check
(
s
,
size
(
compactfields
)
+
4
+
4
)
# TODO: add check that forces the presence of wchar_t representation
# TODO: add check that forces the presence of wchar_t representation
# TODO: add check that forces layout of unicodefields
# TODO: add check that forces layout of unicodefields
...
...
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