Custom Query (120 matches)


Show under each result:

Results (28 - 30 of 120)

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
Ticket Resolution Summary Owner Reporter
#102 fixed ftplib.error_reply: 226 Transfer complete. schwa ftputiluser

ftplib version: 3.2

Python version: 2.7.10

FTP server: Synology FTP server ready (this is a NAS appliance)

Client OS version: CentOS linux 6.4 - Linux serverXXX 2.6.32-358.el6.x86_64 #1 SMP Fri Feb 22 00:31:26 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux

I have implemented a python script using ftplib to transfer several images at night, usually it transfers about 1500 to 2000 images (between 500 Mb to 700 Mb) daily... the thing is that sometimes the script fails and throws the traceback:

Traceback (most recent call last):
  File "/etc/scripts/proyecto_escaneo/", line 227, in <module>
  File "/etc/scripts/proyecto_escaneo/", line 178, in main
    resp_stf = send_to_ftp(local_path,remote_path,row[2])
  File "/etc/scripts/proyecto_escaneo/", line 100, in send_to_ftp
    transfer = ftp.upload_if_newer(source_file_path, dest_file_path)
  File "/root/.pyenv/versions/2.7.10/lib/python2.7/site-packages/ftputil/", line 471, in upload_if_newer
  File "/root/.pyenv/versions/2.7.10/lib/python2.7/site-packages/ftputil/", line 184, in copy_file
    target_fobj = target_file.fobj()
  File "/root/.pyenv/versions/2.7.10/lib/python2.7/site-packages/ftputil/", line 94, in fobj
    return, self.mode)
  File "/root/.pyenv/versions/2.7.10/lib/python2.7/site-packages/ftputil/", line 180, in open
    host = self._available_child()
  File "/root/.pyenv/versions/2.7.10/lib/python2.7/site-packages/ftputil/", line 158, in _available_child
  File "/root/.pyenv/versions/2.7.10/lib/python2.7/", line 587, in pwd
    return parse257(resp)
  File "/root/.pyenv/versions/2.7.10/lib/python2.7/", line 872, in parse257
    raise error_reply, resp
ftplib.error_reply: 226 Transfer complete.

The script runs from cron at a specific time... this is the code I am using to transfer the files:

def send_to_ftp(source_path, dest_path, codigo_reg):
    resp = 0
    files = []
    counter = 0
    error_trans = 0

    if os.path.isdir(source_path):
        for item in os.listdir(source_path):


            ftp = ftputil.FTPHost(HOST_FTP, USER_FTP, PASSWD_FTP)

            if not ftp.path.isdir(dest_path):
      "Se creara directorio remoto: %s" % (dest_path))

            for file in files:
                counter += 1
                source_file_path = source_path + file
                dest_file_path = dest_path + file
                transfer = ftp.upload_if_newer(source_file_path, dest_file_path)
                if transfer == True:
          "%d Archivo %s tranferido con exito a %s" % (counter, source_file_path, dest_file_path))
                    logging.warning("%d Archivo %s NO se transfirio con exito (o ya existia en destino) a %s" % (counter, source_file_path, dest_file_path))
                    error_trans += 1

        except ftputil.error.FTPError, e:
            logging.critical("Error send_to_ftp() %s" % (e.args[0]))
            resp = -1
            return [resp, counter, error_trans, e]

            if hasattr(ftputil, "ftp"):
        resp = -2

    return [resp, counter, error_trans]

This only happens a sometimes and I can't figure it out!!!

Any help would be very helpful.

#100 fixed Wrong handling of non-ASCII characters in paths under Python 2 schwa schwa

For ticket #96, I was looking into the exact behavior of ftputil when encoding and decoding file system paths for FTPHost.listdir.

It turned out that under Python 2 ftputil doesn't work correctly with paths that contain non-ASCII characters. The intended behavior is:

Path argument is a byte string:

  • Characters are sent as they are, even if they are non-ASCII characters (i. e. character codes greater than 127).
  • Returned lines are byte strings (latin1-encoded, i. e. the data sent by the server) if the listdir argument was a byte string.

Path argument is a unicode string:

  • Unicode strings are assumed to be decoded from latin1. For example, to get the contents of the directory b'\xc3\xa4bc' (corresponding to "äbc"), the unicode string must be b'\xc3\xa4bc'.decode("latin1").
  • Returned lines are unicode strings (decoded assuming latin1 encoding).

This behavior is indeed seen when ftputil runs under Python 3. (By the way, the handling of unicode strings is strange, but it's used to be compatible with Python 3's ftplib.FTP implementation. If ftputil.FTPHost would behave differently, it couldn't work with non-ASCII paths that were created with ftplib.FTP under Python 3.)

Under Python 2, pure ASCII strings work as above regardless of being byte strings or unicode strings. However, when the strings contain characters with codes greater than 127, FTPHost.listdir raises a UnicodeEncodeError, again both for byte strings and unicode strings.

#99 fixed Host old versions of ftputil on PyPI schwa schwa

On 2015-09-24, I got the following mail:

Hello sschwarzer!

Please forgive me if this is the second (or third... I swear I tested it fully
this time!) copy you've received of this message, a bug has forced us to
resend the batch. Sorry for the extra noise D:

This is an automated message because you are listed as an owner or maintainer
of the following projects on PyPI:

* ftputil
* websourcebrowser

Due to the acceptance of PEP 470, PyPI is going to remove the ability for a
project to host it's files somewhere other than on PyPI, but still have PyPI
instruct installers (such as pip) to go and fetch this file automatically.
PEP 470 removes this feature and any project relying on it will need to either
be moved to hosting on PyPI or, if you wish to continue to host it externally,
you'll need to host your own repository and instruct your users to add that
repository to their installer. To give you time to adjust, this change will not
happen for 3 months, but after that 3 month deadline has expired, unless you
act some or all of the files for the above projects will no longer be found by
automated installers.

If you wish, there is a script available at
which can be used to automatically migrate any of the affected files for your
own projects to PyPI.

If you wish to continue to host your files yourself instead of uploading them
to PyPI, then you should follow the instructions at

If you have any questions about the migration, please first check the FAQ at which will be
updated with any questions and answers that come up during the migration

Here are all of the links that we've discovered for each project of yours which
are not currently hosted on PyPI:



Thanks for your time!

Donald Stufft
PyPI Administrator

The mentioned PEP 470 suggests that packages listed on PyPI should also be hosted there. The PEP gives good reasons for this.

I soon should make sure that the above mentioned packages are uploaded to PyPI.

The links*.tar.gz actually don't work and have to be changed to the ftputil site download page. The download page goes back to version 2.0.2. I guess I won't provide downloads for the older versions.

The download link for Websourcebrowser works (although the project is effectively unmaintained).

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
Note: See TracQuery for help on using queries.