#2 Python .save() fails if photo not on same filesystem as /tmp

closed-fixed
nobody
None
5
2009-03-25
2007-08-18
Chris Mayo
No

Tested on Linux with libiptcdata-1.0.2. Data object.save() fails with:

IOError: [Errno 18] Invalid cross-device link: 'photo.jpg'

Discussion

  • Chris Mayo

    Chris Mayo - 2007-08-30

    Logged In: YES
    user_id=808349
    Originator: YES

    File Added: libiptcdata-1.0.2-tmp.patch

     
  • David C. Moore

    David C. Moore - 2007-09-04

    Logged In: YES
    user_id=761
    Originator: NO

    Chris,

    Thanks for finding this. Your patch has been committed to the CVS version of libiptcdata.

     
  • David C. Moore

    David C. Moore - 2007-09-04
    • status: open --> closed-fixed
     
  • Chris Mayo

    Chris Mayo - 2007-09-06
    • status: closed-fixed --> open-fixed
     
  • Chris Mayo

    Chris Mayo - 2007-09-06

    Logged In: YES
    user_id=808349
    Originator: YES

    It was only meant as a quick fix because it still leaves problems. The temp file now gets written to the current directory so there are two possible errors now:
    1) The same error if the current path is on a different filesystem to the photo
    2) The user doesn't have write access to the current directory
    At least with the patch you can work around these in Python. I think the temp file should be in the same directory as the photo; it was just the limit of my C to delete a few characters from a string! (Although I'll stick my neck out and suggest that the fclose()'s should happen before the rename?)

     
  • Chris Mayo

    Chris Mayo - 2007-09-23

    Logged In: YES
    user_id=808349
    Originator: YES

    Here's my attempt at a more complete fix. Definitely needs checking!
    File Added: libiptcdata-1.0.2-py-filesystem.patch

     
  • Chris Mayo

    Chris Mayo - 2007-09-29

    Logged In: YES
    user_id=808349
    Originator: YES

    Improved patch to use the image's directory instead of full name for temp file template and use mkstemp instead of mktemp.

    File Added: libiptcdata-1.0.2-py-path.patch

     
  • David C. Moore

    David C. Moore - 2007-10-01

    Logged In: YES
    user_id=761
    Originator: NO

    Thanks for the update. I'm on a long travel right now until mid-November, so I'm not really doing much libiptcdata development at the moment, but I'll take a more thorough look at this when I return. Send me an email around then if you don't hear from me.

     
  • David C. Moore

    David C. Moore - 2009-03-25

    Better late than never.... I've updated CVS to your latest patch. I will be doing a new release shortly.

     
  • David C. Moore

    David C. Moore - 2009-03-25
    • status: open-fixed --> closed-fixed
     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks