Skip to content

bpo-32381: Fix PyRun_SimpleFileExFlags() encoding#23642

Merged
vstinner merged 1 commit into
python:masterfrom
vstinner:pyrun_file
Dec 8, 2020
Merged

bpo-32381: Fix PyRun_SimpleFileExFlags() encoding#23642
vstinner merged 1 commit into
python:masterfrom
vstinner:pyrun_file

Conversation

@vstinner

@vstinner vstinner commented Dec 4, 2020

Copy link
Copy Markdown
Member

Fix encoding name when running a ".pyc" file on Windows:
PyRun_SimpleFileExFlags() now uses the correct encoding to decode the
filename.

  • Add pyrun_file() subfunction.
  • Add pyrun_simple_file() subfunction.
  • PyRun_SimpleFileExFlags() now calls _Py_fopen_obj() rather than
    _Py_fopen().

https://bugs.python.org/issue32381

@vstinner

vstinner commented Dec 4, 2020

Copy link
Copy Markdown
Member Author

@FFY00: Hey, the "Check if generated files are up to date" worked as expected! It spotted a bug in my PR (already fixed):

Check that libpython3.10d.a only exports symbols starting with Py or _Py
+ nm --no-sort libpython3.10d.a
Ignore 20161 local symbols

Smelly symbol: pyrun_simple_file (type: T)

ERROR: Found 1 smelly symbols!

Thanks again for this nice new GitHub Action job ;-)

Comment thread Python/pythonrun.c Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

arena can't be NULL here anymore.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh right, fixed, thanks ;-)

Fix encoding name when running a ".pyc" file on Windows:
PyRun_SimpleFileExFlags() now uses the correct encoding to decode the
filename.

* Add pyrun_file() subfunction.
* Add pyrun_simple_file() subfunction.
* PyRun_SimpleFileExFlags() now calls _Py_fopen_obj() rather than
  _Py_fopen().
@vstinner

vstinner commented Dec 4, 2020

Copy link
Copy Markdown
Member Author

Strange. I pushed a fix for if (arena != NULL) but I cannot see yet. I guess that it will appear on the website soon.

@vstinner vstinner merged commit b6d98c1 into python:master Dec 8, 2020
@vstinner vstinner deleted the pyrun_file branch December 8, 2020 13:38
vstinner added a commit that referenced this pull request Dec 8, 2020
Fix encoding name when running a ".pyc" file on Windows:
PyRun_SimpleFileExFlags() now uses the correct encoding to decode the
filename.

* Add pyrun_file() subfunction.
* Add pyrun_simple_file() subfunction.
* PyRun_SimpleFileExFlags() now calls _Py_fopen_obj() rather than
  _Py_fopen().

(cherry picked from commit b6d98c1)
vstinner added a commit that referenced this pull request Dec 8, 2020
… (GH-23696)

Fix encoding name when running a ".pyc" file on Windows:
PyRun_SimpleFileExFlags() now uses the correct encoding to decode the
filename.

* Add pyrun_file() subfunction.
* Add pyrun_simple_file() subfunction.
* PyRun_SimpleFileExFlags() now calls _Py_fopen_obj() rather than
  _Py_fopen().

(cherry picked from commit b6d98c1)
(cherry picked from commit f0e42ae)
adorilson pushed a commit to adorilson/cpython that referenced this pull request Mar 13, 2021
Fix encoding name when running a ".pyc" file on Windows:
PyRun_SimpleFileExFlags() now uses the correct encoding to decode the
filename.

* Add pyrun_file() subfunction.
* Add pyrun_simple_file() subfunction.
* PyRun_SimpleFileExFlags() now calls _Py_fopen_obj() rather than
  _Py_fopen().
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants