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

Discussion in 'Python' started by Tzury Bar Yochay, Dec 29, 2008.

  1. $ ~/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
    Tzury Bar Yochay, Dec 29, 2008
    #1
    1. Advertising

  2. Tzury Bar Yochay

    Chris Rebert Guest

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

    On Mon, Dec 29, 2008 at 4:08 AM, Tzury Bar Yochay
    <> 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
    Chris Rebert, Dec 29, 2008
    #2
    1. Advertising

  3. 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
    Bruno Desthuilliers, Dec 29, 2008
    #3
  4. Tzury Bar Yochay

    John Machin Guest

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

    On Dec 29, 11:08 pm, Tzury Bar Yochay <> 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


    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
    John Machin, Dec 29, 2008
    #4
  5. Tzury Bar Yochay

    Vinay Sajip Guest

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

    On Dec 29, 12:18 pm, "Chris Rebert" <> 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
    Vinay Sajip, Dec 31, 2008
    #5
  6. Tzury Bar Yochay

    Vinay Sajip Guest

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

    On Dec 29 2008, 12:18 pm, "Chris Rebert" <> 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
    Vinay Sajip, Jan 2, 2009
    #6
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. dont bother
    Replies:
    3
    Views:
    4,162
    scriber
    Mar 31, 2009
  2. adrian
    Replies:
    4
    Views:
    710
    John J. Lee
    Apr 1, 2005
  3. rsd
    Replies:
    2
    Views:
    470
  4. kepioo
    Replies:
    0
    Views:
    467
    kepioo
    Sep 19, 2006
  5. JohannesTU
    Replies:
    0
    Views:
    260
    JohannesTU
    Feb 20, 2012
Loading...

Share This Page