Opened 14 years ago

Closed 11 years ago

#12846 closed New feature (wontfix)

[PATCH] Support for compiled pyc files

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

Description

I am using django bundled with my app in an RPM file, and that RPM only ships pyc files, not py code. Version 1.0.4 had problems with that, and although I haven't tried later versions, browsing the code in trunk it looks like it is still an issue. I will attach a small patch that fixes it.

Thanks,
David Parker

Attachments (2)

pyc-loader.diff (582 bytes ) - added by dap 14 years ago.
bytecode_loader.diff (739 bytes ) - added by George Marshall 12 years ago.

Download all attachments as: .zip

Change History (12)

by dap, 14 years ago

Attachment: pyc-loader.diff added

comment:1 by dap, 14 years ago

Summary: Support for compiled pyc files (includes patch)[PATCH] Support for compiled pyc files

I am using django bundled with my app in an RPM file, and that RPM only ships pyc files, not py code (that is supplied in tarball format). Version 1.0.2 and 1.0.4 had problems with that, and although I haven't tried later versions, browsing the code in trunk it looks like it is still an issue. I will attach a small patch that fixes it.

Thanks,
David Parker

comment:2 by Alex Gaynor, 14 years ago

Triage Stage: UnreviewedDesign decision needed

What's the point in pyc only distribution? And what exactly is broken?

comment:3 by Russell Keith-Magee, 14 years ago

Patch needs improvement: set
Triage Stage: Design decision neededAccepted

I've seen this before - the use case is "compiled" python, so you can ship your project without shipping source. Bytecode isn't especially good obfuscation in this regard, but it's enough of a barrier to prevent casual prying eyes.

The failure means that none of the management commands can be found. The Django stack itself works fine - you just can't call syncdb etc.

I'm not especially happy with the proposed patch, though. At the very least, it should be searching for $py.class files too, to catch the Jython case. I presume a similar problem will exist for other interpreters. There is a need here for a generic "check this module exists" utility that we can use throughout Django.

There is an analogous problem in admindocs, which uses file system inspection to work out which modules have documentation.

comment:4 by Alex Gaynor, 14 years ago

Ah, in that case I suppose this fails with eggs as well?

in reply to:  4 comment:5 by James Bennett, 14 years ago

Replying to Alex:

Ah, in that case I suppose this fails with eggs as well?

Indeed. Lots of things will break or not work if you install an app as an egg; about that only thing that will work is templates, but only because we ship a special-case template loader that knows how to look inside eggs.

comment:6 by Luke Plant, 13 years ago

Type: New feature

comment:7 by Luke Plant, 13 years ago

Severity: Normal

comment:8 by Aymeric Augustin, 12 years ago

UI/UX: unset

Change UI/UX from NULL to False.

comment:9 by Aymeric Augustin, 12 years ago

Easy pickings: unset

Change Easy pickings from NULL to False.

by George Marshall, 12 years ago

Attachment: bytecode_loader.diff added

comment:10 by Claude Paroz, 11 years ago

Resolution: wontfix
Status: newclosed

These sorts of requests have been won't fixed in other tickets (see #14952). Closing.

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