Opened 15 years ago

Closed 15 years ago

Last modified 15 years ago

#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).

RH Bugzilla Bug

Attachments (2)

Django-ignore-pyo-bz-495046.patch (593 bytes ) - added by Steve Milner 15 years ago.
Does not copy over pyo's
Django-ignore-pyo-and-jython-classfile.diff (574 bytes ) - added by Frank Wierzbicki 15 years ago.
Turn Steve Milner's second idea into a patch, as it helps Jython too

Download all attachments as: .zip

Change History (13)

by Steve Milner, 15 years ago

Does not copy over pyo's

comment:1 by Alex Gaynor, 15 years ago

Triage Stage: UnreviewedAccepted

comment:2 by Steve Milner, 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:3 by Steve Milner, 15 years ago

Oops ...

    if not f.endswith('.py'):

comment:4 by crankycoder@…, 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 Frank Wierzbicki, 15 years ago

Turn Steve Milner's second idea into a patch, as it helps Jython too

comment:5 by Frank Wierzbicki, 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 Leo Soto M., 15 years ago

Keywords: jython added

comment:7 by Brandon Taylor, 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

comment:8 by Luke Plant, 15 years ago

Resolution: fixed
Status: newclosed

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).

in reply to:  8 comment:9 by Leo Soto M., 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 Luke Plant, 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 Steve Milner, 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.

Note: See TracTickets for help on using tickets.
Back to Top