Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Pycharm gives error "TypeError: 'NoneType' object is not callable" in debug mode for Python-Django Project

I have set up the python-django project in Pycharm.

On python manage.py runserver command in run mode, its works fine but when I run the project in debug mode I get following exception:

Traceback (most recent call last):
  File "/home/usmanmaqbool/Downloads/pycharm-community-2018.3/helpers/pydev/pydevd.py", line 2060, in <module>
    main()
  File "/home/usmanmaqbool/Downloads/pycharm-community-2018.3/helpers/pydev/pydevd.py", line 2054, in main
    globals = debugger.run(setup['file'], None, None, is_module)
  File "/home/usmanmaqbool/Downloads/pycharm-community-2018.3/helpers/pydev/pydevd.py", line 1405, in run
    return self._exec(is_module, entry_point_fn, module_name, file, globals, locals)
  File "/home/usmanmaqbool/Downloads/pycharm-community-2018.3/helpers/pydev/pydevd.py", line 1412, in _exec
    pydev_imports.execfile(file, globals, locals)  # execute the script
  File "/home/usmanmaqbool/Desktop/proj/manage.py", line 22, in <module>
    execute_from_command_line(sys.argv)
  File "/home/usmanmaqbool/Envs/proj/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 367, in execute_from_command_line
    utility.execute()
  File "/home/usmanmaqbool/Envs/proj/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 359, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/home/usmanmaqbool/Envs/proj/local/lib/python2.7/site-packages/django/core/management/base.py", line 294, in run_from_argv
    self.execute(*args, **cmd_options)
  File "/home/usmanmaqbool/Envs/proj/local/lib/python2.7/site-packages/django/core/management/commands/runserver.py", line 58, in execute
    super(Command, self).execute(*args, **options)
  File "/home/usmanmaqbool/Envs/proj/local/lib/python2.7/site-packages/django/core/management/base.py", line 345, in execute
    output = self.handle(*args, **options)
  File "/home/usmanmaqbool/Envs/proj/local/lib/python2.7/site-packages/django/core/management/commands/runserver.py", line 97, in handle
    self.run(**options)
  File "/home/usmanmaqbool/Envs/proj/local/lib/python2.7/site-packages/django/core/management/commands/runserver.py", line 106, in run
    autoreload.main(self.inner_run, None, options)
  File "/home/usmanmaqbool/Envs/proj/local/lib/python2.7/site-packages/django/utils/autoreload.py", line 333, in main
    reloader(wrapped_main_func, args, kwargs)
  File "/home/usmanmaqbool/Envs/proj/local/lib/python2.7/site-packages/django/utils/autoreload.py", line 304, in python_reloader
    exit_code = restart_with_reloader()
  File "/home/usmanmaqbool/Envs/proj/local/lib/python2.7/site-packages/django/utils/autoreload.py", line 290, in restart_with_reloader
    exit_code = os.spawnve(os.P_WAIT, sys.executable, args, new_environ)
  File "/home/usmanmaqbool/Downloads/pycharm-community-2018.3/helpers/pydev/_pydev_bundle/pydev_monkey.py", line 496, in new_spawnve
    return getattr(os, original_name)(mode, path, args, env)
  File "/home/usmanmaqbool/Envs/proj/lib/python2.7/os.py", line 573, in spawnve
    return _spawnvef(mode, file, args, env, execve)
  File "/home/usmanmaqbool/Envs/proj/lib/python2.7/os.py", line 549, in _spawnvef
    elif WIFSIGNALED(sts):
  File "/home/usmanmaqbool/Envs/proj/lib/python2.7/os.py", line 549, in _spawnvef
    elif WIFSIGNALED(sts):
TypeError: 'NoneType' object is not callable

Process finished with exit code 1

I have also created new Virtua ENV and same issue with new virtual ENV too!

EDIT 1

Database settings:

DATABASES = {
'default': {
    'ENGINE': 'django.db.backends.postgresql_psycopg2',
    'NAME': 'db_name',
    'USER': 'user',
    'PASSWORD': 'passworf',
    'HOST': 'localhost',
    'PORT': '',
    }
}

A few days ago it was working fine but after the new update version of Pycharm, I am facing this issue on just one project.

like image 901
Usman Maqbool Avatar asked Sep 16 '25 01:09

Usman Maqbool


1 Answers

That's a regression in PyCharm 2019.2 debugger for some Python versions, e.g. old 2.7.x https://youtrack.jetbrains.com/issue/PY-36726

The fix is ready and will be included in the 2019.2.1 minor update, the preview build will be live this week.

like image 95
Pavel Karateev Avatar answered Sep 17 '25 14:09

Pavel Karateev