Message79784
| 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:01 | ggenellina | set | recipients:
+ ggenellina, amaury.forgeotdarc, vstinner, ebfe, gladed |
| 2009年01月13日 22:46:01 | ggenellina | set | messageid: <1231886761.18.0.738071588059.issue4871@psf.upfronthosting.co.za> |
| 2009年01月13日 22:46:00 | ggenellina | link | issue4871 messages |
| 2009年01月13日 22:45:59 | ggenellina | create |
|