Python version: 2.7.8
Virtualenv (with virtualenvwrapper), version 1.11.6
Django 1.7.0
OS: Arch Linux
Usually I run the development server from the directory containing
manage.py by invoking ./manage.py runserver.
This leads to the attached stacktrace. When I run it by using the absolute
path to the file, it's fine.
Upon further investigation I noticed that at the end of manage.py
os.getcwd() prints the expected cwd, but at the point where the exception
occurs Python/Django seems to think I'm in my virtualenv directory.
Expected cwd: /home/bbt/coding/maykin/leesrijk/src/
Virtualenv location: /home/bbt/coding/.virtualenvs/leesrijk/
Reported cwd in reload.py: /home/bbt/coding/.virtualenvs/leesrijk
I'm not sure if this is a Django bug or if something else is going on, but
it started happening with Django 1.7, no issues on 1.6.
--
Ticket URL: <https://code.djangoproject.com/ticket/23691>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* needs_better_patch: => 0
* needs_tests: => 0
* needs_docs: => 0
Comment:
Hi,
I have the same OS, the same Python and virtualenv versions yet I can't
seem to reproduce your issue:
{{{
$ python2 --version
Python 2.7.8
$ virtualenv --version
1.11.6
$ mkvirtualenv -p /usr/bin/python2 djangobug23691
Running virtualenv with interpreter /usr/bin/python2
New python executable in djangobug23691/bin/python2
Also creating executable in djangobug23691/bin/python
Installing setuptools, pip...done.
(djangobug23691)$ pip install Django==1.7.0
Downloading/unpacking Django==1.7.0
Downloading Django-1.7-py2.py3-none-any.whl (7.4MB): 7.4MB downloaded
Installing collected packages: Django
Successfully installed Django
Cleaning up...
(djangobug23691)$ django-admin startproject djangobug23691
(djangobug23691)$ cd djangobug23691/
(djangobug23691)$ ./manage.py migrate
Operations to perform:
Apply all migrations: admin, contenttypes, auth, sessions
Running migrations:
Applying contenttypes.0001_initial... OK
Applying auth.0001_initial... OK
Applying admin.0001_initial... OK
Applying sessions.0001_initial... OK
(djangobug23691)$ ./manage.py runserver
Performing system checks...
System check identified no issues (0 silenced).
October 20, 2014 - 15:03:14
Django version 1.7, using settings 'djangobug23691.settings'
Starting development server at http://127.0.0.1:8000/
Quit the server with CONTROL-C.
[20/Oct/2014 15:03:16] "GET / HTTP/1.1" 200 1759
}}}
Am I missing something?
--
Ticket URL: <https://code.djangoproject.com/ticket/23691#comment:1>
Comment (by sergei-maertens):
I'm not sure, colleagues running Debian/Windows report no issues either.
I'm attaching the output from pip freeze, maybe it's related to some
library there.
--
Ticket URL: <https://code.djangoproject.com/ticket/23691#comment:2>
Comment (by collinanderson):
Right, so based on your stacktrace, it seems like _something_ is changing
the current working directory. Assuming that's true, maybe the runserver
code needs to run abspath on everything it finds? Either that or we need
to not support changing the current working directory once django is
loaded.
--
Ticket URL: <https://code.djangoproject.com/ticket/23691#comment:3>
* status: new => closed
* resolution: => invalid
Comment:
I recently changed to zsh instead of bash and running it in bash looks
fine, so there's probably something weird going on in my zsh config. So
since this is probably not a django issue, I'm leaving it for what it is.
--
Ticket URL: <https://code.djangoproject.com/ticket/23691#comment:4>
Comment (by sergei-maertens):
I managed to track the point of cwd change, it happens in
django.utils.autoreload.clean_files, but it seems to be a random point.
It's never for the same file. Could this be related to the threading in
the dev server?
--
Ticket URL: <https://code.djangoproject.com/ticket/23691#comment:5>
* status: closed => new
* resolution: invalid =>
Comment:
Reopening this ticket since a colleague runs into the same issue
OS: Ubuntu 14.10, fresh install as of today
Python version: 2.7.6
Django version: 1.7
Startproject template: https://bitbucket.org/maykinmedia/default-project
--
Ticket URL: <https://code.djangoproject.com/ticket/23691#comment:6>
* status: new => closed
* resolution: => needsinfo
Comment:
I think we'll need more details in order to reproduce and debug the issue.
--
Ticket URL: <https://code.djangoproject.com/ticket/23691#comment:7>
Comment (by sergei-maertens):
Sure, I have a feeling that it's related to the startproject template.
Hopefully I can investigate soon.
--
Ticket URL: <https://code.djangoproject.com/ticket/23691#comment:8>
* resolution: needsinfo => invalid
--
Ticket URL: <https://code.djangoproject.com/ticket/23691#comment:9>