[proxy] web.archive.org← back | site home | direct (HTTPS) ↗ | proxy home | ◑ dark◐ light
/ cpython Public
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bpo-20844: open script file with "rb" mode #12616

Merged
merged 4 commits into from Apr 1, 2019
Merged

Conversation

Copy link
Member

methane commented Mar 29, 2019

On Unix, this doesn't have any effect.
On Windows, "r" mode will cause error on ftell.

https://bugs.python.org/issue20844

Copy link
Member Author

methane commented Mar 29, 2019

OK, AppVeyor failed on added test:

======================================================================
FAIL: test_issue20884 (test.test_cmd_line_script.CmdLineTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "C:\projects\cpython\lib\test\test_cmd_line_script.py", line 425, in test_issue20884
    rc, out, err = assert_python_ok(script_name)
  File "C:\projects\cpython\lib\test\support\script_helper.py", line 157, in assert_python_ok
    return _assert_python(True, *args, **env_vars)
  File "C:\projects\cpython\lib\test\support\script_helper.py", line 143, in _assert_python
    res.fail(cmd_line)
  File "C:\projects\cpython\lib\test\support\script_helper.py", line 70, in fail
    raise AssertionError("Process return code is %d\n"
AssertionError: Process return code is 1
command line: ['C:\\projects\\cpython\\PCbuild\\amd64\\python.exe', '-X', 'faulthandler', '-I', 'C:\\Users\\appveyor\\AppData\\Local\\Temp\\1\\tmpnejtdxss\\issue20884.py']
stdout:
---
---
stderr:
---
File "C:\Users\appveyor\AppData\Local\Temp\1\tmpnejtdxss\issue20884.py", line 1
SyntaxError: encoding problem: iso-8859-1
---
----------------------------------------------------------------------

Same fail on Azure x86 and amd64

Copy link
Contributor

animalize commented Mar 30, 2019

Should revert some of this change (git commit 815b41b) in issue20731?

Eryk Sun mentioned it in msg221134.

Copy link
Contributor

animalize commented Mar 31, 2019

Eryk Sun said in msg273110:

That would also entail documenting that PyRun_SimpleFileExFlags requires a FILE pointer that's opened in binary mode.

Not sure whether this advice is needed.

Copy link
Member Author

methane commented Apr 1, 2019

Should revert some of this change (git commit 815b41b) in issue20731?

I will backport this change to 3.7 branch. So I want to keep patch simple, safe, and no regression.
It will be solved more good way in the future. But I don't care it.

methane merged commit 10654c1 into python:master Apr 1, 2019
Copy link
Contributor

miss-islington commented Apr 1, 2019

Thanks @methane for the PR 🌮🎉.. I'm working now to backport this PR to: 3.7.
🐍🍒🤖

methane deleted the use-rb branch Apr 1, 2019
Copy link
Contributor

miss-islington commented Apr 1, 2019

Sorry, @methane, I could not cleanly backport this to 3.7 due to a conflict.
Please backport using cherry_picker on command line.
cherry_picker 10654c19b5e6efdf3c529ff9bf7bcab89bdca1c1 3.7

methane added a commit that referenced this pull request Apr 1, 2019
methane added a commit that referenced this pull request Apr 1, 2019
(cherry picked from commit 10654c1)

Co-authored-by: Inada Naoki <songofacandy@gmail.com>
Copy link

bedevere-bot commented Apr 1, 2019

GH-12647 is a backport of this pull request to the 3.7 branch.

methane added the 🤖 automerge PR will be merged once it's been approved and all CI passed label Apr 1, 2019
methane added a commit that referenced this pull request Apr 1, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
OS-windows 🤖 automerge PR will be merged once it's been approved and all CI passed type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants