Opened 9 years ago

Closed 8 years ago

#689 closed defect (fixed)

python 3.5: .pyo files were renamed to .opt-1.pyc

Reported by: ususdei Owned by: Richard Boulton
Priority: normal Milestone: 1.3.4
Component: Xapian-bindings (Python) Version: 1.3.2
Severity: normal Keywords: python bindings
Cc: Blocked By:
Blocking: Operating System: All

Description

File: xapian-bindings/python3/Makefile.am

The install instructions there explicitly reference a ".pyo" file. But those files are now eliminated in python 3.5. Instead they now end with ".opt-1.pyc" or ".opt-2.pyc".

See: https://www.python.org/dev/peps/pep-0488/

I'm not entirely sure how to fix that properly. Maybe introduce and populate a new variable @PYTHON3_OPT_EXTENSION@ ?

Change History (3)

comment:1 by Olly Betts, 9 years ago

Milestone: 1.4.x1.3.x

Seems a reasonable approach.

Is there a reliable way to find this extension, or do you just have to assume based on the version number of the python interpreter?

comment:2 by ususdei, 9 years ago

Now in python3.5 an expression like

importlib.util.cache_from_source('', optimization=1).rpartition(imp.get_tag())[2]

seems to work, but cache_from_source() was added in python3.4 and the optimization argument is new in python3.5.

So one still would have to check the version or wrap this in a try...except and return the old ".pyo" on failure.

comment:3 by Olly Betts, 8 years ago

Milestone: 1.3.x1.3.4
Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.