Open jsiegle opened 12 years ago
Hi jsiegle
Sorry you're having trouble. I can't really look at this properly today, but I just did this and it worked:
fish tag -f 'r&s records' image.png=FishIcon512x512.png
on OS X 10.6.8 (Snow Leopard). You can see it at:
http://fluiddb.fluidinfo.com/about/r%26s%20records/njr/image.png
Compared with yours there are two obvious differences:
But I would expect yours to work. If I miss off the .png on the tag, it still works.
fish tag -f 'r&s records' image=FishIcon512x512.png
with the result at
http://fluiddb.fluidinfo.com/about/r%26s%20records/njr/image
and if I put in the MIME specification it continues to work.
fish tag -M image/png -f 'r&s records' image2=FishIcon512x512.png
with the result at
http://fluiddb.fluidinfo.com/about/r%26s%20records/njr/image2
So I'm not sure what's up.
It looks as if Fish is trying to read your images as text files (with open(filename) rather than open(filename, 'b')), but it shouldn't be doing that. So I guess the obvious possibilities are:
Lion vs. Snow Leopard Python version (my default it 2.6.5, though I often use 2.7) The particular image. Some detail of your library/path setup vs. mine.
Could you put the image you're trying somewhere I can grab it and try it? Also, you might want to try using the png that worked for me (which, obviously, you can get from any of the URLs above).
I'll try to look at this tomorrow, but don't think I'll be able to today.
Regards
Nick
Otherwise, I'll try Lion and 2.7 and stuff
Thanks for the quick response!
I tried the same commands with your image, but it didn't help. I also tried to replicate everything on Xubuntu, and I get the same problem.
Let me know if you get a chance to look into this further, or if you can think of anything else that might be different about my configuration.
Best, Josh
Hi Josh
If you get the same behaviour on two different systems that starts to sound as if maybe there's something special about my setup that I'm unaware of, but I have several systems I can try things on, so I will try to get further.
I assume you're running version 4.34? (You can use fish -V to check.)
Assuming you are running that version, could you try running with -D (debug) and see where it fails? From the error message, I'd guess it must be line 1309 or 1312 in fishlib.py, but it shouldn't be there, it should be at line 1318 (reading it in binary mode).
Nick
Yes, the version is 4.34. I cloned it last week.
Looks like it's actually line 554 of fishlib.py (the http request), which calls httplib2, then httplib, and finally fails at line 809 of httplib.py with a UnicodeDecodeError.
Not sure if this is an anticipated use of Fluidinfo, but here's the error message: http://fluidinfo.com/about/#!/errormsg
Does that make any sense?
Ah, that probably does explain it. I switched to use requests 0.9.1 rather than httplib2 by default because (in my experience) httplib2 is really unreliable. I guess it probably means you don't have requests installed.
If you do
pip install requests==0.9.1
I suspect everything will work (assuming you have pip).
I'd like to remove the httplib2 stuff completely, but there was a problem with requests 1.0.something that made me a bit nervous. I'll try it with the latest version and if that's OK perhaps just delete the httplib2 stuff and make it a dependency.
Sorry again for the pain. Let me know if this doesn't work for you.
Nick
Looks like the requests library ends up calling the same function in httplib, with the same ultimate result:
Josh
That;'s disappointing, though you will have fewer problems with requests.
The good news is I can now reproduce it on Lion with python2.7, so I should be able to chase it down.
Nick
OK, it looks like it's a problem in python 2.7, but not python 2.6, which is slightly strange, but I think I have seen something like it before. I'll try to figure out what it is. (It works fine for me in python 2.6 under Lion.)
Nick
In the latest version of Fish, I can use the -f flag to upload text files as the content of tags, but I can't get it to work with images. I tried to follow the example code as closely as possible.
The following command works:
But these all fail:
The output is:
It doesn't matter whether I specify the MIME type or not.
I'm using bash and Python 2.7.2 in OS X 10.7, if that matters.
Thanks in advance for looking into this.