Changes between Initial Version and Version 7 of Ticket #6579


Ignore:
Timestamp:
Jun 23, 2008, 1:00:12 PM (16 years ago)
Author:
Ramiro Morales
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #6579

    • Property Has patch set
    • Property Triage Stage UnreviewedAccepted
  • Ticket #6579 – Description

    initial v7  
    1 In file templatetags/__init__.py there is a line:
     1In file {{{templatetags/__init__.py}}} there is a line:
    22{{{
    33__path__.extend(__import__(a + '.templatetags', {}, {}, ['']).__path__)
    44}}}
    55
    6 __import__ method as fourth parameters gets a list of symbols to import. If this list is empty, __import__ returns the top-level package, but if the list contains anything the specified package is returned as described in http://docs.python.org/lib/built-in-funcs.html . So in this file there is a hack where not empty list but list that contains 'something' is passed - list that contains single empty name.
     6{{{__import__}}} method as fourth parameters gets a list of symbols to import. If this list is empty, {{{__import__}}} returns the top-level package, but if the list contains anything the specified package is returned as described in http://docs.python.org/lib/built-in-funcs.html . So in this file there is a hack where not empty list but list that contains 'something' is passed - list that contains single empty name.
    77
    8 But it causes some strange side-effects - the specified module is initialized twice. First with correct name and later with name followed by a dot (e.g. 'prog.app.templatetags' and 'prog.app.templatetags.' ). In some cases it may cause serious problems.
     8But it causes some strange side-effects - the specified module is initialized twice. First with correct name and later with name followed by a dot (e.g. {{{'prog.app.templatetags'}}} and {{{'prog.app.templatetags.'}}}). In some cases it may cause serious problems.
Back to Top