Movatterモバイル変換


[0]ホーム

URL:


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

Sign up
Appearance settings

bpo-33601 Py_UTF8Mode is not documented#31480

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Closed

Conversation

@Vidhyavinu
Copy link
Contributor

@VidhyavinuVidhyavinu commentedFeb 21, 2022
edited by bedevere-bot
Loading

@AA-Turner
Copy link
Member

I only see checks for ifPy_UTF8Mode is greater than 0 in the source (https://cs.github.com/python/cpython?q=Py_UTF8Mode), but perhaps I'm missing something.

cc:@vstinner@methane

A

@vstinner
Copy link
Member

I created#93103 to deprecate Global Configuration Variables likePy_IgnoreEnvironment.

Copy link
Contributor

@MaxwellDupreMaxwellDupre left a comment

Choose a reason for hiding this comment

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

How about adding a link in C API Stability page to init.rst?
Also, adding
Py_UTF8Mode=1 enables UTF-8 mode. However the PYTHONUTF8 environment variable is ignored (even if use_environment=1).


If set to 1, enable the UTF-8 Mode.
If set to 0, disable the UTF-8 Mode.
If set to -1, look for the:option:`-x` option and the:envvar:`PYTHONUTF8` environment variable.
Copy link
Member

Choose a reason for hiding this comment

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

Please mention that the variable is now deprecated:#93943

Copy link
Member

Choose a reason for hiding this comment

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

Done in3ec424d (#31480) when resolving the conflict.


If set to 1, enable the UTF-8 Mode.
If set to 0, disable the UTF-8 Mode.
If set to -1, look for the:option:`-x` option and the:envvar:`PYTHONUTF8` environment variable.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
If set to -1, look for the:option:`-x` option and the:envvar:`PYTHONUTF8` environment variable.
If set to -1, look for the:option:`-x utf8 <-x>` command line option and the:envvar:`PYTHONUTF8` environment variable.

Enables the UTF-8 Mode.

If set to 1, enable the UTF-8 Mode.
If set to 0, disable the UTF-8 Mode.
Copy link
Member

Choose a reason for hiding this comment

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

I'm not sure that it works this way. preconfig_get_global_vars() ignores Py_UTF8Mode ifPy_UTF8Mode <= 0.

Py_UTF8Mode should not be used: PyPreConfig.utf8_mode should be used instead. Today, it seems like the only purpose of Py_UTF8Mode is to explicitly enable the Python UTF-8 Mode with Py_UTF8Mode=1.


..c:var::int Py_UTF8Mode
Enables the UTF-8 Mode.
Copy link
Member

Choose a reason for hiding this comment

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

You can add a link tohttps://docs.python.org/dev/library/os.html#python-utf-8-mode usingutf8-mode reference. Please replace "UTF-8 Mode" with "Pyhon UTF-8 Mode".

@serhiy-storchakaserhiy-storchaka added needs backport to 3.12only security fixes needs backport to 3.13bugs and security fixes and removed needs backport to 3.10only security fixes needs backport to 3.11only security fixes labelsMay 9, 2024
@hugovkhugovk removed the needs backport to 3.12only security fixes labelApr 10, 2025
@python-cla-bot
Copy link

The following commit authors need to sign the Contributor License Agreement:

CLA signed

@serhiy-storchakaserhiy-storchaka added the needs backport to 3.14bugs and security fixes labelMay 8, 2025
@StanFromIreland
Copy link
Member

StanFromIreland commentedJul 29, 2025
edited
Loading

Thank you for the contribution however it has been decided that this will in fact not be documented, the attached issue has been closed asnot planned.

@AA-TurnerAA-Turner removed needs backport to 3.13bugs and security fixes needs backport to 3.14bugs and security fixes labelsAug 14, 2025
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@vstinnervstinnervstinner left review comments

@hugovkhugovkhugovk left review comments

+1 more reviewer

@MaxwellDupreMaxwellDupreMaxwellDupre left review comments

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Labels

awaiting reviewdocsDocumentation in the Doc dirskip news

Projects

Status: Todo

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

10 participants

@Vidhyavinu@AA-Turner@vstinner@StanFromIreland@hugovk@MaxwellDupre@serhiy-storchaka@the-knights-who-say-ni@ezio-melotti@bedevere-bot

[8]ページ先頭

©2009-2025 Movatter.jp