Re: [Django] #14861: Importing settings in a module that contains a logging Handler causes circular import.

2012-09-24 Thread Django
#14861: Importing settings in a module that contains a logging Handler causes
circular import.
-+-
 Reporter:  donspaulding |Owner:  Claude
 Type:  Bug  |  Paroz 
Component:  Core (Other) |   Status:  closed
 Severity:  Normal   |  Version:  master
 Keywords:   |   Resolution:  fixed
Has patch:  1| Triage Stage:  Accepted
  Needs tests:  0|  Needs documentation:  0
Easy pickings:  0|  Patch needs improvement:  0
 |UI/UX:  0
-+-
Changes (by Claude Paroz ):

 * status:  new => closed
 * owner:   => Claude Paroz 
 * resolution:   => fixed


Comment:

 In [changeset:"fc69fff9ab5bba8a6cff3eaf51f02a3204b1c015"]:
 {{{
 #!CommitTicketReference repository=""
 revision="fc69fff9ab5bba8a6cff3eaf51f02a3204b1c015"
 Fixed #14861 -- Moved logging config outside of Settings.__init__

 Thanks donspaulding for the report and simonpercivall for the
 initial patch.
 }}}

-- 
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 https://groups.google.com/groups/opt_out.




Re: [Django] #14861: Importing settings in a module that contains a logging Handler causes circular import.

2012-09-24 Thread Django
#14861: Importing settings in a module that contains a logging Handler causes
circular import.
--+
 Reporter:  donspaulding  |Owner:
 Type:  Bug   |   Status:  new
Component:  Core (Other)  |  Version:  master
 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
--+

Comment (by claudep):

 OK, I can commit it without the admonition, then we'll see if any further
 issue is raised, we can always add it later.

-- 
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 https://groups.google.com/groups/opt_out.




Re: [Django] #14861: Importing settings in a module that contains a logging Handler causes circular import.

2012-09-23 Thread Django
#14861: Importing settings in a module that contains a logging Handler causes
circular import.
--+
 Reporter:  donspaulding  |Owner:
 Type:  Bug   |   Status:  new
Component:  Core (Other)  |  Version:  master
 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
--+

Comment (by anonymous):

 I don't think there's a risk of circular import here. Settings are fully
 configured, the logging setup in itself has no dependency on models. Where
 would the risk come from?

-- 
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 https://groups.google.com/groups/opt_out.




Re: [Django] #14861: Importing settings in a module that contains a logging Handler causes circular import.

2012-09-21 Thread Django
#14861: Importing settings in a module that contains a logging Handler causes
circular import.
--+
 Reporter:  donspaulding  |Owner:
 Type:  Bug   |   Status:  new
Component:  Core (Other)  |  Version:  master
 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
--+

Comment (by claudep):

 I've just updated my patch, where I confined the logging setup in a
 private method and I also let a potential circular import warning in the
 documentation.

-- 
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 https://groups.google.com/groups/opt_out.




Re: [Django] #14861: Importing settings in a module that contains a logging Handler causes circular import.

2012-09-18 Thread Django
#14861: Importing settings in a module that contains a logging Handler causes
circular import.
--+
 Reporter:  donspaulding  |Owner:
 Type:  Bug   |   Status:  new
Component:  Core (Other)  |  Version:  master
 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
--+

Comment (by james@…):

 What if my log handler wants to use the models? by declaring an import of
 models will cause circular import of settings.

-- 
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 https://groups.google.com/groups/opt_out.




Re: [Django] #14861: Importing settings in a module that contains a logging Handler causes circular import.

2012-09-10 Thread Django
#14861: Importing settings in a module that contains a logging Handler causes
circular import.
--+
 Reporter:  donspaulding  |Owner:
 Type:  Bug   |   Status:  new
Component:  Core (Other)  |  Version:  master
 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
--+

Comment (by claudep):

 Attached patch containing simonpercivall's patch, test, and removal of
 [66312066a01af1325280b07d8e6942b03a46d650].

-- 
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 https://groups.google.com/groups/opt_out.




Re: [Django] #14861: Importing settings in a module that contains a logging Handler causes circular import.

