View Single Post
Old 07-23-2014, 02:09 PM   #17
DaltonST
Deviser
DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.
 
DaltonST's Avatar
 
Posts: 2,265
Karma: 2090983
Join Date: Aug 2013
Location: Texas
Device: none
Okay. Here it is, both in IDLE and then in ui.py:


This was the ui.py code:

if isinstance(u_genre, bytes):
print("u_genre is bytes", u_genre)
else:
if isinstance(u_genre, unicode): #e.g. u'N\xe3o-fic\xe7\xe3o'
print("u_genre is utf8", u_genre)
else:
print("u_genre is something else...", u_genre)
print("u_genre before repr(u_genre) ", u_genre)
u_test = u_genre
u = (repr(u_test))
print("u_genre clone after repr(clone) ", u)
print("u_genre before eval(u_genre)")
u_test = u_genre
u_test = eval(u_test) #<====== eval
print("after eval: ", u_test) #<====== failed. Line 191


------------------ print output ------------------------------------------------
calibre 1.45 [64bit] isfrozen: True is64bit: True
Windows-7-6.1.7601-SP1 Windows ('64bit', 'WindowsPE')
('Windows', '7', '6.1.7601')
Python 2.7.5
Windows: ('7', '6.1.7601', 'SP1', 'Multiprocessor Free')
Traceback (most recent call last):
File "site-packages\calibre\gui2\proceed.py", line 123, in do_ask_question
File "calibre_plugins.derive_genres.ui", line 191, in _proceed_with_updating_genres
IOError: [Errno 0] Error


I did the same thing in IDLE, and got a failure, but only after it printed it correctly:

>>> u_genre = eval(u_genre)
Traceback (most recent call last):
File "<interactive input>", line 1, in <module>
File "<string>", line 1
Não-ficção <<<<<<<<============================= CORRECT
^
SyntaxError: invalid syntax

------------------------------------------------------------------------------------
DaltonST is offline   Reply With Quote