#1495 subprocess.CREATE_NEW_WINDOW only available on win32


Hi, just upgraded to 2.5 on my iMac (python 2.7.2) and trying to run the Django debug server results in an AttributeError on line 1167.
The offending line is:
popen = subprocess.Popen(args, env=new_environ, creationflags=subprocess.CREATE_NEW_CONSOLE)

I had to look in the subprocess module itself to figure out why, and it's because that attribute is only created in win32 environments. (line 443 of subprocess.py)

I fixed it in my own environment by changing it to this:
popen = None
if sys.platform == "win32":
popen = subprocess.Popen(args, env=new_environ, creationflags=subprocess.CREATE_NEW_CONSOLE)
popen = subprocess.Popen(args, env=new_environ, shell=True)


I've also noticed a problem when trying to use pydevd.patch_django_autoreload()
If I run the debug server, then try to debug-runserver but the runserver command itself is never actually called (I can't access the website itself).
Howver, if I run debug-runserver with the import/patch lines commented out of my manage.py it runs and attaches fine (though breakpoints are not detected). If I then uncomment the two lines and save, it now picks up the breakpoints as well and I can do everything normally.

tl;dr: I have to runserver without import/patch, then add those lines in again to have breakpoints picked up.

I'm not sure if my changes above to patch_django_autoreload made it this way as I have no way to test it without the changes since the exception is thrown.


  • Fabio Zadrozny

    Fabio Zadrozny - 2012-04-11

    I just pushed a new nightly build with that issue fixed.

    Take a look at http://pydev.org/manual_adv_django.html for details on whether you want to patch only the debugger or also showing a console out of Eclipse.

    Please let me know if you still have some issue with this version (see: http://pydev.org/download.html for details on getting the nightly build)

  • Fabio Zadrozny

    Fabio Zadrozny - 2012-04-11
    • status: open --> pending-fixed

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks