#23691 closed Uncategorized (invalid)
devserver autoreload: OSError: [Errno 2] No such file or directory
Reported by: | Sergei Maertens | Owned by: | nobody |
---|---|---|---|
Component: | Core (Management commands) | Version: | 1.7 |
Severity: | Normal | Keywords: | development server, autoreload |
Cc: | Triage Stage: | Unreviewed | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
I'm running into an issue with the autoreload from the dev server (might be related to #23083).
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.
Attachments (2)
Change History (11)
by , 10 years ago
Attachment: | stacktrace.txt added |
---|
comment:1 by , 10 years ago
comment:2 by , 10 years ago
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.
Also for completeness, the template used for startproject: https://bitbucket.org/maykinmedia/default-project
comment:3 by , 10 years ago
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.
comment:4 by , 10 years ago
Resolution: | → invalid |
---|---|
Status: | new → closed |
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.
comment:5 by , 10 years ago
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?
comment:6 by , 10 years ago
Resolution: | invalid |
---|---|
Status: | closed → new |
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
comment:7 by , 10 years ago
Resolution: | → needsinfo |
---|---|
Status: | new → closed |
I think we'll need more details in order to reproduce and debug the issue.
comment:8 by , 10 years ago
Sure, I have a feeling that it's related to the startproject template. Hopefully I can investigate soon.
comment:9 by , 10 years ago
Resolution: | needsinfo → invalid |
---|
Hi,
I have the same OS, the same Python and virtualenv versions yet I can't seem to reproduce your issue:
Am I missing something?