Opened 6 years ago

Last modified 5 years ago

#5411 defect new

— at Traceback on Unicode data written to transportVersion 3

Reported by: Tobias Oberstein Owned by: Jean-Paul Calderone
Priority: normal Milestone:
Component: ftp Keywords:
Cc: itamarst, Adi Roiban Branch:
Author:

Description (last modified by therve)

When doing a DIR from a FTP client to a Twisted FTP based server, I got a traceback

        --- <exception caught here> ---
          File "/home/autobahn/python/lib/python2.7/site-packages/Twisted-11.1.0_r33225-py2.7-freebsd-8.2-RELEASE-p3-i386.egg/twisted/internet/defer.py", line 545, in _runCallbacks
            current.result = callback(current.result, *args, **kw)
          File "/home/autobahn/python/lib/python2.7/site-packages/Twisted-11.1.0_r33225-py2.7-freebsd-8.2-RELEASE-p3-i386.egg/twisted/protocols/ftp.py", line 907, in gotListing
            self.dtpInstance.sendListResponse(name, attrs)
          File "/home/autobahn/python/lib/python2.7/site-packages/Twisted-11.1.0_r33225-py2.7-freebsd-8.2-RELEASE-p3-i386.egg/twisted/protocols/ftp.py", line 421, in sendListResponse
            self.sendLine(self._formatOneListResponse(name, *response))
          File "/home/autobahn/python/lib/python2.7/site-packages/Twisted-11.1.0_r33225-py2.7-freebsd-8.2-RELEASE-p3-i386.egg/twisted/protocols/ftp.py", line 385, in sendLine
            self.transport.write(line + '\r\n')
          File "/home/autobahn/python/lib/python2.7/site-packages/Twisted-11.1.0_r33225-py2.7-freebsd-8.2-RELEASE-p3-i386.egg/twisted/internet/_newtls.py", line 180, in write
            FileDescriptor.write(self, bytes)
          File "/home/autobahn/python/lib/python2.7/site-packages/Twisted-11.1.0_r33225-py2.7-freebsd-8.2-RELEASE-p3-i386.egg/twisted/internet/abstract.py", line 300, in write
            raise TypeError("Data must not be unicode")
        exceptions.TypeError: Data must not be unicode

This is Twisted trunk (r33225) on FreeBSD i386 / Python 2.7.2

The Unicode data is coming from the FTP directory listing formatting function

ftp.DTP. _formatOneListResponse

Change History (4)

comment:1 Changed 6 years ago by DefaultCC Plugin

Cc: itamarst added

Changed 6 years ago by Tobias Oberstein

Attachment: ftp.patch added

comment:2 Changed 6 years ago by Tobias Oberstein

Keywords: review added
Owner: set to Jean-Paul Calderone

comment:3 Changed 6 years ago by therve

Description: modified (diff)
Note: See TracTickets for help on using tickets.