Django

Code

Ticket #9789 (closed: fixed)

Opened 1 year ago

Last modified 1 year ago

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

Reported by: fwierzbicki Assigned to: nobody
Milestone: Component: Core framework
Version: 1.0 Keywords:
Cc: Triage Stage: Accepted
Has patch: 1 Needs documentation: 0
Needs tests: 0 Patch needs improvement: 0

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

jython_settings.diff (0.7 kB) - added by fwierzbicki on 12/09/08 13:48:27.

Change History

12/09/08 13:48:27 changed by fwierzbicki

  • attachment jython_settings.diff added.

12/09/08 13:49:43 changed by fwierzbicki

  • needs_better_patch changed.
  • has_patch set to 1.
  • needs_tests changed.
  • needs_docs changed.

12/09/08 14:38:19 changed by Alex

  • component changed from Uncategorized to Core framework.
  • stage changed from Unreviewed to Accepted.

12/09/08 19:38:49 changed by mtredinnick

  • description changed.

Edited description to stop eyeball bleeding.

12/10/08 06:42:42 changed 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.

01/19/09 06:46:54 changed by mtredinnick

  • status changed from new to closed.
  • resolution set to fixed.

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

01/19/09 06:48:42 changed 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.


Add/Change #9789 (compiled settings.py file can't be imported from Jython when using manage.py.)




Change Properties
Action