Repository navigation
poetry-core 2.3.2 raises when determining macos tag version #10832
Description
Description
Description:
poetry-core throws when running in a python 3.13.13 environment on Mac. The error message is:
File "/private/var/folders/fd/vltmqhld06b2lmkxbd7sm65c0000gn/T/tmphyb4nwid/.venv/lib/python3.13/site-packages/poetry/core/_vendor/packaging/tags.py", line 410, in mac_platforms
version = cast("AppleVersion", tuple(map(int, version_str.split(".")[:2])))
ValueError: invalid literal for int() with base 10: ''Environment:
python 3.13.13
poetry 2.3.3
poetry-core 2.3.2
Host: Darwin Kernel Version 25.2.0: Tue Nov 18 21:09:56 PST 2025; root:xnu-12377.61.12~1/RELEASE_ARM64_T6041 arm64
Code:
The bug is here: https://github.com/python-poetry/poetry-core/blob/23bf0ac6b8a50a0756ef4d657d8ff67aef88aa67/src/poetry/core/_vendor/packaging/tags.py#L410
version = cast("AppleVersion", tuple(map(int, version_str.split(".")[:2])))
The bug is repeatable in that specific environment. But, changing can make this go away. For instance, downgrading to py3.12 makes the throw go away. And, some mac systems do not raise even with running with py3.13. There is a nuance here that I don't grok.
(Sorry to post this here; the poetry-core repo was not accepting new issues.)
Workarounds
Not found yet. Trying to roll back poety versions to a working configuration.
Poetry Installation Method
system package manager (eg: dnf, apt etc.)
Operating System
MacOs
Poetry Version
2.3.3
Poetry Configuration
cache-dir = "/Users/admin/Library/Caches/pypoetry"
certificates.cre.cert = false
data-dir = "/Users/admin/Library/Application Support/pypoetry"
installer.max-workers = null
installer.no-binary = null
installer.only-binary = null
installer.parallel = true
installer.re-resolve = true
keyring.enabled = true
python.installation-dir = "{data-dir}/python"
requests.max-retries = 0
solver.lazy-wheel = true
system-git-client = false
virtualenvs.create = true
virtualenvs.in-project = true
virtualenvs.options.always-copy = false
virtualenvs.options.no-pip = false
virtualenvs.options.system-site-packages = false
virtualenvs.path = "{cache-dir}/virtualenvs"
virtualenvs.prompt = "{project_name}-py{python_version}"
virtualenvs.use-poetry-python = falsePython Sysconfig
sysconfig.log
Paste the output of 'python -m sysconfig', over this line.
Example pyproject.toml
Poetry Runtime Logs
poetry-runtime.log
Traceback (most recent call last):
File "/opt/homebrew/lib/python3.11/site-packages/pyproject_hooks/_in_process/_in_process.py", line 389, in <module>
main()
~~~~^^
File "/opt/homebrew/lib/python3.11/site-packages/pyproject_hooks/_in_process/_in_process.py", line 373, in main
json_out["return_val"] = hook(**hook_input["kwargs"])
~~~~^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/lib/python3.11/site-packages/pyproject_hooks/_in_process/_in_process.py", line 280, in build_wheel
return _build_backend().build_wheel(
~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
wheel_directory, config_settings, metadata_directory
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
)
^
File "/private/var/folders/fd/vltmqhld06b2lmkxbd7sm65c0000gn/T/tmp81tqrjyd/.venv/lib/python3.13/site-packages/poetry/core/masonry/api.py", line 58, in build_wheel
return WheelBuilder.make_in(
~~~~~~~~~~~~~~~~~~~~^
poetry,
^^^^^^^
...<2 lines>...
config_settings=config_settings,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
)
^
File "/private/var/folders/fd/vltmqhld06b2lmkxbd7sm65c0000gn/T/tmp81tqrjyd/.venv/lib/python3.13/site-packages/poetry/core/masonry/builders/wheel.py", line 95, in make_in
wb.build(target_dir=directory)
~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^
File "/private/var/folders/fd/vltmqhld06b2lmkxbd7sm65c0000gn/T/tmp81tqrjyd/.venv/lib/python3.13/site-packages/poetry/core/masonry/builders/wheel.py", line 141, in build
metadata_directory = self.prepare_metadata(Path(temp_dir))
File "/private/var/folders/fd/vltmqhld06b2lmkxbd7sm65c0000gn/T/tmp81tqrjyd/.venv/lib/python3.13/site-packages/poetry/core/masonry/builders/wheel.py", line 325, in prepare_metadata
self._write_wheel_file(f)
~~~~~~~~~~~~~~~~~~~~~~^^^
File "/private/var/folders/fd/vltmqhld06b2lmkxbd7sm65c0000gn/T/tmp81tqrjyd/.venv/lib/python3.13/site-packages/poetry/core/masonry/builders/wheel.py", line 554, in _write_wheel_file
tag=self.tag,
^^^^^^^^
File "/private/var/folders/fd/vltmqhld06b2lmkxbd7sm65c0000gn/T/tmp81tqrjyd/.venv/lib/python3.13/site-packages/poetry/core/masonry/builders/wheel.py", line 443, in tag
sys_tag = next(packaging.tags.sys_tags())
File "/private/var/folders/fd/vltmqhld06b2lmkxbd7sm65c0000gn/T/tmp81tqrjyd/.venv/lib/python3.13/site-packages/poetry/core/_vendor/packaging/tags.py", line 646, in sys_tags
yield from cpython_tags(warn=warn)
File "/private/var/folders/fd/vltmqhld06b2lmkxbd7sm65c0000gn/T/tmp81tqrjyd/.venv/lib/python3.13/site-packages/poetry/core/_vendor/packaging/tags.py", line 224, in cpython_tags
platforms = list(platforms or platform_tags())
File "/private/var/folders/fd/vltmqhld06b2lmkxbd7sm65c0000gn/T/tmp81tqrjyd/.venv/lib/python3.13/site-packages/poetry/core/_vendor/packaging/tags.py", line 410, in mac_platforms
version = cast("AppleVersion", tuple(map(int, version_str.split(".")[:2])))
~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ValueError: invalid literal for int() with base 10: ''
Activity
sbowman-mitre commentedon Apr 9, 2026
This was identified as a bad interaction with python 3.13.13. When I rolled back to 3.13.12, the problem went away. This occurs for multiple versions of poetry going back to 2.2.1. But I'm no longer convinced this is a bug with poetry. I'll let you decide if you want to close or keep open to provide an in-code work around.
Fix python-poetry#10832: Handle macos tag version parsing on Python 3.13
Secrus commentedon Apr 14, 2026
@sbowman-mitre are you able to provide the output of running
On those two Python versions on your machine?