Bugreport: Crypto/Util/randpool.py always fails in _randomize when used under windows/cygwin

Matt Nordhoff mnordhoff at mattnordhoff.com
Thu Dec 13 08:26:19 GMT 2007


Murat Gurol wrote:
> Context:
> 
> Using bzr remote commands, e.g. branch or pull.
> bzr version 0.92.0
> python2.5
> OS: win xp, cygwin
> 
> Stack from bzr.log:
> 
> bzr arguments: [u'pull']
> looking for plugins in /home/mg/.bazaar/plugins
> looking for plugins in /usr/lib/python2.5/site-packages/bzrlib/plugins
> Plugin name __init__ already loaded
> Plugin name __init__ already loaded
> encoding stdout as sys.stdout encoding 'US-ASCII'
> opening working tree '/cygdrive/d/bzr/client1.1'
> Traceback (most recent call last):
>  File "commands.py", line 802, in run_bzr_catch_errors
>  File "commands.py", line 758, in run_bzr
>  File "commands.py", line 492, in run_argv_aliases
>  File "builtins.py", line 616, in run
>  File "__init__.py", line 1595, in get_transport
>  File "__init__.py", line 1617, in _try_transport_factories
>  File "registry.py", line 61, in get_obj
>  File "registry.py", line 66, in _do_import
>  File "sftp.py", line 56, in <module>
>  File "ssh.py", line 41, in <module>
>  File "__init__.py", line 68, in <module>
>  File "transport.py", line 32, in <module>
>  File "util.py", line 31, in <module>
>  File "common.py", line 106, in <module>
>  File "randpool.py", line 87, in __init__
>  File "randpool.py", line 120, in _randomize
> IOError: [Errno 0] Error

PyCrypto is used by paramiko. Unless this only happens with Bazaar, you
should email the PyCrypto people.

<http://www.amk.ca/python/code/crypto>

Line 120 is the second-to-last line of this:

(devname is '/dev/urandom'.)

        if winrandom:
            # Windows CryptGenRandom provides random data.
            data = winrandom.new().get_bytes(nbytes)
        elif os.path.exists(devname):
            # Many OSes support a /dev/urandom device
            try:
                f=open(devname)
                data=f.read(nbytes)
                f.close()
            except IOError, (num, msg):
                if num!=2: raise IOError, (num, msg)
                # If the file wasn't found, ignore the error

Weird.
-- 



More information about the bazaar mailing list