[issue29468] zipfile should catch ValueError as well as OSError to detect bad seek calls

2021-05-24 Thread Filipe Laíns
Filipe Laíns added the comment: That would not stay true to its meaning. AFAIK there are no implied exceptions in file objects. Given the meaning of ValueError, I'd say it is appropriate here. -- nosy: +FFY00 ___ Python tracker

[issue29468] zipfile should catch ValueError as well as OSError to detect bad seek calls

2021-05-09 Thread Irit Katriel
Irit Katriel added the comment: Maybe a better option is to change mmap's seek() to raise an OSError, because it's supposed to behave like a file object. -- nosy: +iritkatriel versions: +Python 3.11 -Python 3.6 ___ Python tracker

[issue29468] zipfile should catch ValueError as well as OSError to detect bad seek calls

2017-02-06 Thread Joe Jevnik
New submission from Joe Jevnik: In zipfile.py only OSError is checked to see if seek fails: ``` def _EndRecData64(fpin, offset, endrec): """ Read the ZIP64 end-of-archive records and use that to update endrec """ try: fpin.seek(offset - sizeEndCentDir64Locator, 2)