Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre

Notices

Reply
 
Thread Tools Search this Thread
Old 02-21-2013, 12:08 AM   #1
twobits
Addict
twobits ought to be getting tired of karma fortunes by now.twobits ought to be getting tired of karma fortunes by now.twobits ought to be getting tired of karma fortunes by now.twobits ought to be getting tired of karma fortunes by now.twobits ought to be getting tired of karma fortunes by now.twobits ought to be getting tired of karma fortunes by now.twobits ought to be getting tired of karma fortunes by now.twobits ought to be getting tired of karma fortunes by now.twobits ought to be getting tired of karma fortunes by now.twobits ought to be getting tired of karma fortunes by now.twobits ought to be getting tired of karma fortunes by now.
 
Posts: 223
Karma: 1057019
Join Date: Oct 2010
Device: none
pylib.zip and zipfile.py

Never mind, think I found the issue in the script I was digging into instead of in the run time.

I am digging a bit into an issue I am having with a script that works fine when I run it under cygwin and python 2.7.3 but fails with a BadZipFile error when used as a plugin in calibre. The zip file in question passes an InfoZip unzip -t just fine and is readable on my eink device. Doing a bit of searching I think the problem in zipfile.py was fixed in this patch ( http://hg.python.org/cpython/rev/cc3255a707c7/ ) and indeed I see that patch is applied to my cygwin installation of 2.7.3.

I ran calibre in debug mode and it also seems to say it is running with 2.7.3, however when I look into the pylib.zip , the size of zipfile.pyo is 32220, while the version that works is 38423. What source version is used to make the pylib.zip file and how often is it updated?

Last edited by twobits; 02-21-2013 at 02:05 AM.
twobits is offline   Reply With Quote
Old 02-21-2013, 12:32 AM   #2
PeterT
Grand Sorcerer
PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.
 
PeterT's Avatar
 
Posts: 12,172
Karma: 73448616
Join Date: Nov 2007
Location: Toronto
Device: Nexus 7, Clara, Touch, Tolino EPOS
Take a look at http://bazaar.launchpad.net/~kovid/c...ils/zipfile.py
PeterT is offline   Reply With Quote
Advert
Old 02-21-2013, 12:53 AM   #3
twobits
Addict
twobits ought to be getting tired of karma fortunes by now.twobits ought to be getting tired of karma fortunes by now.twobits ought to be getting tired of karma fortunes by now.twobits ought to be getting tired of karma fortunes by now.twobits ought to be getting tired of karma fortunes by now.twobits ought to be getting tired of karma fortunes by now.twobits ought to be getting tired of karma fortunes by now.twobits ought to be getting tired of karma fortunes by now.twobits ought to be getting tired of karma fortunes by now.twobits ought to be getting tired of karma fortunes by now.twobits ought to be getting tired of karma fortunes by now.
 
Posts: 223
Karma: 1057019
Join Date: Oct 2010
Device: none
Quote:
Originally Posted by PeterT View Post

Thanks, that looks like it has some code to work around the same issue in it.

However



39489 Stored 39489 0% 02-14-2013 21:03 da23e813 calibre/utils/zipfile.pyo


Seems to be that file... the plugins use the standard python library one...

32220 Stored 32220 0% 02-14-2013 21:03 4803b4b7 zipfile.pyo

that does not seem to be the normal one for 2.7.3 and is missing similar fixes..

I will try and see if I can make the plugin work with the calibre/utils one but I think the run time library one should get updated to match the normal 2.7.3 one.
twobits is offline   Reply With Quote
Old 02-21-2013, 01:48 AM   #4
twobits
Addict
twobits ought to be getting tired of karma fortunes by now.twobits ought to be getting tired of karma fortunes by now.twobits ought to be getting tired of karma fortunes by now.twobits ought to be getting tired of karma fortunes by now.twobits ought to be getting tired of karma fortunes by now.twobits ought to be getting tired of karma fortunes by now.twobits ought to be getting tired of karma fortunes by now.twobits ought to be getting tired of karma fortunes by now.twobits ought to be getting tired of karma fortunes by now.twobits ought to be getting tired of karma fortunes by now.twobits ought to be getting tired of karma fortunes by now.
 
Posts: 223
Karma: 1057019
Join Date: Oct 2010
Device: none
Quote:
Originally Posted by twobits View Post
I think the run time library one should get updated to match the normal 2.7.3 one.
ok, I think it may be the same library one for both installation with the difference in length being due to paths used when it was built... I built a bad zipfile on purpose and the both throw the error from the same line number anyway... cant really be 100% sure though.... however it does seem odd that the same file can work with cygwin pythons 2.7.3 zipfile.pyo and not the one shipped with the windows pylib.zip


and I think I found the issue, the script does some things differently when invoked as a plug in that had it passing a bad path into zipfile.py , so user error then, never mind! Sorry.

Last edited by twobits; 02-21-2013 at 02:04 AM.
twobits is offline   Reply With Quote
Old 02-21-2013, 02:05 AM   #5
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: 43,866
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Why are you generating broken zip files in the first place? And if you really want to handle badly broken zip files, use the localunzip module, which extracts files ignoring the zip central record completely.
kovidgoyal is offline   Reply With Quote
Advert
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Where do I get Zip.exe? Tony_A20 ePub 24 01-26-2015 08:23 PM
PRS-T2 Difference jailbreak.zip/rupor-jailbreak.7z & minimal-root-zeam.zip/rupor-minimal.7z? hyperstruct Sony Reader Dev Corner 9 01-06-2013 02:05 PM
tools_v4.8.zip jmesar Plugins 2 03-01-2012 10:05 AM
zip app for pe Byzantius enTourage eDGe 1 07-26-2011 11:36 AM
Zip support? daruking iRex 2 08-05-2006 03:13 PM


All times are GMT -4. The time now is 03:56 PM.


MobileRead.com is a privately owned, operated and funded community.