Django empty project instantly crashes.

Oct 3, 2013 at 9:14 PM
Edited Oct 3, 2013 at 9:16 PM
Hi, I am trying to start a Django project, but it keeps failing. Note that I changed nothing in the project, just started it.

My configuration is VS 2012 Ultimate on Windows 8 Pro x64 with PTVS 2.0RC, Python 3.3.2 32-bit and Django 1.5.4. I've added virtualenv with Python and installed Django using pip, so I don't think that there is anything I missed here.

Thrown exception is :
builtins.IndexError occurred
Message: list index out of range
It occurs in C:\Python33\Lib\sre_parse.ph on line 135:
  1. def __getitem__(self, index):
  2. if isinstance(index, slice):
  3. return SubPattern(self.pattern, self.data[index])
  4. return self.data[index]
I have no idea where the problem is. I've reinstalled PTVS and Python twice, but it solved nothing.
It worked without any issues with Python 2.7 virtualenv, but I need to work with 3.3.2.
Coordinator
Oct 3, 2013 at 9:51 PM
If you just ignore the exception and tell it to keep running, does it run as expected? Or does the process shut down?
Oct 3, 2013 at 10:59 PM
It just keeps throwing this exception.
Coordinator
Oct 3, 2013 at 11:11 PM
I can reproduce this. It seems we're not handling exceptions correctly on Python 3.3.

If you click on "Open Exception settings" on the message that appears (or through Debug->Exceptions), you'll want to uncheck the "User-unhandled" column for all Python exceptions. (If you expand the tree you'll see that IndexError for Python 3 is already unchecked - this seems to be a bug.)
Marked as answer by Zooba on 10/3/2013 at 4:17 PM
Oct 3, 2013 at 11:14 PM
Works like a charm. Now I can go back to work ! :) Thanks!
Oct 23, 2013 at 4:06 PM
I'm getting the same. Thanks, this just saved me a lot of time.
Oct 28, 2013 at 12:46 PM
Note: this problem occurs only when using virtual env. If you choose to use Python without virtual env, everything works just fine.
Coordinator
Oct 30, 2013 at 5:52 PM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.