This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: zipfile crash on windows, detected during pip install pyodbc-4.0.32-cp310-cp310-win_amd64.whl
Type: behavior Stage: resolved
Components: Windows Versions: Python 3.10
process
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: Nosy List: Martin-Forster, christian.heimes, paul.moore, steve.dower, tim.golden, zach.ware
Priority: normal Keywords:

Created on 2022-01-26 14:14 by Martin-Forster, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Messages (5)
msg411750 - (view) Author: Martin Forster (Martin-Forster) Date: 2022-01-26 14:14
pyth10n 3.10.1, windows x64  install of yodbc-4.0.32-cp310-cp310-win_amd64.whl crashes.

<zipfile._SharedFile object at 0x0000023B4C7E5900> pos: 74196
<zipfile._SharedFile object at 0x0000023B4C7E5900> pos: 74226
<zipfile._SharedFile object at 0x0000023B4C7E5B40> pos: -3
ERROR: Could not install packages due to an OSError.
Traceback (most recent call last):
  File "C:\git\idfunctiondb\venv\lib\site-packages\pip\_internal\commands\install.py", line 390, in run
    installed = install_given_reqs(
  File "C:\git\idfunctiondb\venv\lib\site-packages\pip\_internal\req\__init__.py", line 73, in install_given_reqs
    requirement.install(
  File "C:\git\idfunctiondb\venv\lib\site-packages\pip\_internal\req\req_install.py", line 758, in install
    install_wheel(
  File "C:\git\idfunctiondb\venv\lib\site-packages\pip\_internal\operations\install\wheel.py", line 794, in install_wheel
    _install_wheel(
  File "C:\git\idfunctiondb\venv\lib\site-packages\pip\_internal\operations\install\wheel.py", line 637, in _install_wheel
    file.save()
  File "C:\git\idfunctiondb\venv\lib\site-packages\pip\_internal\operations\install\wheel.py", line 404, in save
    with self._zip_file.open(zipinfo) as f:
  File "C:\Python310\lib\zipfile.py", line 1520, in open
    fheader = zef_file.read(sizeFileHeader)
  File "C:\Python310\lib\zipfile.py", line 743, in read
    self._file.seek(self._pos)
OSError: [Errno 22] Invalid argument

Please note i added the line 742 with the content: print(str(self) + ' pos: ' + str(self._pos) )

to help to find the root cause.
it Looks like that file.tell, returns a negative number, which kill file.seek.
msg411751 - (view) Author: Christian Heimes (christian.heimes) * (Python committer) Date: 2022-01-26 14:19
https://pypi.org/project/pyodbc/4.0.32/#files has no wheels for Python 3.10. Where did you get the binary wheels from?
msg411754 - (view) Author: Martin Forster (Martin-Forster) Date: 2022-01-26 14:30
it tried one built on my own, 
and the one from https://www.lfd.uci.edu/~gohlke/pythonlibs/#pyodbc
msg411755 - (view) Author: Martin Forster (Martin-Forster) Date: 2022-01-26 14:31
i opened a issue at pyodbc as well, 
https://github.com/mkleehammer/pyodbc/issues/1015
msg411775 - (view) Author: Martin Forster (Martin-Forster) Date: 2022-01-26 16:51
The wheel file was corrupt, due to git taking care of "CRLF/LF" conversion.
Sorry for the fuss
History
Date User Action Args
2022-04-11 14:59:55adminsetgithub: 90695
2022-01-26 16:51:15Martin-Forstersetstatus: open -> closed
resolution: not a bug
messages: + msg411775

stage: resolved
2022-01-26 14:31:18Martin-Forstersetmessages: + msg411755
2022-01-26 14:30:51Martin-Forstersetmessages: + msg411754
2022-01-26 14:19:06christian.heimessettype: crash -> behavior

messages: + msg411751
nosy: + christian.heimes
2022-01-26 14:14:52Martin-Forstercreate