Coerce title to unicode type in TorrentLeech search plugin#1302
Coerce title to unicode type in TorrentLeech search plugin#1302danielkza wants to merge 1 commit intoFlexget:developfrom
Conversation
There was a problem hiding this comment.
That will not work in Py3 afaik. http://python-future.org/compatible_idioms.html#unicode
There was a problem hiding this comment.
Right. Since future.builtins.* is already imported, it should just be a matter of using str() instead, correct?
Pulling it directly from the BeautifulSoup model will cause the whole document tree to be stored in the Entry. It can cause excessive recursion errors during serialization, and is not necessary at all. Fixes Flexget#1301.
cec51bf to
540e088
Compare
|
use: |
|
Looking at the BS4 source code, it doesn't seem like
|
|
Hmm, I see ... then we have a few other places where the same fix needs to be done. |
|
Hmm, I think we used to cast all strings to unicode when setting on entry and lost a bit of that on the py3 upgrade. Perhaps we should add something here to solve this for all cases? Line 197 in b92f47a Maybe elif isinstance(value, str) and type(value) not in (str, text_type):
# Cast string subclasses (e.g. NavigableString) back to regular strings
value = str(value)
|
|
I'm with you @gazpachoking, that seems like a more correct approach |
|
Any progress on this? |
|
I don't know enough about flexget and how DB interactions are handled to Em seg, 8 de ago de 2016 10:55, Claus Vium notifications@github.com
|
|
Well, @gazpachoking proposed a fix. Try it. |
|
I somehow missed his comment, my bad. Em seg, 8 de ago de 2016 11:04, Claus Vium notifications@github.com
|
|
Closed in favor of generic solution in #1337. |
Pulling it directly from the BeautifulSoup model will cause the whole
document tree to be stored in the Entry. It can cause excessive
recursion errors during serialization, and is not necessary at all.
Fixes #1301.