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.

Author pitrou
Recipients Guillaume.Bouchard, docs@python, pitrou, r.david.murray
Date 2011-12-06.15:00:18
SpamBayes Score 7.837267e-10
Marked as misclassified No
Message-id <1323183619.04.0.429338748952.issue13538@psf.upfronthosting.co.za>
In-reply-to
Content
Well, I forgot to mention it in my previous message, but there is already a warning that you can activate with the -b option:

$ ./python -b
Python 3.3.0a0 (default:6b6c79eba944, Dec  6 2011, 11:11:32) 
[GCC 4.5.2] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> str(b"")
__main__:1: BytesWarning: str() on a bytes instance
"b''"


And you can even turn it into an error with -bb:

$ ./python -bb
Python 3.3.0a0 (default:6b6c79eba944, Dec  6 2011, 11:11:32) 
[GCC 4.5.2] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> str(b"")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
BytesWarning: str() on a bytes instance


However, -b is highly unlikely to become the default, for the reasons already explained. It was mainly meant to ease porting from Python 2.
History
Date User Action Args
2011-12-06 15:00:19pitrousetrecipients: + pitrou, r.david.murray, docs@python, Guillaume.Bouchard
2011-12-06 15:00:19pitrousetmessageid: <1323183619.04.0.429338748952.issue13538@psf.upfronthosting.co.za>
2011-12-06 15:00:18pitroulinkissue13538 messages
2011-12-06 15:00:18pitroucreate