Repository navigation
pip install backports-datetime-fromisoformat no longer works #61
Copy link
Copy link
Closed
Description
I'm on a Mac (OSX 15.1), but this behavior has been observed on Fedora Linux as well.
When I try:
pip install backports-datetime-fromisoformat
I get:
Collecting backports-datetime-fromisoformat
Using cached backports_datetime_fromisoformat-2.0.2.tar.gz (23 kB)
Installing build dependencies ... done
Getting requirements to build wheel ... done
Preparing metadata (pyproject.toml) ... done
Building wheels for collected packages: backports-datetime-fromisoformat
Building wheel for backports-datetime-fromisoformat (pyproject.toml) ... error
error: subprocess-exited-with-error
× Building wheel for backports-datetime-fromisoformat (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> [32 lines of output]
running bdist_wheel
running build
running build_py
creating build/lib.macosx-15.0-arm64-cpython-313/backports
copying backports/__init__.py -> build/lib.macosx-15.0-arm64-cpython-313/backports
creating build/lib.macosx-15.0-arm64-cpython-313/backports/datetime_fromisoformat
copying backports/datetime_fromisoformat/__init__.py -> build/lib.macosx-15.0-arm64-cpython-313/backports/datetime_fromisoformat
running egg_info
writing backports_datetime_fromisoformat.egg-info/PKG-INFO
writing dependency_links to backports_datetime_fromisoformat.egg-info/dependency_links.txt
writing top-level names to backports_datetime_fromisoformat.egg-info/top_level.txt
reading manifest file 'backports_datetime_fromisoformat.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
adding license file 'LICENSE'
writing manifest file 'backports_datetime_fromisoformat.egg-info/SOURCES.txt'
copying backports/datetime_fromisoformat/_datetimemodule.c -> build/lib.macosx-15.0-arm64-cpython-313/backports/datetime_fromisoformat
copying backports/datetime_fromisoformat/_datetimemodule.h -> build/lib.macosx-15.0-arm64-cpython-313/backports/datetime_fromisoformat
copying backports/datetime_fromisoformat/module.c -> build/lib.macosx-15.0-arm64-cpython-313/backports/datetime_fromisoformat
copying backports/datetime_fromisoformat/timezone.c -> build/lib.macosx-15.0-arm64-cpython-313/backports/datetime_fromisoformat
copying backports/datetime_fromisoformat/timezone.h -> build/lib.macosx-15.0-arm64-cpython-313/backports/datetime_fromisoformat
running build_ext
building 'backports._datetime_fromisoformat' extension
creating build/temp.macosx-15.0-arm64-cpython-313/backports/datetime_fromisoformat
clang -fno-strict-overflow -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -O3 -Wall -I/Users/marcoz/prj/rp2/.venv/include -I/opt/homebrew/opt/python@3.13/Frameworks/Python.framework/Versions/3.13/include/python3.13 -c backports/datetime_fromisoformat/_datetimemodule.c -o build/temp.macosx-15.0-arm64-cpython-313/backports/datetime_fromisoformat/_datetimemodule.o
backports/datetime_fromisoformat/_datetimemodule.c:795:25: error: call to undeclared function '_PyUnicode_Copy'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
PyObject *str_out = _PyUnicode_Copy(dtstr);
^
backports/datetime_fromisoformat/_datetimemodule.c:795:15: error: incompatible integer to pointer conversion initializing 'PyObject *' (aka 'struct _object *') with an expression of type 'int' [-Wint-conversion]
PyObject *str_out = _PyUnicode_Copy(dtstr);
^ ~~~~~~~~~~~~~~~~~~~~~~
2 errors generated.
error: command '/usr/bin/clang' failed with exit code 1
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for backports-datetime-fromisoformat
Failed to build backports-datetime-fromisoformat
ERROR: ERROR: Failed to build installable wheels for some pyproject.toml based projects (backports-datetime-fromisoformat)
Any help would be appreciated, thanks.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
Activity
movermeyer commentedon Dec 27, 2024
@eprbell Thanks for reporting this. I'll look into it when I can.
That said, this package does nothing in Python 3.11+, so you don't need it in Python 3.13 (that I see in the provided stack trace).
You can conditionally install it, by adding
; python_version < '3.11'to the dependency inpyproject.toml.Something like:
pyproject.toml:eprbell commentedon Dec 27, 2024
Thanks for the quick response and the tip. While it's true that in this instance I am using Python 3.13, the package supports 3.8+, so the problem would persist for people with older versions.
movermeyer commentedon Dec 28, 2024
@eprbell I believe that the problem only occurs in Python 3.13+, and is a result of python/cpython#106382
For example, on Python 3.12, it works fine:
But on Python 3.13, it fails in the way that you described.
When I get more time, I might see about modifying the code to work on Python 3.13+, but in the meantime, adding the
; python_version < '3.11'selector should be sufficient.eprbell commentedon Dec 28, 2024
Thanks for the quick resolution: I appreciate it!
movermeyer commentedon Dec 28, 2024
Fixed in
v2.0.3.