Opened 15 years ago
Closed 12 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)
Change History (12)
by , 15 years ago
Attachment: | pyc-loader.diff added |
---|
comment:1 by , 15 years ago
Summary: | Support for compiled pyc files (includes patch) → [PATCH] Support for compiled pyc files |
---|
comment:2 by , 15 years ago
Triage Stage: | Unreviewed → Design decision needed |
---|
What's the point in pyc only distribution? And what exactly is broken?
comment:3 by , 15 years ago
Patch needs improvement: | set |
---|---|
Triage Stage: | Design decision needed → Accepted |
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:5 by , 15 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 , 14 years ago
Type: | → New feature |
---|
comment:7 by , 14 years ago
Severity: | → Normal |
---|
by , 13 years ago
Attachment: | bytecode_loader.diff added |
---|
comment:10 by , 12 years ago
Resolution: | → wontfix |
---|---|
Status: | new → closed |
These sorts of requests have been won't fixed in other tickets (see #14952). Closing.
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