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-46598: Fix ElementTree.write XML prolog for encoding 'utf-8-sig'#31043

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

Open
pepr wants to merge1 commit intopython:main
base:main
Choose a base branch
Loading
frompepr:main

Conversation

pepr
Copy link

@peprpepr commentedFeb 1, 2022
edited by bedevere-bot
Loading

bpo-46598: Fix ElementTree.write XML prolog for encoding 'utf-8-sig'

When ElementTree object is to be written to the file, and when BOM
is needed, the 'utf-8-sig' can be used for the purpose.
However, the XML prolog then looks like...

<?xml version='1.0' encoding='utf-8-sig'?>

... and that encoding in the prolog makes no sense. Therefore,
theutf-8-sig is changed toutf-8 for the purpose.

https://bugs.python.org/issue46598

When ElementTree object is to be written to the file, and when BOMis needed, the 'utf-8-sig' can be used for the purpose.However, the XML prolog then looks like...<?xml version='1.0' encoding='utf-8-sig'?>... and that encoding in the prolog makes no sense. Therefore,the utf-8-sig is changed to utf-8 for the purpose.
@the-knights-who-say-ni

Hello, and thanks for your contribution!

I'm a bot set up to make sure that the project can legally accept this contribution by verifying everyone involved has signed thePSF contributor agreement (CLA).

Recognized GitHub username

We couldn't find abugs.python.org (b.p.o) account corresponding to the following GitHub usernames:

@pepr

This might be simply due to a missing "GitHub Name" entry in one's b.p.o account settings. This is necessary for legal reasons before we can look at this contribution. Please followthe steps outlined in the CPython devguide to rectify this issue.

You cancheck yourself to see if the CLA has been received.

Thanks again for the contribution, we look forward to reviewing it!

@pepr
Copy link
Author

pepr commentedFeb 1, 2022
edited
Loading

Hello all,

Finally, I have found how to add my GitHub name to the b.p.o. Done. I have also signed the PSF contributor agreement.

Thebpo-46598 was created, and the PR at b.p.o linked was added to point here.

The pull-request changes should be easily understandable, and I have tried it on my local computer.

Have a nice day,
Petr

@corona10corona10 changed the titleFix ElementTree.write XML prolog for encoding 'utf-8-sig'bpo-46598: Fix ElementTree.write XML prolog for encoding 'utf-8-sig'Feb 2, 2022
Copy link
Member

@corona10corona10 left a comment

Choose a reason for hiding this comment

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

Please add the NEW.d for behavior changing

@bedevere-bot
Copy link

A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated.

Once you have made the requested changes, please leave a comment on this pull request containing the phraseI have made the requested changes; please review again. I will then notify any core developers who have left a review that you're ready for them to take another look at this pull request.

@pepr
Copy link
Author

pepr commentedFeb 2, 2022

@corona10: Sorry, I am new in this workflow. What does it mean the "add the NEW.d for behavior changing"? Is it expected from me?

@scoder
Copy link
Contributor

Thanks. You need to include a NEWS entry to describe the change.
https://devguide.python.org/committing/#updating-news-and-what-s-new-in-python

Also, this needs a test. See the ElementTree tests under Lib/test/ There are already some that deal with encodings and the XML prologue.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@corona10corona10corona10 requested changes

@scoderscoderAwaiting requested review from scoder

Assignees
No one assigned
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

6 participants
@pepr@the-knights-who-say-ni@bedevere-bot@scoder@corona10@ezio-melotti

[8]ページ先頭

©2009-2025 Movatter.jp