Kaydet (Commit) cfbb23a4 authored tarafından Victor Stinner's avatar Victor Stinner

Merged revisions 79271 via svnmerge from

svn+ssh://pythondev@svn.python.org/python/branches/py3k

........
  r79271 | victor.stinner | 2010-03-22 02:58:35 +0100 (lun., 22 mars 2010) | 4 lines

  Issue #4282: Fix the main function of the profile module for a non-ASCII
  script, open the file in binary mode and not in text mode with the default
  (utf8) encoding.
........
üst 4e74fc82
...@@ -609,11 +609,8 @@ def main(): ...@@ -609,11 +609,8 @@ def main():
if (len(args) > 0): if (len(args) > 0):
sys.argv[:] = args sys.argv[:] = args
sys.path.insert(0, os.path.dirname(sys.argv[0])) sys.path.insert(0, os.path.dirname(sys.argv[0]))
fp = open(sys.argv[0]) with open(sys.argv[0], 'rb') as fp:
try:
script = fp.read() script = fp.read()
finally:
fp.close()
run('exec(%r)' % script, options.outfile, options.sort) run('exec(%r)' % script, options.outfile, options.sort)
else: else:
parser.print_usage() parser.print_usage()
......
...@@ -143,6 +143,10 @@ Core and Builtins ...@@ -143,6 +143,10 @@ Core and Builtins
Library Library
------- -------
- Issue #4282: Fix the main function of the profile module for a non-ASCII
script, open the file in binary mode and not in text mode with the default
(utf8) encoding.
- Issue #7774: Set sys.executable to an empty string if argv[0] has been set to - Issue #7774: Set sys.executable to an empty string if argv[0] has been set to
an non existent program name and Python is unable to retrieve the real an non existent program name and Python is unable to retrieve the real
program name program name
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment