This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Clean up bytes formatting
Type: enhancement Stage: resolved
Components: Interpreter Core Versions: Python 3.5
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: serhiy.storchaka Nosy List: Arfrever, eric.smith, ethan.furman, martin.panter, nascheme, ncoghlan, python-dev, serhiy.storchaka, vstinner
Priority: normal Keywords: patch

Created on 2015-02-03 08:42 by serhiy.storchaka, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
bytes_format.patch serhiy.storchaka, 2015-02-03 08:42 review
bytes_format_2.patch serhiy.storchaka, 2015-02-04 08:17 review
bytes_format_3.patch serhiy.storchaka, 2015-02-10 21:10 review
Messages (8)
msg235320 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2015-02-03 08:42
Proposed patch makes following changes to bytes formatting code:

1) Fixes a bug when PyUnicode_AsEncodedObject() returns non-bytes byte-like object.

2) Avoid few non-neccessary memory allocations and copyings (converting bytearray or ASCII string to bytes).

3) Clean up the code.
msg235382 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2015-02-04 08:17
Thanks to Martin's suggestions here is even more clean patch.
msg235701 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2015-02-10 20:10
Ping.
msg235704 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2015-02-10 20:57
Updated patch addresses Victor's comments.
msg235706 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2015-02-10 21:10
Eliminated tabs.
msg235707 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2015-02-10 21:18
Thank you for your reviews and suggestions Martin and Victor. If Ethan has no objections I'll commit the patch soon.
msg235708 - (view) Author: Ethan Furman (ethan.furman) * (Python committer) Date: 2015-02-10 21:20
As long as it works I have no objections.  :)
msg235709 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2015-02-10 21:23
New changeset 4883f9046b10 by Serhiy Storchaka in branch 'default':
Issue #23383: Cleaned up bytes formatting.
https://hg.python.org/cpython/rev/4883f9046b10
History
Date User Action Args
2022-04-11 14:58:12adminsetgithub: 67572
2015-02-12 13:24:05serhiy.storchakasetstatus: open -> closed
resolution: fixed
stage: patch review -> resolved
2015-02-10 21:23:48python-devsetmessages: + msg235709
2015-02-10 21:20:34ethan.furmansetmessages: + msg235708
2015-02-10 21:18:08serhiy.storchakasetassignee: serhiy.storchaka
messages: + msg235707
2015-02-10 21:10:56serhiy.storchakasetfiles: + bytes_format_3.patch

messages: + msg235706
2015-02-10 21:10:28serhiy.storchakasetfiles: - bytes_format_3.patch
2015-02-10 20:57:43serhiy.storchakasetfiles: + bytes_format_3.patch

messages: + msg235704
2015-02-10 20:10:30serhiy.storchakasetmessages: + msg235701
2015-02-04 08:17:41serhiy.storchakasetfiles: + bytes_format_2.patch

messages: + msg235382
2015-02-03 08:42:53serhiy.storchakacreate