This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: "from logging import *" causes an error under Ubuntu Karmic
Type: behavior Stage: needs patch
Components: Library (Lib) Versions: Python 2.6
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: vinay.sajip Nosy List: georg.brandl, gregorlingl, pitrou, ryles, srid, vak, vinay.sajip
Priority: critical Keywords:

Created on 2009-10-04 07:20 by vak, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (12)
msg93520 - (view) Author: Valery (vak) Date: 2009-10-04 07:20
Hi all

(I never filed a bug, so, I am not sure that all fields are OK)

Anyway, here is the self explaining issue: 

$ python 
Python 2.6.3 (r263:75183, Oct  3 2009, 11:20:50) 
[GCC 4.4.1] on linux2 
Type "help", "copyright", "credits" or "license" for more information. 
>>> from logging import * 

Traceback (most recent call last): 
  File "<stdin>", line 1, in <module> 
AttributeError: 'module' object has no attribute 'NullHandler' 
$ uname -a 
Linux vaktop 2.6.31-11-generic #38-Ubuntu SMP Fri Oct 2 11:55:55 UTC 
2009 i686 GNU/Linux 

this issue blocks me badly :(

regards
--
Valery
msg93521 - (view) Author: Valery (vak) Date: 2009-10-04 07:29
I have just installed python2.5 in addition. 
And there is no this issue with it.
So, it rather speific to python2.6
msg93523 - (view) Author: Ryan Leslie (ryles) Date: 2009-10-04 08:29
Looks like a merge has gone bad. NullHandler has existed for a while on
trunk but is not present in the 2.6.3 tag (__all__ was updated to
include it, however):

/python/tags/r263/Lib/logging/__init__.py
msg93529 - (view) Author: Gregor Lingl (gregorlingl) Date: 2009-10-04 10:27
The same True for captureWarnings? (It's also is only present in __all__)
msg93531 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2009-10-04 10:58
Georg committed a fix but now we have:

>>> from logging import *
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: 'module' object has no attribute 'captureWarnings'
msg93533 - (view) Author: Gregor Lingl (gregorlingl) Date: 2009-10-04 11:06
As stated above: the name

captureWarnings

is also present *only* in __all__. Same reason, same effect.
msg93537 - (view) Author: Vinay Sajip (vinay.sajip) * (Python committer) Date: 2009-10-04 12:25
Not quite sure what happened, yet. It may be, as Ryan said, that a merge
went wrong somewhere. I've altered Lib/logging/__init__.py in
release26-maint to remove captureWarnings from __all__.

Note that the change which introduced captureWarnings and NullHandler
was added on 03 Dec 2008 in r67511.
msg93541 - (view) Author: Vinay Sajip (vinay.sajip) * (Python committer) Date: 2009-10-04 13:08
Noticed that the code in the r262 tag (dated 13 Mar 2009) seems OK. I
don't know how to find out how this happened, i.e. is it something I did
wrong or is it something which went wrong during the release process?
Any pointers gratefully received.
msg93545 - (view) Author: Vinay Sajip (vinay.sajip) * (Python committer) Date: 2009-10-04 15:10
Ok, found it. It looks like I messed up in r72005 when fixing #5854.
Very sorry to all for the inconvenience. I will add a unit test to try
and catch this in the future.
msg93546 - (view) Author: Vinay Sajip (vinay.sajip) * (Python committer) Date: 2009-10-04 15:17
I see Benjamin's beaten me to it - thanks, Benjamin.
msg93547 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2009-10-04 16:11
I've already added logging to test___all__.py which checks the __all__
attribute.
msg93550 - (view) Author: Vinay Sajip (vinay.sajip) * (Python committer) Date: 2009-10-04 17:25
Georg Brandl  added the comment:

> I've already added logging to test___all__.py which checks the __all__
> attribute.

Sorry, I thought Benjamin did that.

Thanks and regards,

Vinay Sajip
History
Date User Action Args
2022-04-11 14:56:53adminsetgithub: 51301
2009-10-05 19:19:41sridsetnosy: + srid
2009-10-04 17:25:12vinay.sajipsetmessages: + msg93550
2009-10-04 16:11:43georg.brandlsetmessages: + msg93547
2009-10-04 15:17:10vinay.sajipsetmessages: + msg93546
2009-10-04 15:10:38vinay.sajipsetmessages: + msg93545
2009-10-04 13:08:31vinay.sajipsetmessages: + msg93541
2009-10-04 12:25:08vinay.sajipsetstatus: open -> closed
resolution: fixed
messages: + msg93537
2009-10-04 11:06:29gregorlinglsetmessages: + msg93533
2009-10-04 10:58:42pitrousetnosy: + pitrou, georg.brandl
messages: + msg93531
2009-10-04 10:27:48gregorlinglsetnosy: + gregorlingl
messages: + msg93529
2009-10-04 09:49:25pitrousetnosy: + vinay.sajip
priority: critical
assignee: vinay.sajip
type: resource usage -> behavior
stage: needs patch
2009-10-04 08:29:20rylessetnosy: + ryles
messages: + msg93523
2009-10-04 07:29:01vaksetmessages: + msg93521
2009-10-04 07:20:47vakcreate