cannot load modpython/modperl on 1.9.x-git #962

Closed
opened 2026-10-05 04:55:42 +02:00 by adam · 3 comments
Owner

Compiled with: ./configure.sh --enable-debug --enable-ipv6 --enable-openssl --enable-zlib --enable-perl --enable-swig --enable-cyrus --enable-charset --disable-tcl --enable-i18n --enable-python

This is perl 5, version 18, subversion 2 (v5.18.2) built for x86_64-linux-gnu-thread-multi, Python 3.4.3

<MetaNova> version
<*status> ZNC 1.9.x-git-100-700fdab - https://znc.in
<*status> IPv6: yes, SSL: yes, DNS: threads, charset: yes, i18n: yes
<MetaNova> loadmod modperl
<*status> Unable to load modperl: Traceback (most recent call last):
<*status>   File "/usr/local/lib/znc/modpython/znc.py", line 899, in get_mod_info
<*status>     pymodule, datadir = find_open(modname)
<*status>   File "/usr/local/lib/znc/modpython/znc.py", line 771, in find_open
<*status>     return (module, os.path.join(module.__loader__._datadir, modname))
<*status> AttributeError: '_NamespaceLoader' object has no attribute '_datadir'
<MetaNova> loadmod modpython
<*status> Unable to load modpython: Traceback (most recent call last):
<*status>   File "/usr/local/lib/znc/modpython/znc.py", line 899, in get_mod_info
<*status>     pymodule, datadir = find_open(modname)
<*status>   File "/usr/local/lib/znc/modpython/znc.py", line 771, in find_open
<*status>     return (module, os.path.join(module.__loader__._datadir, modname))
<*status> AttributeError: '_NamespaceLoader' object has no attribute '_datadir'
<MetaNova> unloadmod modpython
<*status> Unable to determine type of modpython: Traceback (most recent call last):
<*status>   File "/usr/local/lib/znc/modpython/znc.py", line 899, in get_mod_info
<*status>     pymodule, datadir = find_open(modname)
<*status>   File "/usr/local/lib/znc/modpython/znc.py", line 771, in find_open
<*status>     return (module, os.path.join(module.__loader__._datadir, modname))
<*status> AttributeError: '_NamespaceLoader' object has no attribute '_datadir'
Compiled with: ./configure.sh --enable-debug --enable-ipv6 --enable-openssl --enable-zlib --enable-perl --enable-swig --enable-cyrus --enable-charset --disable-tcl --enable-i18n --enable-python This is perl 5, version 18, subversion 2 (v5.18.2) built for x86_64-linux-gnu-thread-multi, Python 3.4.3 ``` <MetaNova> version <*status> ZNC 1.9.x-git-100-700fdab - https://znc.in <*status> IPv6: yes, SSL: yes, DNS: threads, charset: yes, i18n: yes <MetaNova> loadmod modperl <*status> Unable to load modperl: Traceback (most recent call last): <*status> File "/usr/local/lib/znc/modpython/znc.py", line 899, in get_mod_info <*status> pymodule, datadir = find_open(modname) <*status> File "/usr/local/lib/znc/modpython/znc.py", line 771, in find_open <*status> return (module, os.path.join(module.__loader__._datadir, modname)) <*status> AttributeError: '_NamespaceLoader' object has no attribute '_datadir' <MetaNova> loadmod modpython <*status> Unable to load modpython: Traceback (most recent call last): <*status> File "/usr/local/lib/znc/modpython/znc.py", line 899, in get_mod_info <*status> pymodule, datadir = find_open(modname) <*status> File "/usr/local/lib/znc/modpython/znc.py", line 771, in find_open <*status> return (module, os.path.join(module.__loader__._datadir, modname)) <*status> AttributeError: '_NamespaceLoader' object has no attribute '_datadir' <MetaNova> unloadmod modpython <*status> Unable to determine type of modpython: Traceback (most recent call last): <*status> File "/usr/local/lib/znc/modpython/znc.py", line 899, in get_mod_info <*status> pymodule, datadir = find_open(modname) <*status> File "/usr/local/lib/znc/modpython/znc.py", line 771, in find_open <*status> return (module, os.path.join(module.__loader__._datadir, modname)) <*status> AttributeError: '_NamespaceLoader' object has no attribute '_datadir' ``` <!-- github-sync-id:702334516 -->
adam closed this issue 2026-10-05 04:55:42 +02:00
Author
Owner

No idea about this issue in general, I just wanted to say: Why does modperl try to run Python code from modpython?

<*status> Unable to load modperl: Traceback (most recent call last):
<*status>   File "/usr/local/lib/znc/modpython/znc.py", line 899, in get_mod_info
No idea about this issue in general, I just wanted to say: Why does modperl try to run Python code from modpython? ``` <*status> Unable to load modperl: Traceback (most recent call last): <*status> File "/usr/local/lib/znc/modpython/znc.py", line 899, in get_mod_info ``` <!-- github-comment-id:693418927 -->
Author
Owner

Modperl just happens to be the next module to be loaded after modpython. The issue is somewhere in CModPython::OnModuleLoading

This seems related to #1724

Modperl just happens to be the next module to be loaded after modpython. The issue is somewhere in `CModPython::OnModuleLoading` This seems related to #1724 <!-- github-comment-id:693423749 -->
Author
Owner

Modperl just happens to be the next module to be loaded after modpython.

Clarification: this is specific to modperl. Modperl has a directory in lib/znc/, and that directory is understood by updated modpython as as way to load subpackages like modperl/foo.py. Modpython sees the dir, and assumes that modperl is a python module, and tries to load it as a python module, and fails.

> Modperl just happens to be the next module to be loaded after modpython. Clarification: this is specific to modperl. Modperl has a directory in lib/znc/, and that directory is understood by updated modpython as as way to load subpackages like `modperl/foo.py`. Modpython sees the dir, and assumes that modperl is a python module, and tries to load it as a python module, and fails. <!-- github-comment-id:694515972 -->
Sign in to join this conversation.
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: adam/znc#962