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.
Created on 2015年05月07日 22:10 by Devin Jeanpierre, last changed 2022年04月11日 14:58 by admin. This issue is now closed.
| Messages (2) | |||
|---|---|---|---|
| msg242737 - (view) | Author: Devin Jeanpierre (Devin Jeanpierre) * | Date: 2015年05月07日 22:10 | |
Maybe the functions should be split up into those you shouldn't need to call directly, and those you should? I find it unlikely that you're supposed to use codecs.encode(..., 'hex') and codecs.decode(..., 'hex') instead of binascii (the only other thing, AFAIK, that works in both 2 and 3). Relevant quote starts with: "Normally, you will not use these functions directly" https://docs.python.org/2/library/binascii https://docs.python.org/3/library/binascii |
|||
| msg242738 - (view) | Author: R. David Murray (r.david.murray) * (Python committer) | Date: 2015年05月07日 22:51 | |
No, actually, using codecs would be the most straightforward way to achieve portability. The usual way to get hex in python2 was encode('hex'), which uses the codec. But if you want to use hexlify instead, I don't see any reason not to. There's no reason to change the binascii module description, though, since it is talking about normal code, not 2/3 shared source code (where you do sometimes have to jump through somewhat awkward hoops).
(The One Obvious Way starting with 3.5 will be b'abcde'.hex(), but of course that isn't python2 compatible.)
|
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:58:16 | admin | set | github: 68332 |
| 2015年05月07日 22:51:21 | r.david.murray | set | status: open -> closed nosy: + r.david.murray messages: + msg242738 resolution: not a bug stage: resolved |
| 2015年05月07日 22:10:35 | Devin Jeanpierre | create | |