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 ggenellina
Recipients amaury.forgeotdarc, ebfe, ggenellina, gladed, vstinner
Date 2009-01-13.22:45:59
SpamBayes Score 0.020563425
Marked as misclassified No
Message-id <1231886761.18.0.738071588059.issue4871@psf.upfronthosting.co.za>
In-reply-to
Content
Yes, the unicode flag is irrelevant to the password. To successfuly 
decrypt a file, one must know the password *and* the encoding in use 
when it was written, so the only sensible thing to do is to accept 
bytes only.

Your patch looks good to me with a few comments:

- I'd only check the password in setpassword() and open(); the other 
methods eventually call open().

- The issue version says "3.0"; but it should be applied to 2.6 2.7 
and 3.1 too.

- For 3.0 the check is wrong, should say "bytes" instead of "str". 
Even in 2.6 should use "bytes" to make clear the intent.

- The usual wording for such TypeError is more like "pwd: 
expected 'bytes', got '%s'"
History
Date User Action Args
2009-01-13 22:46:01ggenellinasetrecipients: + ggenellina, amaury.forgeotdarc, vstinner, ebfe, gladed
2009-01-13 22:46:01ggenellinasetmessageid: <1231886761.18.0.738071588059.issue4871@psf.upfronthosting.co.za>
2009-01-13 22:46:00ggenellinalinkissue4871 messages
2009-01-13 22:45:59ggenellinacreate