[New-bugs-announce] [issue3904] asynchat async_chat __init__() arguments changed in python 2.6

Forest Wilkinson report at bugs.python.org
Fri Sep 19 00:27:57 CEST 2008

New submission from Forest Wilkinson <forest at users.sourceforge.net>:

In python 2.6rc2, the async_chat.__init__() parameters have changed. 
The first arg was called 'conn' in python 2.5, and it is now called
'sock'.  This change breaks code that worked with previous python 2.x
versions, if that code followed the example in the official docs:

  class http_request_handler(asynchat.async_chat):
    def __init__(self, conn, addr, sessions, log):
      asynchat.async_chat.__init__(self, conn=conn)

The change also breaks the 2.6 docs, as they have not been updated to
reflect the newly renamed parameter.

The change appears to come from Nadeem Vawda as part of issue1519.  (See

I expect that existing python code could be modified to work around the
problem by using positional args instead of keyword args.  However, I
didn't expect to have to update my working code to accommodate such a
change in the python 2.x code line.  I agree that 'sock' is a better
name for the parameter, especially since it matches the same in
asyncore.dispatcher, but should the change really happen before python
3.0?  If so, let's at least update the docs.

components: Library (Lib)
messages: 73405
nosy: forest, nvawda
severity: normal
status: open
title: asynchat async_chat __init__() arguments changed in python 2.6
versions: Python 2.6

Python tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list