python-amazon-sp-api
python-amazon-sp-api copied to clipboard
Fix create_feed_document upload encoding
Hi,
I had trouble uploading POST_FLAT_FILE_LISTINGS_DATA Feeds with the create_feed_document method to the Amazon Germany marketplace that contained special German characters (ä,ö,ü,ß). The encoding of the characters that arrived at Amazon seemed wrong, even though the ISO-8859-1 encoding should be correct. I'm not 100% sure if my code change is correct in all cases, but it did the trick for me.
Decoding in that place seems wrong to me, because it converts already encoded upload data back to str, which is then uploaded with the default encoding of requests which I think is UTF-8, which Amazon cannot handle.
Thanks for the great library!
Hi,
thanks for the PR!
Did you test this with other marketplaces than DE? I'm afraid it will break things for others, happy to try over the weekend.
I tested it with Amazon US and had no issues. However, for US, it also worked for me before because there were never any special characters in those uploads, which makes it a bit meaningless I guess.
Unfortunately I don't have any listings on other marketplaces
Got it. Thanks for that. I'll have a look the next couple of days, I think it will keep working after looking over it more.
Can confirm we have the same problem and this solutions seems to fix it. @saleweaver Is there a chance to get this merged?
Sorry, thought I did that some time ago... just merged, will add a release tonight