Skip to content
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-29240, bpo-32030: pymain_set_sys_argv() now copies argv #4838

Merged
merged 1 commit into from
Dec 13, 2017
Merged

bpo-29240, bpo-32030: pymain_set_sys_argv() now copies argv #4838

merged 1 commit into from
Dec 13, 2017

Conversation

vstinner
Copy link
Member

@vstinner vstinner commented Dec 13, 2017

  • Rename pymain_set_argv() to pymain_set_sys_argv()
  • pymain_set_sys_argv() now creates of copy of argv and modify the
    copy, rather than modifying pymain->argv
  • Call pymain_set_sys_argv() earlier: before pymain_run_python(), but
    after pymain_get_importer().
  • Add _PySys_SetArgvWithError() to handle errors

https://bugs.python.org/issue29240

bpo-29240, bpo-32030:

* Rename pymain_set_argv() to pymain_set_sys_argv()
* pymain_set_sys_argv() now creates of copy of argv and modify the
  copy, rather than modifying pymain->argv
* Call pymain_set_sys_argv() earlier: before pymain_run_python(), but
  after pymain_get_importer().
* Add _PySys_SetArgvWithError() to handle errors
@vstinner
Copy link
Member Author

AppVeyor failed with:

ls failed
ok
======================================================================
ERROR: test_get_exe_bytes (distutils.tests.test_bdist_wininst.BuildWinInstTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "C:\projects\cpython\lib\distutils\tests\test_bdist_wininst.py", line 24, in test_get_exe_bytes
    exe_file = cmd.get_exe_bytes()
  File "C:\projects\cpython\lib\distutils\command\bdist_wininst.py", line 361, in get_exe_bytes
    f = open(filename, "rb")
FileNotFoundError: [Errno 2] No such file or directory: 'C:\\projects\\cpython\\lib\\distutils\\command\\wininst-14.12.exe'

I'm unable to reproduce the issue on my Windows :-(

@vstinner
Copy link
Member Author

ERROR: test_get_exe_bytes (distutils.tests.test_bdist_wininst.BuildWinInstTestCase)

This error is unrelated to this change: see https://bugs.python.org/issue32302

@vstinner vstinner merged commit d5dda98 into python:master Dec 13, 2017
@vstinner vstinner deleted the pymain_argv branch December 13, 2017 16:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants