Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error in greenlet with Python 3.9.0 on macOS: TypeError: type() takes 1 or 3 arguments #359

Closed
fxcoudert opened this issue Oct 13, 2020 · 9 comments · Fixed by #400
Closed

Comments

@fxcoudert
Copy link

Describe the bug
We're testing the migration of gdb and gdbgui to Python 3.9.0 as part of Homebrew: Homebrew/homebrew-core#62792

To Reproduce
Launch gdbgui and connect to it (see below).

Error

==> /usr/local/Cellar/gdbgui/0.14.0.1_1/bin/gdbgui -v
==> curl -s 127.0.0.1:51050
Traceback (most recent call last):
  File "/usr/local/Cellar/gdbgui/0.14.0.1_1/libexec/lib/python3.9/site-packages/gevent/baseserver.py", line 246, in _do_read
    self.do_handle(*args)
  File "/usr/local/Cellar/gdbgui/0.14.0.1_1/libexec/lib/python3.9/site-packages/gevent/baseserver.py", line 208, in do_handle
    spawn(_handle_and_close_when_done, handle, close, args)
  File "src/gevent/greenlet.py", line 662, in gevent._greenlet.Greenlet.spawn
TypeError: type() takes 1 or 3 arguments
2020-10-13T09:44:35Z ((('127.0.0.1', 51051),), <WSGIServer at 0x105f15a00 fileno=5 address=127.0.0.1:51050>) failed with TypeError

Please complete the following information:

  • OS: macOS 10.13 to 10.15
  • gdbgui version (gdbgui -v): 0.14.0.1
  • gdb version (gdb -v): 9.2
@ksherlock
Copy link

This line in gevent:

https://github.com/gevent/gevent/blob/18365b99bb458261e04b0e36bf8b57926e9ae194/src/gevent/greenlet.py#L1131

might be the issue.

in gevent/baseserver.py:

with acceleration:

  • Greenlet: <class 'gevent._greenlet.Greenlet'>
  • Greenlet.spawn: <bound method Greenlet.spawn of <class 'type'>>

without acceleration:

  • Greenlet: <class 'gevent.greenlet.Greenlet'>
  • Greenlet.spawn: <bound method Greenlet.spawn of <class 'gevent.greenlet.Greenlet'>>

setting the PURE_PYTHON=1 environment variable skips the accelerator stuff so it can be run that way as well.

@ryanfuji
Copy link

export PURE_PYTHON=1, fixed the issue for me
Catalina 10.15.7
Python 3.9
GDB 10.2
gdbgui 0.14

@denysvitali
Copy link

Indeed, export PURE_PYTHON=1 solves the issue for me too:

$ gdbgui -v
0.14.0.1
$ python --version
Python 3.9.1
$ cat /etc/os-release | head -n1 | cut -f 2 -d = | sed 's/"//g'
Arch Linux

@callahanp
Copy link

adding export PURE_PYTHON=1 solves the issue on Lubuntu 21.04

Lubuntu 21.04
Python 3.9.4
pip 20.3.4 from /usr/lib/python3/dist-packages/pip (python 3.9)
pipx 0.16.2.1
gdbgui 0.14.0.2

@1Mark
Copy link

1Mark commented May 31, 2021

PURE_PYTHON=1 gdbgui or gdbgui --debug both work for me, but this really should be fixed.

@cs01
Copy link
Owner

cs01 commented May 31, 2021

Pull requests are welcome

@Igosuki
Copy link

Igosuki commented Aug 25, 2021

Same thing on Linux Ubuntu 21.04

@bryanmobrien
Copy link

Same (PURE_PYTHON=1 gdbgui "works") on:
macOS Big Sur 11.5.2
python 3.9.5
pip 21.2.4
gdbgui 0.14.0.2

@cs01 cs01 closed this as completed in #400 Aug 29, 2021
@cs01
Copy link
Owner

cs01 commented Aug 30, 2021

eventlet and gevent have been removed as dependencies. This should work fine now in v0.15. Thanks everyone for reporting.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

9 participants