upload-scripts
upload-scripts copied to clipboard
Fails to upload with "unsupported operand type" in line (gps.timestamp - exif_timestamp) of exif.py
My System
OS Microsoft Windows 10 Pro 64bit version 10.0.19045 Build 19045 Python version 3.12.4 OSC tools from 28. Juni 2024
Description
After updating Python to version 3.12, I also updated the KartaView upload scripts. The installation of the scripts was not smooth (see Issue #143), but finally succeeded.
However, uploading the images always failed with the error message
TypeError: unsupported operand type(s) for -: “datetime.datetime” and “float”
.
Steps to Reproduce
- start OSGeo4W shell as admin
- enter commands:
cd /d P:\KartaView\upload-scripts-master
scripts\activate.bat
set PYTHONHOME=P:\OSGeo4W64\apps\Python312
python osc_tools.py upload -p P:/path/to/image_dir
The last line results in:
File "P:\KartaView\upload-scripts-master\parsers\exif\exif.py", line 137, in _gps_item
and abs(gps.timestamp - exif_timestamp) > 31556952)):
~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~
TypeError: unsupported operand type(s) for -: 'datetime.datetime' and 'float'
See also log file KVI02_Log01.txt
Additional information
The same problem occurs with the previous version of the upload scripts, which did not cause any problems for me with Python version 3.9.5. There seems to be an incompatibility between the upload scripts and Python 3.12.
Possibly related issues
#143; #140