#22991 closed Bug (fixed)
Development server not reloading with *.pyc files and without inotify
| Reported by: | Owned by: | nobody | |
|---|---|---|---|
| Component: | Core (Management commands) | Version: | 1.7-rc-1 |
| Severity: | Release blocker | Keywords: | |
| Cc: | anubhav9042@…, cmawebsite@…, Stephen Burrows | Triage Stage: | Accepted |
| Has patch: | yes | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | no |
| Easy pickings: | no | UI/UX: | no |
Description
I'm on Windows, not sure when this started to happen but the development server is not restarting/reloading anymore when I change code in models.py. I'm not using pynotify.
Change History (14)
comment:1 by , 11 years ago
| Cc: | added |
|---|---|
| Summary: | Development server reloading → Development server not reloading on Windows |
| Type: | Uncategorized → Bug |
comment:2 by , 11 years ago
#23020 reports the same issue on Mac OS X, but I have no problems on Linux.
comment:3 by , 11 years ago
I can confirm it doesn't work and bisected it to 1bb8ccdb9e70bee35759f2ada4d661481852ab95 (Fixed pyinotify performance regression)
comment:4 by , 11 years ago
| Severity: | Normal → Release blocker |
|---|---|
| Triage Stage: | Unreviewed → Accepted |
comment:5 by , 11 years ago
| Summary: | Development server not reloading on Windows → Development server not reloading with *.pyc files and without inotify |
|---|
Ok, I can reproduce it on Ubuntu 12.04 by uninstalling python-inotify (pyinotify) and turning off sys.dont_write_bytecode (PYTHONDONTWRITEBYTECODE). It's happening on all platforms, so I'll mark #23020 as a duplicate.
comment:6 by , 11 years ago
| Needs tests: | set |
|---|
*.pyc filenames are ending up in _cached_filenames, and then being returned from the cache without being converted from .pyc to .py. This change caches the *.py filenames instead.
https://github.com/django/django/pull/2913
I also noticed an inconsistency with _error_files. It's not clear if or when those should be added to _cached_filenames and if and when inotify needs to start watching them.
I would appreciate someone else writing a test case.
comment:7 by , 11 years ago
| Has patch: | set |
|---|
comment:8 by , 11 years ago
| Cc: | added |
|---|
comment:9 by , 11 years ago
comment:10 by , 11 years ago
| Cc: | added |
|---|
comment:11 by , 11 years ago
I actually can't reproduce any _error_files issues. It seems that nowadays, either the check framework fully stops the process on models.py and admin.py errors before the autoreloader starts (would be nice to fix someday), or in other files, like views.py, it can handle re-importing the bad files without needing to reload.
comment:12 by , 11 years ago
| Needs tests: | unset |
|---|
I've slightly adapted the PR from Collin and added a one-line test in https://github.com/django/django/pull/2918
comment:13 by , 11 years ago
| Resolution: | → fixed |
|---|---|
| Status: | new → closed |
Anubhav, can you reproduce this? If so, could you bisect the regression?