Opened 2 years ago

Closed 23 months ago

Last modified 23 months ago

#25968 closed Cleanup/optimization (fixed)

Don't ship invalid .py files; rename them at run-time

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

Description

via https://github.com/django/django/pull/5735

Debian packages unconditionally byte-compile .py files on installation and
do not silence errors by design. Therefore, we need a way of shipping these
invalid .py files without a .py extension but ensuring that when we
template them, they end up as .py.

We don't special-case .py files so that the all the TemplateCommand
command-line options (eg. extra_files and extensions) still work entirely
as expected and it may even be useful for other formats too.

via https://github.com/django/django/pull/5735

Change History (4)

comment:1 Changed 2 years ago by Claude Paroz

Component: UncategorizedCore (Management commands)
Patch needs improvement: set
Triage Stage: UnreviewedAccepted
Type: UncategorizedCleanup/optimization

comment:2 Changed 23 months ago by Tim Graham

Patch needs improvement: unset

comment:3 Changed 23 months ago by Tim Graham <timograham@…>

Resolution: fixed
Status: newclosed

In abc0777b:

Fixed #25968 -- Changed project/app templates to use a "py-tpl" suffix.

Debian packages unconditionally byte-compile .py files on installation and
do not silence errors by design. Therefore, we need a way of shipping these
invalid .py files without a .py extension but ensuring that when we
template them, they end up as .py.

We don't special-case .py files so that the all the TemplateCommand
command-line options (eg. extra_files and extensions) still work entirely
as expected and it may even be useful for other formats too.

comment:4 Changed 23 months ago by Tim Graham <timograham@…>

In 3306106:

[1.9.x] Fixed #25968 -- Changed project/app templates to use a "py-tpl" suffix.

Debian packages unconditionally byte-compile .py files on installation and
do not silence errors by design. Therefore, we need a way of shipping these
invalid .py files without a .py extension but ensuring that when we
template them, they end up as .py.

We don't special-case .py files so that the all the TemplateCommand
command-line options (eg. extra_files and extensions) still work entirely
as expected and it may even be useful for other formats too.

Backport of abc0777b63057e2ff97eee2ff184356051e14c47 from master

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