Opened 10 years ago
Closed 10 years ago
#935 closed defect (fixed)
Raw Image gets unicodedecodeerror on logging debug data
Reported by: | Odin Hørthe Omdal (Velmont) | Owned by: | |
---|---|---|---|
Priority: | major | Milestone: | |
Component: | programming | Keywords: | exception |
Cc: | Christopher Allan Webber, Elrond | Parent Tickets: |
Description
Forgot to encode to utf-8 first.
Have patch.
Attachments (2)
Change History (8)
by , 10 years ago
Attachment: | 0001-Raw-image-mediatype-has-a-logging-call-not-encoding-.patch added |
---|
comment:1 by , 10 years ago
comment:2 by , 10 years ago
lol, true.
I am in Python 3 land myself, unicode is simpler there :) Of course you're very right. I'll change, test and upload. :)
by , 10 years ago
Attachment: | 0001-Raw-image-mediatype-had-a-non-unicode-logging-call.patch added |
---|
comment:3 by , 10 years ago
Don't know how to delete the old patch, -- since I changed the name on this new one.
comment:4 by , 10 years ago
Owner: | removed |
---|---|
Status: | new → review |
This should always be put in review if there is patch added to the ticket and this needs to be checked by others.
comment:5 by , 10 years ago
This really is more or less reviewed, since I did just what Chris said :)
Also have the commit on-web (not in its own branch, but on my own patch-list that I rebase on top of upstream/master):
https://github.com/Velmont/mediagoblin/commit/6907027ec1a9d24d9dd7fc8c1816782ab9cc00a2
comment:6 by , 10 years ago
Resolution: | → fixed |
---|---|
Status: | review → closed |
Merged, rebased, pushed. Thank you!
Hm. I think this may be backwards! Encoding to utf-8 means encoding to a bytestring, which it looks like yeah, the parent is also a bytestring in python2, so not surprising this is happening.
However, I think it might be better if we did the reverse... instead,
'Wrote new file from {0} to preview (jpg) {1}'
should becomeu'Wrote new file from {0} to preview (jpg) {1}'
In that case, I don't think you need to encode (if anything, maybe decode, but you shouldn't decode something if it's already unicode, which it looks like this probably is?)
Could you test that and see if it works? If so, I'd be happy to merge this in.