Opened 7 years ago

Closed 6 years ago

Last modified 6 years ago

#9789 closed (fixed)

compiled settings.py file can't be imported from Jython when using manage.py.

Reported by: fwierzbicki Owned by: nobody
Component: Core (Other) Version: 1.0
Severity: Keywords:
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description (last modified by mtredinnick)

When running manage.py functions that depend on settings.py, Django errors out if the file has been compiled to settings$py.class in Jython. For example, when I run:

jython mysite/manage.py syncdb

I get:

Error: Could not import settings 'mysite.settings$py' (Is it on sys.path? Does it have syntax errors?): No module named settings$py

I tracked this down to django/core/management/__init__.py where the .pyc is stripped from compiled CPython files with:

settings_name = os.path.splitext(settings_filename)[0]

which works great for .pyc files, but doesn't strip the $py from the Jython compiled files. I'm attaching a simple patch.

Attachments (1)

jython_settings.diff (693 bytes) - added by fwierzbicki 7 years ago.

Download all attachments as: .zip

Change History (7)

Changed 7 years ago by fwierzbicki

comment:1 Changed 7 years ago by fwierzbicki

  • Has patch set
  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset

comment:2 Changed 7 years ago by Alex

  • Component changed from Uncategorized to Core framework
  • Triage Stage changed from Unreviewed to Accepted

comment:3 Changed 7 years ago by mtredinnick

  • Description modified (diff)

Edited description to stop eyeball bleeding.

comment:4 Changed 7 years ago by fwierzbicki

mtredinnick: heh sorry about the eyeball bleeding, I couldn't find an "edit" button for my comment. Next time I'll use preview more aggressively.

comment:5 Changed 6 years ago by mtredinnick

  • Resolution set to fixed
  • Status changed from new to closed

(In [9775]) Fixed #9789 -- Handle jython's compiled settings filename correctly.
Patch from Frank Wierzbicki.

comment:6 Changed 6 years ago by mtredinnick

(In [9776]) [1.0.X] Fixed #9789 -- Handle jython's compiled settings filename correctly.
Patch from Frank Wierzbicki.

Backport of r9775 from trunk.

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