View Single Post
Old 07-23-2014, 02:17 PM   #19
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 45,455
Karma: 27757438
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
I give up, your output is completely self conflicting.

In the next to last post you have

print repr(u_genre) --> u"u'Fiction:General'"

If that is the case there is no way that eval(u_genre) can fail.

Code:
>>> a = u'N\\xe3o-fic\\xe7\\xe3o'
>>> print (a)
N\xe3o-fic\xe7\xe3o
>>> b = repr(a)
>>> print (b)
u'N\\xe3o-fic\\xe7\\xe3o'
>>> print (repr(b))
"u'N\\\\xe3o-fic\\\\xe7\\\\xe3o'"
>>> eval(b) == a
True
>>>
I have no idea what you are doing, but it isn't what you say you're doing.
kovidgoyal is offline   Reply With Quote