Re: [Django] #14698: django.utils.module_loading.module_has_submodule yields false positives

2011-01-30 Thread Django
#14698: django.utils.module_loading.module_has_submodule yields false positives
-+--
   Reporter:  lrekucki   | Owner:  nobody
 Status:  closed | Milestone:  1.3   
  Component:  Core framework |   Version:  1.2   
 Resolution:  fixed  |  Keywords:
   Triage Stage:  Ready for checkin  | Has patch:  1 
Needs documentation:  0  |   Needs tests:  0 
Patch needs improvement:  0  |  
-+--
Changes (by russellm):

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


Comment:

 (In [15362]) Fixed #14698 -- Ensure that module_has_sumodule doesn't
 mistake a cache miss for an existent package. Thanks to Ɓukasz Rekucki for
 the report and patch, and to shields for the test case.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #14698: django.utils.module_loading.module_has_submodule yields false positives

2011-01-24 Thread Django
#14698: django.utils.module_loading.module_has_submodule yields false positives
+---
  Reporter:  lrekucki   | Owner:  nobody
Status:  new| Milestone:  1.3   
 Component:  Core framework |   Version:  1.2   
Resolution: |  Keywords:
 Stage:  Ready for checkin  | Has_patch:  1 
Needs_docs:  0  |   Needs_tests:  0 
Needs_better_patch:  0  |  
+---
Old description:

> The way I found this is a bit crazy, so I'm not going to describe it all,
> but the 2 important things are:
>
>   # I have some explicit relative imports.
>   # I wanted to make a template library named the same as the application
> it contains.
>
> 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.
>
> So 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].

New description:

 The way I found this is a bit crazy, so I'm not going to describe it all,
 but the 2 important things are:

   1. I have some explicit relative imports.
   2. I wanted to make a template library named the same as the application
 it contains.

 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.

 So 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].

Comment (by ramiro):

 (re-formatted description)

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #14698: django.utils.module_loading.module_has_submodule yields false positives

2011-01-18 Thread Django
#14698: django.utils.module_loading.module_has_submodule yields false positives
+---
  Reporter:  lrekucki   | Owner:  nobody
Status:  new| Milestone:  1.3   
 Component:  Core framework |   Version:  1.2   
Resolution: |  Keywords:
 Stage:  Ready for checkin  | Has_patch:  1 
Needs_docs:  0  |   Needs_tests:  0 
Needs_better_patch:  0  |  
+---
Comment (by shields):

 I reported this in 15114 which was a duplicate.  But you may want to
 include the regression test I wrote.

 http://code.djangoproject.com/attachment/ticket/15114/sys-modules-
 none.diff

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #14698: django.utils.module_loading.module_has_submodule yields false positives

2011-01-18 Thread Django
#14698: django.utils.module_loading.module_has_submodule yields false positives
+---
  Reporter:  lrekucki   | Owner:  nobody
Status:  new| Milestone:  1.3   
 Component:  Core framework |   Version:  1.2   
Resolution: |  Keywords:
 Stage:  Ready for checkin  | Has_patch:  1 
Needs_docs:  0  |   Needs_tests:  0 
Needs_better_patch:  0  |  
+---
Changes (by shields):

 * cc: shields (added)

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #14698: django.utils.module_loading.module_has_submodule yields false positives

2010-12-30 Thread Django
#14698: django.utils.module_loading.module_has_submodule yields false positives
+---
  Reporter:  lrekucki   | Owner:  nobody
Status:  new| Milestone:  1.3   
 Component:  Core framework |   Version:  1.2   
Resolution: |  Keywords:
 Stage:  Ready for checkin  | Has_patch:  1 
Needs_docs:  0  |   Needs_tests:  0 
Needs_better_patch:  0  |  
+---
Changes (by russellm):

  * stage:  Unreviewed => Ready for checkin
  * component:  Uncategorized => Core framework
  * milestone:  => 1.3

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-upda...@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #14698: django.utils.module_loading.module_has_submodule yields false positives

2010-11-16 Thread Django
#14698: django.utils.module_loading.module_has_submodule yields false positives
+---
  Reporter:  lrekucki   | Owner:  nobody
Status:  new| Milestone:
 Component:  Uncategorized  |   Version:  1.2   
Resolution: |  Keywords:
 Stage:  Unreviewed | Has_patch:  1 
Needs_docs:  0  |   Needs_tests:  0 
Needs_better_patch:  0  |  
+---
Changes (by lrekucki):

  * needs_better_patch:  => 0
  * has_patch:  0 => 1
  * needs_tests:  => 0
  * needs_docs:  => 0

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-upda...@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



[Django] #14698: django.utils.module_loading.module_has_submodule yields false positives

2010-11-16 Thread Django
#14698: django.utils.module_loading.module_has_submodule yields false positives
---+
 Reporter:  lrekucki   |   Owner:  nobody
   Status:  new|   Milestone:
Component:  Uncategorized  | Version:  1.2   
 Keywords: |   Stage:  Unreviewed
Has_patch:  0  |  
---+
 The way I found this is a bit crazy, so I'm not going to describe it all,
 but the 2 important things are:

   # I have some explicit relative imports.
   # I wanted to make a template library named the same as the application
 it contains.

 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.

 So 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].

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-upda...@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.