[Bug 2145034] Re: py3compile fails due to LD_PRELOAD ='' in environment (in some cases)

Paul Cosway 2145034 at bugs.launchpad.net
Tue Mar 24 19:47:32 UTC 2026


The Termux people are looking into this.

Question:   if the objective of the line env["LD_PRELOAD"] = "" is to 
unset (or remove) LD_PRELOAD from the environment, wouldn't it be more 
appropriate to use env.pop("LD_PRELOAD","") ?    That would remove any 
pair with the key LD_PRELOAD.  That sounds like a better match than 
setting it to "".

It might not matter on most systems, but on my device running Android 
7.0 it does make a difference.

Paul Cosway

pcosway at alum.mit.edu
Phone: +1 617 407 3230

On 3/21/26 1:04 PM, Paul Cosway wrote:
> Thanks. I have reported it, they understand and have confirmed the 
> problem (limited to Android 7) and are working on a fix.
>
> Paul Cosway
>
> pcosway at alum.mit.edu
> Phone: +1 617 407 3230
>
> On 3/20/26 6:41 PM, Stefano Rivera wrote:
>> Please report this bug to termux.
>>
>> If there is an issue in py3compile, a termux developer who understands
>> what's going on and how their environment is triggering the bug can
>> explain it to us in Debian's bugtracker.
>>
>> ** Changed in: python3-defaults (Ubuntu)
>>         Status: New => Invalid
>>

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to python3-defaults in Ubuntu.
https://bugs.launchpad.net/bugs/2145034

Title:
  py3compile fails due to LD_PRELOAD ='' in environment (in some cases)

Status in python3-defaults package in Ubuntu:
  Invalid

Bug description:
  System:   Samsung Galaxy S6 running Android 7.0, with fresh install of
  Termux 0.118.3

  When I install python using pkg install python I get the following error:
  Traceback (most recent call last):
    File "/data/data/com.termux/files/usr/bin/py3compile", line 323, in <module>
      main()
      ~~~~^^
    File "/data/data/com.termux/files/usr/bin/py3compile", line 284, in main
      pkg_files = tuple(dpf.from_package(options.package))
    File "/data/data/com.termux/files/usr/lib/python3.13/debpython/files.py", line 85, in from_package
      raise Exception("cannot get content of %s" % package_name)
  Exception: cannot get content of python

  Same messages also appear for python-pip.

  Note:  I don't actually know if this creates a problem with the
  installation!  I assume that it must, as files.py is not returning the
  expected results.

  I have tested several changes to files.py and determined that the
  cause of the error seems to be the line:  env["LD_PRELOAD"] = "".   If
  I remove that, the install works fine.

  I have done the same installation on a Lenovo tablet running Android
  11 and it works fine, so the LD_PRELOAD is not always a problem.   I
  do not know enough to have any theory about why it causes a problem on
  the Android 7 device.   I have done factory resets and several
  reinstalls of Termux and always get the same problem from files.py.

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/python3-defaults/+bug/2145034/+subscriptions




More information about the foundations-bugs mailing list