Changes between Initial Version and Version 5 of Ticket #14698


Ignore:
Timestamp:
01/24/2011 05:16:54 PM (5 years ago)
Author:
ramiro
Comment:

(re-formatted description)

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #14698

    • Property Cc shields added
    • Property Patch needs improvement unset
    • Property Component changed from Uncategorized to Core framework
    • Property Needs tests unset
    • Property Milestone changed from to 1.3
    • Property Needs documentation unset
    • Property Has patch set
    • Property Triage Stage changed from Unreviewed to Ready for checkin
  • Ticket #14698 – Description

    initial v5  
    11The way I found this is a bit crazy, so I'm not going to describe it all, but the 2 important things are:
    22
    3   # I have some explicit relative imports.
    4   # I wanted to make a template library named the same as the application it contains.
     3  1. I have some explicit relative imports.
     4  2. I wanted to make a template library named the same as the application it contains.
    55
    6 This generally should work (tried on a fresh project), but failed with a weird error in my project: "'currencies' is not a valid tag library: ImportError raised loading company.templatetags.currencies: No module named currencies". Of course there is no such module, because it's on "currencies.templatags" application.
     6This generally should work (tried on a fresh project), but failed with a weird error in my project: `"'currencies' is not a valid tag library: ImportError raised loading company.templatetags.currencies: No module named currencies".` Of course there is no such module, because it's on "currencies.templatags" application.
    77
    88So after some debuging it turned out that module_has_submodule returns a false positive. This is because it checks {{{ if name in sys.modules }}}. To be honest, I didn't know about this, but it seems that Python sometimes also stores import misses by puting a None in to that dictionary. See [http://mail.python.org/pipermail/python-dev/2009-July/090780.html this python-dev thread].
Back to Top