ulif / diceware

Passphrases to remember
GNU General Public License v3.0
357 stars 45 forks source link

Small fix for RealDiceRandomSource #30

Closed LogosOfJ closed 7 years ago

LogosOfJ commented 7 years ago

In Python 2.7 and 3.5 on Windows 10, using the 'realdice' randomness source fails "out of the box" because the constructor for RealDiceRandomSource unsuccessfully attempts to access an argparse.Namespace object as a dict. This change fixes that issue and updates a test for the constructor.

ulif commented 7 years ago

Thanks again, @LogosOfJ for your PR! The argparse.Namespace problem you found could also bite us in other code locations. Are you aware of any? And have you tried the code on Windows7 as well?

ulif commented 7 years ago

Thank you @LogosOfJ, not only for the fix (this was a real bug you discovered), but also for making me better understand argparse concepts.

LogosOfJ commented 7 years ago

Thanks, @ulif, and sorry for the delay. What do you have in mind for regression tests?

ulif commented 7 years ago

Thank you, @LogosOfJ, I guess the tests you fixed are in fact regression tests, because they were faulty before and would have failed with all prior versions. I am therefore completely happy with your fix.

In the beginning I thought this was a Windows-specific thing, but it was not. In fact the realdice source was broken for quite a time and on all python version :-/

I am really glad you found that bug and will now try to investigate how and when I introduced it.

Then, a new version has to be released, but this is my job. Thanks a lot!