durusmail: quixote-users: uploading multiple files on OSX (Quixote 1.0b1)
uploading multiple files on OSX (Quixote 1.0b1)
uploading multiple files on OSX (Quixote 1.0b1)
Ksenia Marasanova
2004-05-19
Hi,

I experienced an error in upload.py, when uploading multiple files on
OSX Panther:

   File
"/System/Library/Frameworks/Python.framework/Versions/2.3/lib/
python2.3/site-packages/quixote/upload.py", line 169, in _open
     fd = os.open(filename, flags)
OSError: [Errno 17] File exists:
'/Users/ksenia/Sites/tmp/upload/upload.20040518.215039.0'

I fixed it by modifying the following:


@@ -168,7 +168,7 @@
              try:
                  fd = os.open(filename, flags)
              except OSError, err:
-                if err.strerror == errno.EAGAIN:
+                if err.strerror == errno.EAGAIN or err.errno ==
errno.EEXIST:
                      # Filename collision -- try again
                      counter += 1
                  else:

So there seems to be two differences on Panther:

- err.strerror contains the actual error text "File Exists" and not the
number
- err.errno is different


Regards,
Ksenia.



reply