[Python-3000] Need help enforcing strict str/bytes distinctions

Guido van Rossum guido at python.org
Tue Aug 28 02:16:37 CEST 2007


As anyone following the py3k checkins should have figured out by now,
I'm on a mission to require all code to be consistent about bytes vs.
str. For example binary files will soon refuse str arguments to
write(), and vice versa.

I have a patch that turns on this enforcement, but I have anout 14
failing unit tests that require a lot of attention. I'm hoping a few
folks might have time to help out.

Here are the unit tests that still need work:

test_asynchat
test_bsddb3
test_cgi
test_cmd_line
test_csv
test_doctest
test_gettext
test_httplib
test_shelve
test_sqlite
test_tarfile
test_urllib
test_urllib2
test_urllib2_localnet

Attached is the patch that makes them fail. Note that it forces an
error when you use PyBUF_CHARACTERS when calling PyObject_GetBuffer on
a str (PyUnicode) object.

-- 
--Guido van Rossum (home page: http://www.python.org/~guido/)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: strictbytes.diff
Type: text/x-patch
Size: 11911 bytes
Desc: not available
Url : http://mail.python.org/pipermail/python-3000/attachments/20070827/cce5ffb8/attachment-0001.bin 


More information about the Python-3000 mailing list