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 vstinner
Recipients eric.araujo, eric.smith, ncoghlan, pitrou, r.david.murray, vstinner
Date 2010-09-29.22:48:52
SpamBayes Score 2.986454e-07
Marked as misclassified No
Message-id <1285800535.07.0.453227879878.issue9873@psf.upfronthosting.co.za>
In-reply-to
Content
I don't understand why you would like to implicitly convert bytes to str (which is one of the worse design choice of Python2). If you don't want to care about encodings, use bytes is fine. Decode bytes using an arbitrary encoding is the fastest way to mojibake.

So You have two choices: create new functions with bytes as input and output (like os.getcwd() and os.getcwdb()), or the output type will depend on the input type (solution choosen by os.path). Example of ther later:

>>> os.path.expanduser('~')
'/home/haypo'
>>> os.path.expanduser(b'~')
b'/home/haypo'
History
Date User Action Args
2010-09-29 22:48:55vstinnersetrecipients: + vstinner, ncoghlan, pitrou, eric.smith, eric.araujo, r.david.murray
2010-09-29 22:48:55vstinnersetmessageid: <1285800535.07.0.453227879878.issue9873@psf.upfronthosting.co.za>
2010-09-29 22:48:53vstinnerlinkissue9873 messages
2010-09-29 22:48:53vstinnercreate