2012-09-10 Thread Django
#14861: Importing settings in a module that contains a logging Handler causes
circular import.
--+
 Reporter:  donspaulding  |Owner:
 Type:  Bug   |   Status:  new
Component:  Core (Other)  |  Version:  master
 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 simonpercivall):

 * cc: percivall@… (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 https://groups.google.com/groups/opt_out.




Re: [Django] #14861: Importing settings in a module that contains a logging Handler causes circular import.

2012-09-09 Thread Django
#14861: Importing settings in a module that contains a logging Handler causes
circular import.
--+
 Reporter:  donspaulding  |Owner:
 Type:  Bug   |   Status:  new
Component:  Core (Other)  |  Version:  master
 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 claudep):

 * owner:  nobody =>
 * status:  reopened => new
 * type:  Uncategorized => Bug


Comment:

 OK, no need for any more examples, I've been able to create a test case to
 reproduce the issue. I will propose a patch soon (including yours).

 > I thought I would get notified by just commenting. Apparently not.
 You need to put yourself in the cc field to get notified.

-- 
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 https://groups.google.com/groups/opt_out.




Re: [Django] #14861: Importing settings in a module that contains a logging Handler causes circular import.

2012-09-09 Thread Django
#14861: Importing settings in a module that contains a logging Handler causes
circular import.
---+
 Reporter:  donspaulding   |Owner:  nobody
 Type:  Uncategorized  |   Status:  reopened
Component:  Core (Other)   |  Version:  master
 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
---+

Comment (by simonpercivall):

 I thought I would get notified by just commenting. Apparently not.

 It's still reproducible with 1.5 HEAD.

 A sample project? How? A zip? Sure, if it's necessary.

 It's pretty easy to see, however, by just looking at the code, that
 referencing settings from the logging config, directly or by importing a
 module that does, ''before'' _wrapped is set will cause infinite
 recursion. And since my patch moves logging setup to ''after'' _wrapped is
 set, the issue is resolved.

-- 
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 https://groups.google.com/groups/opt_out.




Re: [Django] #14861: Importing settings in a module that contains a logging Handler causes circular import.

2012-07-03 Thread Django
#14861: Importing settings in a module that contains a logging Handler causes
circular import.
---+
 Reporter:  donspaulding   |Owner:  nobody
 Type:  Uncategorized  |   Status:  reopened
Component:  Core (Other)   |  Version:  master
 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
---+

Comment (by claudep):

 Could you check if you can still reproduce with latest development code?
 And then, a sample project to demonstrate that your patch is solving the
 issue would be appreciated.

-- 
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] #14861: Importing settings in a module that contains a logging Handler causes circular import.

2012-07-03 Thread Django
#14861: Importing settings in a module that contains a logging Handler causes
circular import.
---+
 Reporter:  donspaulding   |Owner:  nobody
 Type:  Uncategorized  |   Status:  reopened
Component:  Core (Other)   |  Version:  master
 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
---+

Comment (by simonpercivall):

 Ping.

 Sorry for the no-content comment, but this is still very much a problem,
 and it's a simple fix, and it comes with a patch.

-- 
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] #14861: Importing settings in a module that contains a logging Handler causes circular import.

2012-03-03 Thread Django
#14861: Importing settings in a module that contains a logging Handler causes
circular import.
---+
 Reporter:  donspaulding   |Owner:  nobody
 Type:  Uncategorized  |   Status:  reopened
Component:  Core (Other)   |  Version:  SVN
 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 claudep):

 * component:  Documentation => Core (Other)


-- 
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] #14861: Importing settings in a module that contains a logging Handler causes circular import.

2012-01-13 Thread Django
#14861: Importing settings in a module that contains a logging Handler causes
circular import.
---+
 Reporter:  donspaulding   |Owner:  nobody
 Type:  Uncategorized  |   Status:  reopened
Component:  Documentation  |  Version:  SVN
 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 simonpercivall):

 * status:  closed => reopened
 * severity:   => Normal
 * resolution:  fixed =>
 * easy:   => 0
 * ui_ux:   => 0
 * type:   => Uncategorized


Comment:

 Actually, moving the logging setup from {{{Settings.__init__}}} to below
 {{{self._wrapped = Settings(settings_module)}}} in
 {{{LazySettings._setup}}} fixes the circular import (at least it fixed my
 problem). See the attached patch.

