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
bd075214
Commit
bd075214
authored
Oct 12, 2007
by
Brett Cannon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make _load_testfile() use its encoding argument when __loader__ is defined.
parent
b5461ddb
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
1 deletion
+10
-1
Lib/doctest.py
Lib/doctest.py
+2
-1
Misc/NEWS
Misc/NEWS
+8
-0
No files found.
Lib/doctest.py
View file @
bd075214
...
...
@@ -209,7 +209,8 @@ def _load_testfile(filename, package, module_relative, encoding):
filename
=
_module_relative_path
(
package
,
filename
)
if
hasattr
(
package
,
'__loader__'
):
if
hasattr
(
package
.
__loader__
,
'get_data'
):
return
package
.
__loader__
.
get_data
(
filename
).
decode
(
'utf-8'
),
filename
return
(
package
.
__loader__
.
get_data
(
filename
).
decode
(
encoding
),
filename
)
return
open
(
filename
,
encoding
=
encoding
).
read
(),
filename
def
_indent
(
s
,
indent
=
4
):
...
...
Misc/NEWS
View file @
bd075214
...
...
@@ -14,6 +14,14 @@ Extension Modules
- The `hotshot` profiler has been removed; use `cProfile` instead.
Library
-------
- When loading an external file using testfile(), the passed-in encoding
argument was being ignored if __loader__ is defined and forcing the source to
be UTF-8.
What's New in Python 3.0a1?
==========================
...
...
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