Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

asynchat async_chat __init__() arguments changed in python 2.6 #48154

Closed
forest mannequin opened this issue Sep 18, 2008 · 2 comments
Closed

asynchat async_chat __init__() arguments changed in python 2.6 #48154

forest mannequin opened this issue Sep 18, 2008 · 2 comments
Assignees
Labels
stdlib Python modules in the Lib dir

Comments

@forest
Copy link
Mannequin

forest mannequin commented Sep 18, 2008

BPO 3904
Nosy @josiahcarlson

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields:

assignee = 'https://github.com/josiahcarlson'
closed_at = <Date 2008-09-19.02:08:19.834>
created_at = <Date 2008-09-18.22:27:57.009>
labels = ['library']
title = 'asynchat async_chat __init__() arguments changed in python 2.6'
updated_at = <Date 2008-09-19.02:08:19.832>
user = 'https://bugs.python.org/forest'

bugs.python.org fields:

activity = <Date 2008-09-19.02:08:19.832>
actor = 'josiahcarlson'
assignee = 'josiahcarlson'
closed = True
closed_date = <Date 2008-09-19.02:08:19.834>
closer = 'josiahcarlson'
components = ['Library (Lib)']
creation = <Date 2008-09-18.22:27:57.009>
creator = 'forest'
dependencies = []
files = []
hgrepos = []
issue_num = 3904
keywords = []
message_count = 2.0
messages = ['73405', '73413']
nosy_count = 3.0
nosy_names = ['josiahcarlson', 'forest', 'nadeem.vawda']
pr_nums = []
priority = 'normal'
resolution = 'fixed'
stage = None
status = 'closed'
superseder = None
type = None
url = 'https://bugs.python.org/issue3904'
versions = ['Python 2.6']

@forest
Copy link
Mannequin Author

forest mannequin commented Sep 18, 2008

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.
http://docs.python.org/dev/library/asynchat.html#id1

The change appears to come from Nadeem Vawda as part of bpo-1519. (See
msg57989.)

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.

@forest forest mannequin added the stdlib Python modules in the Lib dir label Sep 18, 2008
@josiahcarlson
Copy link
Mannequin

josiahcarlson mannequin commented Sep 19, 2008

Fixed documentation in revision 66510. Also, the parameters changed
long before rc2. ;)

@josiahcarlson josiahcarlson mannequin closed this as completed Sep 19, 2008
@ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stdlib Python modules in the Lib dir
Projects
None yet
Development

No branches or pull requests

0 participants