-- 
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] #14861: Importing settings in a module that contains a logging Handler causes circular import.

2011-01-02 Thread Django
#14861: Importing settings in a module that contains a logging Handler causes
circular import.
+---
  Reporter:  donspaulding   | Owner:  nobody
Status:  new| Milestone:  1.3   
 Component:  Documentation  |   Version:  SVN   
Resolution: |  Keywords:
 Stage:  Accepted   | Has_patch:  1 
Needs_docs:  0  |   Needs_tests:  0 
Needs_better_patch:  0  |  
+---
Changes (by ojii):

  * has_patch:  0 => 1

-- 
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] #14861: Importing settings in a module that contains a logging Handler causes circular import.

2010-12-07 Thread Django
#14861: Importing settings in a module that contains a logging Handler causes
circular import.
+---
  Reporter:  donspaulding   | Owner:  nobody
Status:  new| Milestone:  1.3   
 Component:  Documentation  |   Version:  SVN   
Resolution: |  Keywords:
 Stage:  Accepted   | Has_patch:  0 
Needs_docs:  0  |   Needs_tests:  0 
Needs_better_patch:  0  |  
+---
Changes (by russellm):

  * needs_better_patch:  => 0
  * component:  Uncategorized => Documentation
  * needs_tests:  => 0
  * milestone:  => 1.3
  * needs_docs:  => 0
  * stage:  Unreviewed => Accepted

Comment:

 I don't think there's much we can do here beyond having a documentation
 note warning of the problem.

-- 
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] #14861: Importing settings in a module that contains a logging Handler causes circular import.

2010-12-07 Thread Django
#14861: Importing settings in a module that contains a logging Handler causes
circular import.
---+
 Reporter:  donspaulding   |   Owner:  nobody
   Status:  new|   Milestone:
Component:  Uncategorized  | Version:  SVN   
 Keywords: |   Stage:  Unreviewed
Has_patch:  0  |  
---+
 If `settings.py` contains the following config for LOGGING:

 {{{
 LOGGING = {
   'version': 1,
   'handlers': {
 'custom_handler': {
   'level': 'INFO',
   'class': 'myproject.logconfig.MyHandler',
 }
   }
 }
 }}}

 and `myproject/logconfig.py` has the following line before the `MyHandler`
 definition:

 {{{
 from django.conf import settings
 }}}

 The dictconfig module spits out a none-too-helpful traceback:

 {{{
 Traceback (most recent call last):
   File "manage.py", line 11, in 
 execute_manager(settings)
   File
 "/home/don/myproject/src/django/django/core/management/__init__.py", line
 438, in execute_manager
 utility.execute()
   File
 "/home/don/myproject/src/django/django/core/management/__init__.py", line
 379, in execute
 self.fetch_command(subcommand).run_from_argv(self.argv)
   File
 "/home/don/myproject/src/django/django/core/management/__init__.py", line
 252, in fetch_command
 app_name = get_commands()[subcommand]
   File
 "/home/don/myproject/src/django/django/core/management/__init__.py", line
 101, in get_commands
 apps = settings.INSTALLED_APPS
   File "/home/don/myproject/src/django/django/utils/functional.py", line
 276, in __getattr__
 self._setup()
   File "/home/don/myproject/src/django/django/conf/__init__.py", line 41,
 in _setup
 self._wrapped = Settings(settings_module)
   File "/home/don/myproject/src/django/django/conf/__init__.py", line 126,
 in __init__
 logging_config_func(self.LOGGING)
   File "/home/don/myproject/src/django/django/utils/dictconfig.py", line
 553, in dictConfig
 dictConfigClass(config).configure()
   File "/home/don/myproject/src/django/django/utils/dictconfig.py", line
 352, in configure
 '%r: %s' % (name, e))
 ValueError: Unable to configure handler 'custom_handler': Unable to
 configure handler 'custom_handler': 'module' object has no attribute
 'logconfig'
 }}}

 The problem is easily rectified once you realize that it's a circular
 import.  Apart from lazily loading the logging config, I'm not even sure
 there's an appropriate code fix.  I'm mainly filing this bug to see if a
 note can be placed alongside the logging configuration docs that warns of
 the potential problem.

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