folders2flickr
folders2flickr copied to clipboard
Uploading without creating sets [OS X]
The upload runs perfectly, but when it tries to create a set, I get the following stack trace:
Traceback (most recent call last):
File "./folders2flickr", line 8, in
The debug.log says: 2014-10-18 01:10:04,118 DEBUG successful. 2014-10-18 01:10:04,121 DEBUG tags2set: Started tags2set
EDIT I'm just realising that it may not be completely apparent for everybody. I'm on OS X Yosemite with python .7.8 installed via Homebrew.
Hmm, looks like it can't write the shelve file. maybe there are some differences in the semantics if it's already opened on Mac? The stack trace looks promising, I'll take a look.
I can confirm this issue on Yosemite with the same python version (2.7.8_2 installed via homebrew), and with exactly the same stacktrace as in the original post by @MadsWesti.
Not sure if this has any relation to the root cause, but the tag that the script is generating contains hashes and forward slashes, i.e. #/Downloaded#Albums/100069383912684544889/Barcelona#13
. Also further up in the log I see exceptions.UnicodeEncodeError, but those don't seem to be fatal.
Update: apparently it is a known issue on OSX: https://github.com/shazow/urllib3/issues/63 - that ticket contains a dirty workaround.
What I ended up doing was an even dirtier return in tags2sets.py:line 92:
try:
uploaded = shelve.open( historyFile )
except Exception, e:
print e
print "Aborting createSets()..."
return
I don't think the hashes and forward slashes are the issue. I'm currently running the script on my Linux server and everything works with no issues and images are tagged as "#path/to/file/filename.JPG". I think it's related to gdbm, but thats just a hunch.
@richq: I think I may have solved it. By adding "self.uploaded.close()" at the end of the "upload" function in uploadr.py. Both sets and tags seems to work.