3 ms·
There is no /dev/random on windows anyway. Not every piece of code has to be portable.
by ma2rten 12y ago
There is no /dev/random on windows anyway. Not every piece of code has to be portable.
- schoen 12y agoYes, I definitely wouldn't have expected or intended that code to work on Windows.
- viraptor 12y agoIt doesn't have to be, but going for a more correct/portable code (than absolutely necessary minimum) helps avoid such problems. In this case binary file was opened - if the "rb" mode was added anyway, the exception mentioned above wouldn't happen. Edit: Actually python doesn't even mention windows. It's simply "Add a 'b' to the mode for binary files." (in python 2.7 documentation) According to the docs it should be specified regardless.