mkleehammer / pyodbc

Python ODBC bridge
https://github.com/mkleehammer/pyodbc/wiki
MIT No Attribution
2.92k stars 563 forks source link

py 3.10, win64 self compiled and alternate source package fails with OSError 22 #1015

Closed Martin-Forster closed 2 years ago

Martin-Forster commented 2 years ago

Environment

Issue

pip install pyodbc-4.0.32-cp310-cp310-win_amd64.whl fails with OSError 22

Sources for this package tested:

Full Log of pip -vvvv (venv) PS C:\project> pip install pyodbc\pyodbc-4.0.32-cp310-cp310-win_amd64.whl -vvvv pip install pyodbc\pyodbc-4.0.32-cp310-cp310-win_amd64.whl -vvvv Using pip 21.3.1 from C:\project\venv\lib\site-packages\pip (python 3.10) Non-user install because user site-packages disabled Created temporary directory: C:\Users\ContainerAdministrator\AppData\Local\Temp\pip-ephem-wheel-cache-xykc7o0g Created temporary directory: C:\Users\ContainerAdministrator\AppData\Local\Temp\pip-req-tracker-oq0rgqfh Initialized build tracking at C:\Users\ContainerAdministrator\AppData\Local\Temp\pip-req-tracker-oq0rgqfh Created build tracker: C:\Users\ContainerAdministrator\AppData\Local\Temp\pip-req-tracker-oq0rgqfh Entered build tracker: C:\Users\ContainerAdministrator\AppData\Local\Temp\pip-req-tracker-oq0rgqfh Created temporary directory: C:\Users\ContainerAdministrator\AppData\Local\Temp\pip-install-30_u0svj Processing c:\idfunctiondb\pyodbc\pyodbc-4.0.32-cp310-cp310-win_amd64.whl Added pyodbc==4.0.32 from file:///C:/project/pyodbc/pyodbc-4.0.32-cp310-cp310-win_amd64.whl to build tracker 'C:\\Users\\ContainerAdministrator\\AppData\\Local\\Temp\\pip-req-tracker-oq0rgqfh' Removed pyodbc==4.0.32 from file:///C:/project/pyodbc/pyodbc-4.0.32-cp310-cp310-win_amd64.whl from build tracker 'C:\\Users\\ContainerAdministrator\\AppData\\Local\\Temp\\pip-req-tracker-oq0rgqfh' Created temporary directory: C:\Users\ContainerAdministrator\AppData\Local\Temp\pip-unpack-h9sbga9r Installing collected packages: pyodbc ERROR: Could not install packages due to an OSError. Traceback (most recent call last): File "C:\project\venv\lib\site-packages\pip\_internal\commands\install.py", line 404, in run installed = install_given_reqs( File "C:\project\venv\lib\site-packages\pip\_internal\req\__init__.py", line 73, in install_given_reqs requirement.install( File "C:\project\venv\lib\site-packages\pip\_internal\req\req_install.py", line 802, in install install_wheel( File "C:\project\venv\lib\site-packages\pip\_internal\operations\install\wheel.py", line 729, in install_wheel _install_wheel( File "C:\project\venv\lib\site-packages\pip\_internal\operations\install\wheel.py", line 589, in _install_wheel file.save() File "C:\project\venv\lib\site-packages\pip\_internal\operations\install\wheel.py", line 388, in save with self._zip_file.open(zipinfo) as f: File "c:\program files\python310\lib\zipfile.py", line 1519, in open fheader = zef_file.read(sizeFileHeader) File "c:\program files\python310\lib\zipfile.py", line 742, in read self._file.seek(self._pos) OSError: [Errno 22] Invalid argument Removed build tracker: 'C:\\Users\\ContainerAdministrator\\AppData\\Local\\Temp\\pip-req-tracker-oq0rgqfh'(venv) PS

v-chojas commented 2 years ago

This does not appear to be a pyODBC problem. Process Monitor may be able to tell you more about the exact system call that's failing.

Martin-Forster commented 2 years ago

Hi v-Chojas, i investigated further and found and added before line 742 the command print(str(self) + ' pos: ' + str(self._pos) ) which resulted in <zipfile._SharedFile object at 0x0000023B4C7E5900> pos: 74226 <zipfile._SharedFile object at 0x0000023B4C7E5B40> pos: -3 which is the last message before the exception.

other packages install just fine, so im at a loss right now.

im pretty sure its not a pyodbc related error, i just want your opion as well.

v-chojas commented 2 years ago

Looks like it's trying to seek before the beginning of the file. Is the file corrupted?

Martin-Forster commented 2 years ago

Thanks for the question if the file is corrupted, it was indeed corrupted. Due to git taking care of "CRLF/LF" conversion. Sorry for the fuss