import error in 3.3.7

Bug #2066173 reported by Robert Ladyman
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Breezy
New
Undecided
Unassigned

Bug Description

Pip install of breezy 3.3.7 in a venv with Python 3.12.2 results in (when just using 'brz' from the bash prompt):

Error: PyErr { type: <class 'ImportError'>, value: ImportError('..._hashlib.cpython-312-x86_64-linux-gnu.so: undefined symbol: PyExc_ValueError')

Similar errors also occur with Python 3.11 and 3.10 (the last version I could get working with 3.3.7 of brz was Python 3.9.5).

To work with Python 3.12.1, breezy version 3.3.4 is needed.

I suspect this is a rust + venv error: while attempting to debug the issue, the failure seems to be something related to PyObject_Repr in brz's __main__.py when it imports breezy.commands. That is, main.rs fails at:

 let main = PyModule::import(py, "breezy.__main__")?;

and __main__.py at 'import breezy.commands'.

Debugging the rust code with:

        let sysconfig = PyModule::import(py, "sysconfig").unwrap();
        let python_version = sysconfig.call_method0("get_python_version").unwrap();
        eprintln!("Python version is {}", python_version);
        let python_lib = sysconfig.call_method("get_config_var", ("LIBDEST",), None).unwrap();
        eprintln!("Using python lib: {}", python_lib);
        let python_site_packages = sysconfig.call_method("get_path", ("purelib",), None).unwrap();
        eprintln!("Using python site-packages: {}", python_site_packages);
        let sys = PyModule::import(py, "sys").unwrap();
        let py_path:&str = sys.getattr("executable").unwrap().extract().unwrap();
        eprintln!("Path is {}", py_path);

seemed to show the correct paths / libraries but I suspect that there's an error with a mis-match of Python and its libraries and rust.

Revision history for this message
Robert Ladyman (saccadic-masking) wrote :

An additional note: it might be related to the change in https://bugs.launchpad.net/brz/+bug/1951258 (update_path())

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.