Zope FTP Server is broken in Zope 2.12/Python 2.6 due to asyncore change

Bug #418454 reported by David Glick
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Python
Invalid
Undecided
Unassigned
Zope 2
Fix Released
Critical
Andreas Jung

Bug Description

When running Zope 2.12 (current svn checkout) on Python 2.6, attempting to connect via FTP results in the following traceback:

2009-08-24 22:38:17 INFO ZServer Incoming connection from 127.0.0.1:50099
2009-08-24 22:38:17 ERROR ZServer uncaptured python exception, closing channel <ZServer.FTPServer.FTPServer listening 127.0.0.1:8021 at 0x202d0f8> (<type 'exceptions.AttributeError'>:'collections.deque' object has no attribute 'push' [/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/asyncore.py|read|74] [/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/asyncore.py|handle_read_event|408] [/Users/davidg/ONENW/plonedev-4.0/src/Zope2/src/ZServer/FTPServer.py|handle_accept|666] [/Users/davidg/ONENW/plonedev-4.0/src/Zope2/src/ZServer/FTPServer.py|__init__|92] [/Users/davidg/ONENW/plonedev-4.0/src/Zope2/src/ZServer/medusa/ftp_server.py|__init__|101] [/Users/davidg/ONENW/plonedev-4.0/src/Zope2/src/ZServer/medusa/ftp_server.py|respond|244] [/Users/davidg/ONENW/plonedev-4.0/src/Zope2/src/ZServer/FTPServer.py|push|113])
2009-08-24 22:38:17 WARNING ZServer unhandled close event

This appears to be related to the fact that ZServer.FTPServer's zope_ftp_channel class overrides the 'push' method which would otherwise be inherited from asynchat.async_chat (via ZServer.medusa.ftp_server's ftp_channel class) -- but the implementation of asynchat changed in Python 2.6 to use a collections.deque instance as its producer_fifo, instead of a custom class wrapping deque, so the 'push' implementation in ZServer.FTPServer.zope_ftp_channel is now wrong for Python 2.6.

Related branches

Revision history for this message
Andreas Jung (ajung) wrote :

This is a blocker for the 2.12 final release

Changed in zope2:
status: New → Confirmed
importance: Undecided → Critical
assignee: nobody → Andreas Jung (ajung)
Revision history for this message
Andreas Jung (ajung) wrote :

I assume we need two variants of the push() methods: one for Python 2.5 (existing code) and a new one for Python 2.6 :->

Revision history for this message
Andreas Jung (ajung) wrote :

Fixed on the Zope trunk and 2.12 branch:

http://svn.zope.org/Zope/trunk/?rev=103395&view=rev
http://svn.zope.org/Zope/branches/2.12/?rev=103397&view=rev

There are no tests (except real-world tests) for this change since I don't know how to unittest this properly.

Changed in zope2:
status: Confirmed → Fix Committed
Revision history for this message
David Glick (davisagli) wrote :

Fix confirmed with Python 2.6 -- thanks Andreas!

Changed in python:
assignee: nobody → Python Development (python-dev)
Revision history for this message
Tres Seaver (tseaver) wrote :

I don't know why this assignment got made: this tracker is not monitored by the Python developers, AFAIK. At any rate, they have already said this is "WONTFIX" on the Python side. See the thread here:

 http://mail.python.org/pipermail/python-dev/2009-March/086668.html

Changed in python:
assignee: Python Development (python-dev) → nobody
status: New → Invalid
Revision history for this message
R. David Murray (rdmurray) wrote : Re: [Bug 418454] Re: Zope FTP Server is broken in Zope 2.12/Python 2.6 due to asyncore change

On Tue, 09 Feb 2010 18:34:45 +0000, Tres Seaver wrote:
> I don't know why this assignment got made: this tracker is not
> monitored by the Python developers, AFAIK. At any rate, they have

FYI I've started to monitor the python tracker, but whether I'll
have time to do anything with what shows up is a different
question :)

--
R. David Murray www.bitdance.com

Changed in zope2:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.