#11621 closed (fixed)
Django copies .pyo files for a new project/app
Reported by: | Steve Milner | Owned by: | nobody |
---|---|---|---|
Component: | Core (Other) | Version: | dev |
Severity: | Keywords: | jython | |
Cc: | ivazqueznet@… | Triage Stage: | Accepted |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
Ignacio Vazquez-Abrams noted that if pyo files are present Django copys them into projects/apps. Currently, core.management.base stops pyc's from being copied but does not stop pyo's. Ignacio proposed adding the same block on pyo's (see patch attached).
Attachments (2)
Change History (13)
by , 15 years ago
Attachment: | Django-ignore-pyo-bz-495046.patch added |
---|
comment:1 by , 15 years ago
Triage Stage: | Unreviewed → Accepted |
---|
comment:2 by , 15 years ago
What if we switched this on it's ear and instead and did:
if !f.endswith('.py'):
that way other implementations (such as jython) which may create files with different bytecode suffixes don't get items copied as well. Just a thought.
comment:4 by , 15 years ago
This bug actually causes breakage in Django 1.0.x on Jython. The startproject and startapp commands incorrectly use the '.pyc' filter and end up *rewriting* the Jython generated class files.
Can we get this applied to the 1.0.x branch quickly?
by , 15 years ago
Attachment: | Django-ignore-pyo-and-jython-classfile.diff added |
---|
Turn Steve Milner's second idea into a patch, as it helps Jython too
comment:5 by , 15 years ago
A third possibility (If there are files other than .py that need processing) is to just add an "or f.endswith("$py.class") to the list for Jython. I'll put that patch together if it will speed things along...
comment:6 by , 15 years ago
Keywords: | jython added |
---|
comment:7 by , 15 years ago
I'm seeing the same thing for 1.0.3 on Jython 2.5.0. After creating a new project, I'm unable to runserver until I delete the initial .class files
follow-up: 9 comment:8 by , 15 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Fixed in r11483.
(is the post-commit hook that should write this message broken?)
Because 1.1 is released, 1.0.X will now only receive security bug fixes, so this won't be backported (unless policy changes).
comment:9 by , 15 years ago
Replying to lukeplant:
Fixed in r11483.
(is the post-commit hook that should write this message broken?)
Because 1.1 is released, 1.0.X will now only receive security bug fixes, so this won't be backported (unless policy changes).
That's a shame. I understand that Django is run by volunteers and you can't afford to make all the releases we want. The problem here is that Django 1.1 hasn't been tested with Jython as extensively as 1.0, so we Jython users are a bit in the dark now :(
comment:10 by , 15 years ago
Replying to leosoto:
That's a shame. I understand that Django is run by volunteers and you can't afford to make all the releases we want. The problem here is that Django 1.1 hasn't been tested with Jython as extensively as 1.0, so we Jython users are a bit in the dark now :(
Changing the policy regarding backporting would make more work for our release manager, so I'm loathe to suggest that.
Perhaps someone from the community could set up a git/hg mirror that is "1.0.X plus Jython fixes"? With mercurial at least, it is pretty easy to do - just clone http://bitbucket.org/mirror/django-10x/, create a 'jython_fixes' branch (or something like that) which has hand-selected backports (like changeset r11483) added to it. Provided the fixes for Jython are small, merging from django-1.0.X will be very easy.
comment:11 by , 15 years ago
For the moment we are applying the original patch to all Fedora built Django packages using the rpm patch directive. On next update we will test and apply the updated patch by Frank.
Does not copy over pyo's