Problem description
On Desktop Linux, this command works:
python -c "import libxml2; libxml2.createFileParserCtxt('test')"
however, on Termux, the command has this output, which does not match the output on Desktop Linux.
Traceback (most recent call last):
File "<string>", line 1, in <module>
import libxml2; libxml2.createFileParserCtxt('test')
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: module 'libxml2' has no attribute 'createFileParserCtxt'
What steps will reproduce the bug?
pkg upgrade
pkg install libxml2-python
python -c "import libxml2; libxml2.createFileParserCtxt('test')"
What is the expected behavior?
No output, or, in the case of test not being an existing file, this output is expected instead:
I/O warning : failed to load "test": No such file or directory
Traceback (most recent call last):
File "<string>", line 1, in <module>
import libxml2; libxml2.createFileParserCtxt('test')
~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^
File "/usr/lib/python3.13/site-packages/libxml2.py", line 1431, in createFileParserCtxt
if ret is None:raise parserError('xmlCreateFileParserCtxt() failed')
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
libxml2.parserError: xmlCreateFileParserCtxt() failed
System information
Termux Variables:
TERMUX_APP_PACKAGE_MANAGER=apt
TERMUX_APP__APK_FILE=/data/app/~~V6ZnvtL2KaT1It2i86M9Xw==/com.termux-AnZFMelgltzLjG9LcSfvYQ==/base.apk
TERMUX_APP__APK_RELEASE=F_DROID
TERMUX_APP__APP_VERSION_CODE=1022
TERMUX_APP__APP_VERSION_NAME=0.119.0-beta.3
TERMUX_APP__DATA_DIR=/data/user/0/com.termux
TERMUX_APP__IS_DEBUGGABLE_BUILD=false
TERMUX_APP__IS_INSTALLED_ON_EXTERNAL_STORAGE=false
TERMUX_APP__LEGACY_DATA_DIR=/data/data/com.termux
TERMUX_APP__PACKAGE_NAME=com.termux
TERMUX_APP__PID=4511
TERMUX_APP__SE_FILE_CONTEXT=u:object_r:app_data_file:s0:c237,c256,c512,c768
TERMUX_APP__SE_INFO=default:targetSdkVersion=28:complete
TERMUX_APP__TARGET_SDK=28
TERMUX_VERSION=0.119.0-beta.3
TERMUX__APPS_DIR=/data/user/0/com.termux/termux/apps
TERMUX__HOME=/data/data/com.termux/files/home
TERMUX__PREFIX=/data/data/com.termux/files/usr
TERMUX__ROOTFS_DIR=/data/data/com.termux/files
TERMUX__SE_PROCESS_CONTEXT=u:r:untrusted_app_27:s0:c237,c256,c512,c768
TERMUX__UID=10237
TERMUX__USER_ID=0
Packages CPU architecture:
aarch64
Subscribed repositories:
# sources.list
deb https://packages-cf.termux.dev/apt/termux-main stable main
# tur-repo (sources.list.d/tur.list)
deb https://tur.kcubeterm.com tur-packages tur tur-on-device tur-continuous
# sources.list.d/glibc.list.bak
deb https://packages-cf.termux.dev/apt/termux-glibc/ glibc stable
# sources.list.d/tur.list.bak
deb https://tur.kcubeterm.com tur-packages tur tur-on-device tur-continuous
# glibc-repo (sources.list.d/glibc.list)
deb https://packages-cf.termux.dev/apt/termux-glibc/ glibc stable
# sources.list.d/root.list.bak
deb https://packages-cf.termux.dev/apt/termux-root root stable
# sources.list.d/x11.list.bak
deb https://packages-cf.termux.dev/apt/termux-x11 x11 main
# sources.list.d/termux-adb.list
deb https://nohajc.github.io termux extras
# x11-repo (sources.list.d/x11.list)
deb https://packages-cf.termux.dev/apt/termux-x11 x11 main
Updatable packages:
All packages up to date
termux-tools version:
1.45.0
Android version:
13
Kernel build information:
Linux localhost 4.14.190-lineage-gef0cb31b13 #4 SMP PREEMPT Fri Jun 23 13:11:47 CEST 2023 aarch64 Android
Device manufacturer:
samsung
Device model:
SM-A705FN
Supported ABIs:
SUPPORTED_ABIS: arm64-v8a,armeabi-v7a,armeabi
SUPPORTED_32_BIT_ABIS: armeabi-v7a,armeabi
SUPPORTED_64_BIT_ABIS: arm64-v8a
LD Variables:
LD_LIBRARY_PATH=
LD_PRELOAD=/data/data/com.termux/files/usr/lib/libtermux-exec-ld-preload.so
Installed termux plugins:
com.termux.widget versionCode:1001
com.termux.api versionCode:1002
com.termux.styling versionCode:1000
com.termux.boot versionCode:1000
com.termux.x11 versionCode:15
com.termux.gui versionCode:7
Problem description
On Desktop Linux, this command works:
python -c "import libxml2; libxml2.createFileParserCtxt('test')"however, on Termux, the command has this output, which does not match the output on Desktop Linux.
What steps will reproduce the bug?
pkg upgrade pkg install libxml2-python python -c "import libxml2; libxml2.createFileParserCtxt('test')"What is the expected behavior?
No output, or, in the case of
testnot being an existing file, this output is expected instead:System information