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-34166: Use tobytes instead of tostring and use with statement for file handling #8367

Merged
merged 1 commit into from
Jul 21, 2018

Conversation

tirkarthi
Copy link
Member

@tirkarthi tirkarthi commented Jul 21, 2018

Changes made :

  • Use tobytes instead of tostring.
  • Use with statement for file handling to fix ResourceWarning.

Tested using a sample .po file as in https://bugs.python.org/msg322074

I think this needs a backport to 3.7 and 3.6. I haven't added a NEWS entry since the changes seem trivial let me know if it's needed.

Thanks

https://bugs.python.org/issue34166

@miss-islington
Copy link
Contributor

Thanks @tirkarthi for the PR, and @serhiy-storchaka for merging it 🌮🎉.. I'm working now to backport this PR to: 3.6, 3.7.
🐍🍒⛏🤖

@miss-islington
Copy link
Contributor

Sorry @tirkarthi and @serhiy-storchaka, I had trouble checking out the 3.7 backport branch.
Please backport using cherry_picker on command line.
cherry_picker a692efe4733f98831cb51a9683877b152f754d14 3.7

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Jul 21, 2018
(cherry picked from commit a692efe)

Co-authored-by: Xtreak <tirkarthi@users.noreply.github.com>
@bedevere-bot
Copy link

GH-8368 is a backport of this pull request to the 3.6 branch.

tirkarthi added a commit to tirkarthi/cpython that referenced this pull request Jul 21, 2018
(cherry picked from commit a692efe)

Co-authored-by: Xtreak <tirkarthi@users.noreply.github.com>
@bedevere-bot
Copy link

GH-8369 is a backport of this pull request to the 3.7 branch.

@tirkarthi
Copy link
Member Author

Strangely enough there weren't any conflicts for 3.7 branch when I used cherry_picker command but still @miss-islington failed to make a PR.

➜  cpython git:(master) ✗ cherry_picker a692efe4733f98831cb51a9683877b152f754d14 3.7
🐍 🍒 ⛏
From github.com:python/cpython
   06ca3f0..a692efe  master     -> upstream/master

Now backporting 'a692efe4733f98831cb51a9683877b152f754d14' into '3.7'
Switched to a new branch 'backport-a692efe-3.7'
Branch backport-a692efe-3.7 set up to track remote branch 3.7 from upstream.

[backport-a692efe-3.7 00faa43] bpo-34166: Fix warnings in Tools/msgfmt.py. (GH-8367)
 Author: Xtreak <tirkarthi@users.noreply.github.com>
 Date: Sat Jul 21 11:52:12 2018 +0530
 1 file changed, 5 insertions(+), 3 deletions(-)

To git@github.com:tirkarthi/cpython.git
 * [new branch]      backport-a692efe-3.7 -> backport-a692efe-3.7

Backport PR URL:
https://github.com/python/cpython/compare/3.7...tirkarthi:backport-a692efe-3.7?expand=1
Switched to branch 'master'
Your branch is up-to-date with 'origin/master'.

Deleted branch backport-a692efe-3.7 (was 137aade).

branch backport-a692efe-3.7 has been deleted.

miss-islington added a commit that referenced this pull request Jul 21, 2018
(cherry picked from commit a692efe)

Co-authored-by: Xtreak <tirkarthi@users.noreply.github.com>
serhiy-storchaka pushed a commit that referenced this pull request Jul 21, 2018
(cherry picked from commit a692efe)

Co-authored-by: Xtreak <tirkarthi@users.noreply.github.com>
@serhiy-storchaka serhiy-storchaka removed their assignment Oct 28, 2018
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.

5 participants