f



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

$ ~/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
>>> logging.DatagramHandler
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
0
12/29/2008 12:08:54 PM
comp.lang.python 77058 articles. 6 followers. Post Follow

5 Replies
774 Views

Similar Articles

[PageSpeed] 32

On Mon, Dec 29, 2008 at 4:08 AM, Tzury Bar Yochay
<Afro.Systems@gmail.com> wrote:
> $ ~/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
>>>> logging.DatagramHandler
> 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

>From http://docs.python.org/library/logging.html#logging.DatagramHandler :
"The DatagramHandler class, located in the logging.handlers module [...]"

>From http://docs.python.org/library/logging.html#logging-levels :
"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

-- 
Follow the path of the Iguana...
http://rebertia.com
0
clp4858 (217)
12/29/2008 12:18:03 PM
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.
>>>> import logging
>>>> logging.DatagramHandler
> 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
0
12/29/2008 12:19:38 PM
On Dec 29, 11:08=A0pm, Tzury Bar Yochay <Afro.Syst...@gmail.com> wrote:
> $ ~/devel/ice/snoip/freespeech$ python
> Python 2.5.2 (r252:60911, Oct =A05 2008, 19:24:49)
> [GCC 4.3.2] on linux2
> Type "help", "copyright", "credits" or "license" for more information.>>>=
 import logging
> >>> logging.DatagramHandler
>
> Traceback (most recent call last):
> =A0 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
0
sjmachin (3097)
12/29/2008 12:35:48 PM
On Dec 29, 12:18 pm, "Chris Rebert" <c...@rebertia.com> wrote:
> 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
0
vinay_sajip (338)
12/31/2008 4:53:15 AM
On Dec 29 2008, 12:18 pm, "Chris Rebert" <c...@rebertia.com> wrote:
>
> "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
0
vinay_sajip (338)
1/2/2009 3:20:39 PM
Reply: