Skip to content
This repository has been archived by the owner on Aug 2, 2023. It is now read-only.

'NoneType' object has no attribute 'pydev_notify_kill' on Flask with multiprocess implementation #1581

Closed
lorieaiah opened this issue Jul 11, 2019 · 5 comments

Comments

@lorieaiah
Copy link

lorieaiah commented Jul 11, 2019

Environment data

  • PTVSD version: 4.2.10
  • OS and version: Ubuntu 18.04
  • Python version (& distribution if applicable, e.g. Anaconda): Flask 0.12.2 with Python 3.6.8
  • Using VS Code or Visual Studio: VS Code (1.36.0)

Actual behavior

in notify_thread_not_alive:
was_notified = thread.additional_info.pydev_notify_kill
'NoneType' object has no attribute 'pydev_notify_kill'

Expected behavior

Should continue

Steps to reproduce:

  1. Using multiprocessing.managers class BaseManager

Tried these:

import ptvsd ptvsd.debug_this_thread()
2.
ptvsd.enable_attach(address=('127.0.0.1', 7777), redirect_output=True) ptvsd.wait_for_attach()
Sorry if this is a dumb report

@int19h
Copy link
Contributor

int19h commented Jul 11, 2019

Can you check if your debug configuration in launch.json is using all the necessary command line switches for Flask?

https://code.visualstudio.com/docs/python/debugging#_flask-debugging

@karthiknadig
Copy link
Member

@lorieaiah Can you provide details on the OS and python version etc? Also, any sort of repro steps would be helpful as well.

@fabioz
Copy link
Contributor

fabioz commented Jul 11, 2019

Inspecting the code I think this could be caused by a race condition. The pull request above should fix it (although as a note, I haven't been able to reproduce locally).

@lorieaiah
Copy link
Author

Sorry for incomplete information. l updated the description above.

@int19h
Copy link
Contributor

int19h commented Jul 12, 2019

@lorieaiah, if you're using multiprocessing specifically, then you currently need to do set_start_method("spawn") - otherwise ptvsd cannot debug it on non-Windows platforms. See the comments in #1162 for a more detailed explanation and code snippets.

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

No branches or pull requests

4 participants