Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

bpo-34207: Fix pymain_init_cmdline_argv()#8867

Closed
vstinner wants to merge 1 commit into
python:masterpython/cpython:masterfrom
vstinner:argv_utf8Copy head branch name to clipboard
Closed

bpo-34207: Fix pymain_init_cmdline_argv()#8867
vstinner wants to merge 1 commit into
python:masterpython/cpython:masterfrom
vstinner:argv_utf8Copy head branch name to clipboard

Conversation

@vstinner

@vstinner vstinner commented Aug 23, 2018

Copy link
Copy Markdown
Member

bpo-34170, bpo-34207: Fix pymain_init_cmdline_argv()

  • Add _Py_DecodeUTF8()
  • pymain_init_cmdline_argv() now calls directly _Py_DecodeUTF8() if
    the UTF-8 mode is enabled

Previously, pymain_init_cmdline_argv() always called
Py_DecodeLocale() which depends on Py_UTF8Mode, whereas this variable
is no longer modified when reading the current configuration.

bpo-34170, bpo-34207: Fix pymain_init_cmdline_argv()

* Add _Py_DecodeUTF8()
* pymain_init_cmdline_argv() now calls directly _Py_DecodeUTF8() if
  the UTF-8 mode is enabled

Previously, pymain_init_cmdline_argv() always called
Py_DecodeLocale() which depends on Py_UTF8Mode, whereas this variable
is no longer modified when reading the current configuration.
@vstinner

Copy link
Copy Markdown
Member Author

I tested manually that this change fix test_cmd_line on FreeBSD when run in an empty environment:

vstinner@freebsd$ env -i ./python -m test test_cmd_line
Run tests sequentially
0:00:00 load avg: 0.41 [1/1] test_cmd_line

== Tests result: SUCCESS ==

1 test OK.

Total duration: 5 sec 600 ms
Tests result: SUCCESS

@vstinner

Copy link
Copy Markdown
Member Author

I'm not sure that this change is enough: _PyCoreConfig_Read() calls _PyCoreConfig_InitPathConfig() which later indirectly calls _Py_EncodeLocaleRaw() which also depends on Py_UTF8Mode.

@vstinner

Copy link
Copy Markdown
Member Author

Hum, this PR is incomplete because of Py_EncodeLocale() and similar functions. I wrote PR #8868 which is more generic and so safer.

@vstinner vstinner closed this Aug 23, 2018
@vstinner vstinner deleted the argv_utf8 branch August 23, 2018 10:08
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

Morty Proxy This is a proxified and sanitized view of the page, visit original site.