Opened 7 years ago

Closed 4 years ago

#12846 closed New feature (wontfix)

[PATCH] Support for compiled pyc files

Reported by: dap Owned by: nobody
Component: Core (Other) Version: master
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 7 years ago.
bytecode_loader.diff (739 bytes) - added by George Marshall 5 years ago.

Download all attachments as: .zip

Change History (12)

Changed 7 years ago by dap

Attachment: pyc-loader.diff added

comment:1 Changed 7 years ago by dap

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 Changed 7 years ago by Alex Gaynor

Triage Stage: UnreviewedDesign decision needed

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

comment:3 Changed 7 years ago by Russell Keith-Magee

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 Changed 7 years ago by Alex Gaynor

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

comment:5 in reply to:  4 Changed 7 years ago by James Bennett

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 Changed 6 years ago by Luke Plant

Type: New feature

comment:7 Changed 6 years ago by Luke Plant

Severity: Normal

comment:8 Changed 5 years ago by Aymeric Augustin

UI/UX: unset

Change UI/UX from NULL to False.

comment:9 Changed 5 years ago by Aymeric Augustin

Easy pickings: unset

Change Easy pickings from NULL to False.

Changed 5 years ago by George Marshall

Attachment: bytecode_loader.diff added

comment:10 Changed 4 years ago by Claude Paroz

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