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: adapt str8 constructor to bytes constructor
Type: Stage:
Components: Interpreter Core Versions: Python 3.0
process
Status: closed Resolution:
Dependencies: Superseder:
Assigned To: georg.brandl Nosy List: brett.cannon, christian.heimes, georg.brandl, gvanrossum
Priority: normal Keywords: patch

Created on 2007-10-19 22:44 by georg.brandl, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
str_constructor.diff georg.brandl, 2007-10-19 22:44
str_constructor_updated.diff brett.cannon, 2007-10-23 06:02
Messages (7)
msg56572 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2007-10-19 22:44
This makes the str8 constructor accept the same kinds of types as the
bytes constructor. I had to fix instances of str8("abc") to str8(b"abc")
to make tests pass again. The only remaining failure should be test_str
-- the string test suite must be thoroughly redesigned to fit all three
string-like types.
msg56663 - (view) Author: Brett Cannon (brett.cannon) * (Python committer) Date: 2007-10-23 00:31
The changes to str8 look fine.

Now it's time to find out how badly tests break since Georg's patch was
generated.  =)
msg56670 - (view) Author: Brett Cannon (brett.cannon) * (Python committer) Date: 2007-10-23 06:02
Attached is an updated patch.  I didn't touch Georg's code short of
tossing in some comments on whether we wanted to sneak around some APIs
for performance or not.  Anything I added was to make all but one test pass.

And that one test is test_str.  There is now this odd mixture of
test_unicode, test_str, and test_bytes.  But that doesn't really fit
anymore since unicode is now str, so that file should probably get
renamed.  And str8 is becoming more like bytes.  That means that
string_tests is really just tests for what is now str and we need a
bytes_tests thing for str8 and bytes.

Assigning back to Guido since he seems to be assigned everything that is
holding up 3.0a2.  =)  If I am lucky I will be able to help with this
testing reorg, but that is iffy.
msg56672 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2007-10-23 06:31
I'll perhaps find some time today to try and make the tests useful and
consistent again.
msg56686 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2007-10-23 18:56
Okay, somebody seems to have started this, so I won't interfere for now.
msg56716 - (view) Author: Guido van Rossum (gvanrossum) * (Python committer) Date: 2007-10-24 18:42
Georg, can you check this in even with test_str failing?

And who is working on that?  If I don't get a name I'll tackle it myself.
msg56717 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2007-10-24 18:57
Okay, committed in r58640.

Gregory wrote this in test_bytes:
# I've started porting some of those into buffer_tests.py, we should port
# the rest that make sense (the code can be cleaned up to use modern
# unittest methods at the same time).
History
Date User Action Args
2022-04-11 14:56:27adminsetgithub: 45644
2008-01-06 22:29:45adminsetkeywords: - py3k
versions: Python 3.0
2007-10-24 18:57:39georg.brandlsetstatus: open -> closed
messages: + msg56717
2007-10-24 18:42:49gvanrossumsetassignee: gvanrossum -> georg.brandl
messages: + msg56716
2007-10-23 18:56:54georg.brandlsetmessages: + msg56686
2007-10-23 06:31:24georg.brandlsetmessages: + msg56672
2007-10-23 06:02:48brett.cannonsetfiles: + str_constructor_updated.diff
assignee: brett.cannon -> gvanrossum
messages: + msg56670
2007-10-23 03:26:05christian.heimessetnosy: + christian.heimes
2007-10-23 00:31:05brett.cannonsetassignee: gvanrossum -> brett.cannon
messages: + msg56663
2007-10-20 01:04:08brett.cannonsetnosy: + brett.cannon
2007-10-20 01:03:57brett.cannonsetkeywords: + patch
2007-10-19 22:44:50georg.brandlcreate