[Django] #25968: Don't ship invalid .py files; rename them at run-time

3 views
Skip to first unread message

Django

unread,
Dec 22, 2015, 2:00:46 PM12/22/15
to django-...@googlegroups.com
#25968: Don't ship invalid .py files; rename them at run-time
-------------------------------+--------------------
Reporter: lamby | Owner: nobody
Type: Uncategorized | Status: new
Component: Uncategorized | Version: 1.9
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 1
Easy pickings: 0 | UI/UX: 0
-------------------------------+--------------------
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

--
Ticket URL: <https://code.djangoproject.com/ticket/25968>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Dec 22, 2015, 2:04:15 PM12/22/15
to django-...@googlegroups.com
#25968: Don't ship invalid .py files; rename them at run-time
-------------------------------------+-------------------------------------
Reporter: lamby | Owner: nobody
Type: | Status: new
Cleanup/optimization |
Component: Core (Management | Version: 1.9
commands) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by claudep):

* needs_better_patch: => 1
* component: Uncategorized => Core (Management commands)
* needs_tests: => 0
* needs_docs: => 0
* type: Uncategorized => Cleanup/optimization
* stage: Unreviewed => Accepted


Comment:

Read also [https://groups.google.com/forum/#!msg/django-
developers/nPShxGatRuE/HgSGrgMDBgAJ the django-dev discussion].

--
Ticket URL: <https://code.djangoproject.com/ticket/25968#comment:1>

Django

unread,
Jan 24, 2016, 8:05:37 AM1/24/16
to django-...@googlegroups.com
#25968: Don't ship invalid .py files; rename them at run-time
-------------------------------------+-------------------------------------
Reporter: lamby | Owner: nobody

Type: | Status: new
Cleanup/optimization |
Component: Core (Management | Version: 1.9
commands) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by timgraham):

* needs_better_patch: 1 => 0


--
Ticket URL: <https://code.djangoproject.com/ticket/25968#comment:2>

Django

unread,
Jan 25, 2016, 12:43:38 PM1/25/16
to django-...@googlegroups.com
#25968: Don't ship invalid .py files; rename them at run-time
-------------------------------------+-------------------------------------
Reporter: lamby | Owner: nobody
Type: | Status: closed

Cleanup/optimization |
Component: Core (Management | Version: 1.9
commands) |
Severity: Normal | Resolution: fixed

Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Tim Graham <timograham@…>):

* status: new => closed
* resolution: => fixed


Comment:

In [changeset:"abc0777b63057e2ff97eee2ff184356051e14c47" abc0777b]:
{{{
#!CommitTicketReference repository=""
revision="abc0777b63057e2ff97eee2ff184356051e14c47"
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.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/25968#comment:3>

Django

unread,
Jan 25, 2016, 12:51:35 PM1/25/16
to django-...@googlegroups.com
#25968: Don't ship invalid .py files; rename them at run-time
-------------------------------------+-------------------------------------
Reporter: lamby | Owner: nobody

Type: | Status: closed
Cleanup/optimization |
Component: Core (Management | Version: 1.9
commands) |
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Tim Graham <timograham@…>):

In [changeset:"3306106fb1ce610e0961ce319a98e33c93795c1f" 3306106]:
{{{
#!CommitTicketReference repository=""
revision="3306106fb1ce610e0961ce319a98e33c93795c1f"
[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
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/25968#comment:4>

Reply all
Reply to author
Forward
0 new messages