Repository navigation
Only pure Python decimal module is used in Python 3.15 on Ubuntu #139994
Description
Activity
- addedtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or errorbuildThe build process and cross-buildThe build process and cross-build3.15bugs and security fixesbugs and security fixes
on Oct 12, 2025 - added a parent issue
on Oct 12, 2025 - changed the title
[-]Only pure Python decimal module is used in Python 3.15 on Ubunta[/-][+]Only pure Python decimal module is used in Python 3.15 on Ubuntu[/+]on Oct 12, 2025 I don't think this fits meaning of "regression".
Removal of the bundled libmpdec was previously announced and we already shifted schedule a little (to 3.16). The v3.15 was released only recently and only here silent fallback to bundled library was removed. It's in news, etc. It's not silent on the configure side. And nothing (modulo docs) was changed for previous versions of the CPython.
The lack of the libmpdec was a known issue for Ubuntu 24.04 (and Debian version, on which it based). (This is something was happened for me by accident, see #119299). And it has a known workaround (see our CI tests). We could document this in user docs (as we did for developers). Does this make sense for you?
Alternative - full reversion of #134078. I don't think it's a good idea - that means we shift our schedule again!
And what's special in this Ubuntu version? I beat there are lot of systems without libmpdec, available as a native package.
Reacted by Petr Viktorin and Emma Smith- addedpendingThe issue will be closed if no feedback is providedThe issue will be closed if no feedback is provided
on Oct 12, 2025 Python should fall back to the bundled version instead of pure Python implementation if system
libmpdecis not found and--with-system-libmpdecis not explicitly used.Yes, this means rollback of #134078.
Python should fall back to the bundled version instead of pure Python implementation if system libmpdec is not found and --with-system-libmpdec is not explicitly used.
Sorry, but that means we can't remove bundled libmpdec forever.
Currently we have following behavior (with
--with-system-libmpdecis our default, since 3.13): #134078 (comment)Yes, this means rollback of #134078.
What you suggest instead as a first step, before removal of the bundled copy, as scheduled in #115119?
It looks like
libmpdec-dev+libmpdec*is available for Ubuntu 22.04 and older, and also 25.04 and newer, and is just missing for the releases in-between (such as 24.04)?
https://packages.ubuntu.com/search?suite=all§ion=all&arch=any&keywords=libmpdec-dev&searchon=namesI'm presuming this is a side-effect of the package's removal from Debian and then reintroduction under a new maintainer later? xref:
Seeing that the package is available in newer Ubuntu releases again, would the Ubuntu libmpdec maintainers be open to backporting it to 24.04 too?
Whilst Ubuntu 24.04 will never ship with Python 3.15/3.16 itself, there are many people who need to build newer Python versions on all currently supported Ubuntu LTS releases.
Reacted by MikeDebian/Ubuntu need to change how they build Python to include libmpdec
No, they shouldn't change anything. Never versions of the Debian/Ubuntu - will provide package for libmpdec, as before, see #115119 (comment).
IIUC, Serhiy's issue is related to custom builds (e.g. during development) and change of meaning
./configure --with-system-libmpdec(i.e. default), introduced in v3.15.We have:
- <= 3.14:
--with-system-libmpdecwith a silent fallback to the bundled copy of libmpdec - ???
>=3.16:--with-system-libmpdec- removed, together with bundled copy. If no system library is available - only pure-Python version will be present, no configure failure (only a warning, like for other modules). PROFIT!
How to make 1->3 transition better?
- <= 3.14:
I suggest postponing the transition for a few years.
Reacted by anthony sottileI suggest postponing the transition for a few years.
How many, why? It's already postponed. What (and why?!) will be changed after XXX years, assuming the only reason to return libmpdec back into in the Debian was feedback from the CPython core dev?
Most other systems don't have libmpdec available as binary package at all. Silent fallback (#119196) to bundled library was a reaction to stupid (IMO) actions of Debian maintainers (https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1056785).
The date of End of Standard Support of Ubuntu 24.04 LTS is Apr 2029. Python 3.18 will be released after that date, so the bundled copy of libmpdec can be safely removed in 3.18.
Reacted by anthony sottileI still see a lot of arguments against.
- Ubuntu is just one Linux distribution.
- Most others lacks libmpdec in repositories and providing the bundled copy in CPython will only delay native support for this library. Remember, the libmpdec was removed from the Debian just for that reason. Do we want this again?!
- Removal was already announced (and then deferred).
- The bundled copy is outdated.
Note also, that "regression" happens for any system, which lacks the libmpdec installed (regardless on whether it's provided in repos or not). E.g. for Ubuntu 22.04. System packages are not installed magically :-) With removal in 3.18 - you only delay such "regression".
CC @vstinner
N.B.: in #134078 was mentioned alternative, when we produce a configure error with
--with-system-libmpdec(i.e. current default) and a missing system libmpdec.Reacted by Adam TurnerThere is no system libmpdec on Ubuntu 24.04 LTS. So Python 3.15 falls back to pure-Python version for the decimal module.
Maybe it's a documentation issue in the devguide. It's possible to get a package on Ubuntu with the PHP repository, see commands from the Python GitHub Actions:
cpython/.github/workflows/posix-deps-apt.sh
Lines 30 to 35 in 6ecf77d
# Workaround missing libmpdec-dev on ubuntu 24.04: # https://launchpad.net/~ondrej/+archive/ubuntu/php # https://deb.sury.org/ sudo add-apt-repository ppa:ondrej/php apt-get update apt-get -yq install libmpdec-dev Yes, this means rollback of #134078.
An alternative would be to fail with an error in Python 3.15 configure if libmpdec cannot be found, with a message suggesting to use
--without-system-libmpdec, and maybe a link to the devguide (where we can document how to install the dependency on Ubuntu 2.04).I agree with Sergey, we shouldn't needlessly block this on downstream redistributions. They took the decision to remove
libmpdec-devwhen we were already discussing this plan to eventually devendor the sources, IIUC.A
It's possible to get a package on Ubuntu with the PHP repository, see commands from the Python GitHub Actions
@vstinner, it's already documented:
Note that Debian 12 and Ubuntu 24.04 do not have the libmpdec-dev package. You can safely remove it from the install list above and the Python build will use a bundled version. But we recommend using the system libmpdec library. Either built it from sources or install this package from https://deb.sury.org/.
An alternative would be to fail with an error in Python 3.15 configure if libmpdec cannot be found, with a message suggesting to use --without-system-libmpdec
Yes, this was already suggested above.
The major drawback is that for people who don't care - this will be an additional source of pain. First, they have to add
--without-system-libmpdec, then remove it at some point in the future. I.e. in 3.16, if removal schedule will be unchanged.First, they have to add --without-system-libmpdec, then remove it at some point in the future. I.e. in 3.16, if removal schedule will be unchanged.
If the option is removed in Python 3.16, configure would just ignore the unknown option with a warning. It's not a big deal.
Example:
$ ./configure --without-unknown-option configure: WARNING: unrecognized options: --without-unknown-optionI'm going to close this in few days.
Apparently, it's not a regression. I will also update #115119: lets decide in that issue if we should make
--without-system-libmpdecmandatory to fallback on bundled copy.Closing in favor of #115119.
It's not a regression. This is an inherently incompatible change, which we have to do.
- removedpendingThe issue will be closed if no feedback is providedThe issue will be closed if no feedback is provided
on Oct 26, 2025
Bug report
There is no system libmpdec on Ubuntu 24.04 LTS. So Python 3.15 falls back to pure-Python version for the decimal module.