Fwd: ftplib sending data out of order

Charles Wilt charles.wilt at gmail.com
Fri Jun 30 12:14:46 EDT 2017


Hello,

First off, I'm not a python guy....but I use a set of python scripts
created a few years ago by somebody else to transfer source between the SVN
repo on my PC and an IBM i (aka AS/400) system.

Recently, multiple developers, including me, have started having
intermittent issues whereby the source gets sometimes gets scrambled during
the send from PC to IBM i; and it seems to be happening more and more
often.

The python script hasn't been changed, and I've been running 2.7.12; though
I've since tried upgrading to 2.7.13.

I used wireshark to capture the FTP session and have confirmed that the
data is leaving the PC in the incorrect order.  (screenshot attached)

originally our script had the following:
connection.storlines('STOR ' + ibmi_file, open(source_file.fullpath, 'rb'))

Following advice from a online midrange community, I tired some other
options for the mode & buffer on the open.

Right now,
​I'm using the following, which seesm to have reduced the occurrences of
the issue...
connection.storlines('STOR ' + ibmi_file, open(source_file.fullpath,
'Ur',0))

I tired it with buffer=1 (line) and was still seeing data being sent out of
order.

Honestly, I suspect some sort of Windows issue; as Windows is the only
thing that's changed recently.  But I'm running Win10 and another developer
that's seeing it is running Win8.

I'd appreciate any guidance you may have.

Thank you,
Charles Wilt



More information about the Python-list mailing list