Message273304
Hi all,
please note that to stay compatible with the GNU md5sum utility you should print the file name prefixed by a "*" if you read the file in binary mode.
Also when digests is checked, files to check should be opened in binary or text mode according the presence/absence of the "*" character before the file name.
A explicit error should be raised IMO if some specific mode is not supported (e.g. text mode) by the check function.
Also, since the tool supports different hashing algorithms the openssl/BSD-style output format could be more appropriate IMO:
MD5 (file01.dat) = 101b455ce70d2e73e1a4d92a3e8c29e1
FYI I wrote a the hashsum package [1] that provides a command line tool that is intended to be a "Python drop-in replacement for md5sum and co.".
If my understanding is correct you want to keep this patch as simple as possible but, if you are interested in, I could provide patches to:
* fix the GNU style output: binary ("*") vs text mode
* implement full support for the text mode
* implement full support for BSD-style output format
I could also convert the hassum.py utility [1] to be integrated directly in hashlib.
[1] https://github.com/avalentino/hashsum |
|
Date |
User |
Action |
Args |
2016-08-21 16:36:06 | avalentino | set | recipients:
+ avalentino, rhettinger, terry.reedy, gregory.p.smith, vstinner, christian.heimes, SilentGhost, martin.panter, palaviv |
2016-08-21 16:36:06 | avalentino | set | messageid: <1471797366.55.0.632565185656.issue26488@psf.upfronthosting.co.za> |
2016-08-21 16:36:06 | avalentino | link | issue26488 messages |
2016-08-21 16:36:06 | avalentino | create | |
|