Package: python-gevent
Version: 0.13.6-1+b2
Severity: minor

Dear Maintainer,

I want to try gevent and I write a script 

    $ cat thread.py 
    #!/usr/bin/python
    # python thread.py
    # python -m gevent.monkey thread.py

    import threading

    class Thread(threading.Thread):

        def __init__(self, name):
            threading.Thread.__init__(self)
            self.name = name

        def run(self):
            for i in xrange(10):
                print self.name

    threadA = Thread("A")
    threadB = Thread("B")

    threadA.start()
    threadB.start()

when I try run:

    $python thread.py
    $python -m gevent.monkey thread.py
    $python -m gevent.monkey --no-thread thread.py

the output is my expected.

but when I run:

    $python -m gevent.monkey --thread thread.py

the output is:

    gevent.monkey - monkey patch the standard modules to use gevent.

    USAGE: python -m gevent.monkey [MONKEY OPTIONS] script [SCRIPT OPTIONS]

    If no OPTIONS present, monkey patches all the modules it can patch.
    You can exclude a module with --no-module, e.g. --no-thread. You can
    specify a module to patch with --module, e.g. --socket. In the latter
    case only the modules specified on the command line will be patched.

    MONKEY OPTIONS: --verbose --[no-]thread, --[no-]dns, --[no-]ssl, 
--[no-]httplib, --[no-]time, --[no-]select, --[no-]socket, --[no-]os

    Cannot patch 'thread'

I think --thread is a valid options mention by the usage,
but it can't work

then I read the file :

    /usr/lib/pymodules/python2.7/gevent/monkey.py

I find this:

    222     while argv and argv[0].startswith('--'):
    223         option = argv[0][2:]
    224         if option == 'verbose':
    225             verbose = True
    226         elif option.startswith('no-') and option.replace('no-', '')
    in modules:
    227             args[option[3:]] = False
    228         elif option not in modules:
    229             args[option] = True
    230         else:
    231             sys.exit(script_help + '\n\n' + 'Cannot patch %r' %
    option)
    232         del argv[0]

when I delete the word 'not' in line 228, and run the command age.
everything is OK now. I think this is a bug and may be need to be fixed.

-- System Information:
Debian Release: wheezy/sid
  APT prefers testing
  APT policy: (990, 'testing'), (500, 'unstable'), (500, 'stable')
Architecture: amd64 (x86_64)

Kernel: Linux 3.2.0-4-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages python-gevent depends on:
ii  libc6            2.13-35
ii  libevent-2.0-5   2.0.19-stable-3
ii  python           2.7.3~rc2-1
ii  python-greenlet  0.4.0-1
ii  python-support   1.0.15

python-gevent recommends no packages.

Versions of packages python-gevent suggests:
pn  python-gevent-dbg  <none>
ii  python-gevent-doc  0.13.6-1
pn  python-openssl     <none>

-- no debconf information


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to