AttributeError: 'module' object has no attribute 'DatagramHandler'(ubuntu-8.10, python 2.5.2)

T

Tzury Bar Yochay

$ ~/devel/ice/snoip/freespeech$ python
Python 2.5.2 (r252:60911, Oct 5 2008, 19:24:49)
[GCC 4.3.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.Traceback (most recent call last):


That is odd since the documentation says there is DatagramHandler for
module logging
 
C

Chris Rebert

$ ~/devel/ice/snoip/freespeech$ python
Python 2.5.2 (r252:60911, Oct 5 2008, 19:24:49)
[GCC 4.3.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.Traceback (most recent call last):


That is odd since the documentation says there is DatagramHandler for
module logging
"The DatagramHandler class, located in the logging.handlers module [...]"
"The StreamHandler and FileHandler classes are defined in the core
logging package. The other handlers are defined in a sub- module,
logging.handlers."

There's your answer. I do agree though that the "class
logging.DatagramHandler" line in the docs is misleading to say the
least. Perhaps a docs bug should be filed...

Cheers,
Chris
 
B

Bruno Desthuilliers

Tzury Bar Yochay a écrit :
$ ~/devel/ice/snoip/freespeech$ python
Python 2.5.2 (r252:60911, Oct 5 2008, 19:24:49)
[GCC 4.3.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: 'module' object has no attribute 'DatagramHandler'


That is odd since the documentation says there is DatagramHandler for
module logging

It also says that DatagramHandler is located in the logging.handlers
modules:

http://www.python.org/doc/2.5.2/lib/node415.html


HTH
 
J

John Machin

$ ~/devel/ice/snoip/freespeech$ python
Python 2.5.2 (r252:60911, Oct  5 2008, 19:24:49)
[GCC 4.3.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.>>> import logging
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: 'module' object has no attribute 'DatagramHandler'



That is odd since the documentation says there is DatagramHandler for
module logging

According to http://www.python.org/doc/2.5.2/lib/module-logging.html
"""
The StreamHandler and FileHandler classes are defined in the core
logging package. The other handlers are defined in a sub- module,
logging.handlers.
"""
and later in http://www.python.org/doc/2.5.2/lib/node415.html
"""
The DatagramHandler class, located in the logging.handlers module, ...
"""

HTH,
John
 
V

Vinay Sajip

There's your answer. I do agree though that the "class logging.DatagramHandler" line in the docs is misleading to say the
least. Perhaps a docs bug should be filed...

I've raised it on the sphinx-dev Google group. The documentation
source markup for the class just says "DatagramHandler", and the
"logging" prefix is added by Sphinx at HTML generation time.

Regards,

Vinay Sajip
 
V

Vinay Sajip

"The StreamHandler and FileHandler classes are defined in the coreloggingpackage. The other handlers are defined in a sub- module,logging.handlers."

There's your answer. I do agree though that the "classlogging.DatagramHandler" line in the docs is misleading to say the
least. Perhaps a docs bug should be filed...

This should now be fixed in the current docs - thanks to Georg Brandl
(creator of the Python documentation system).

Regards,

Vinay Sajip
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,967
Messages
2,570,148
Members
46,694
Latest member
LetaCadwal

Latest Threads

Top