Post processing broken with python-2.7.(12|13)

Trying to get comskip to work and it’s failing with the following:

Traceback (most recent call last):
File “/usr/src/PlexComskip/PlexComskip.py”, line 9, in
import tempfile
File “/usr/lib/python2.7/tempfile.py”, line 35, in
from random import Random as _Random
File “/usr/lib/python2.7/random.py”, line 45, in
from math import log as _log, exp as _exp, pi as _pi, e as _e, ceil as _ceil
ImportError: /usr/lib/python2.7/lib-dynload/math.so: undefined symbol: PyFPE_jbuf

When I run the wrapper manually it just works.

#!/bin/sh
/usr/bin/mkvpropedit “$1” --edit track:a1 --set language=eng --edit track:v1 --set language=eng
sleep 5
/usr/bin/python2 /usr/src/PlexComskip/PlexComskip.py “$1”

I did have to set the interpreter to python 2, though.

Remember you’re running as the plex user, you likely need to adjust the paths. The comcut/comchap scripts do something interesting which isn’t immediately obvious to me but maybe it would help you:

@jdbower said:
Remember you’re running as the plex user, you likely need to adjust the paths.

Paths and permissions have been adjusted accordingly. The show stopper is ImportError: /usr/lib/python2.7/lib-dynload/math.so: undefined symbol: PyFPE_jbuf

Being closed source, and bundling lots of proprietary code can have this effect. Not everyone uses static linked libs.

The comcut/comchap scripts do something interesting which isn’t immediately obvious to me but maybe it would help you:
GitHub - BrettSheleski/comchap: Commercial detection script to add chapters into video file

Well that does look like an interesting project, personally, I’d rather have them removed all together, rather then just flagged as chapters. I also see a problem with comchap looking for files in ~/ rather then a set path relative to where ever I’d like with a switch, in a wrapper even. The upgrade path for some OS’s might be different, and I can see it removing those files upon upgrade.

There is also the detail that _bsddb.so provided by the bundled python is deprecated for this 11.11. bsddb — Interface to Berkeley DB library — Python 2.7.18 documentation .The version that ships with python is broken and not maintained anymore.

@Gloppie_ said:
There is also the detail that _bsddb.so provided by the bundled python is deprecated for this 11.11. bsddb — Interface to Berkeley DB library — Python 2.7.18 documentation .The version that ships with python is broken and not maintained anymore.

Ha, that’s actually the link to the deprecated version and blatantly states “Deprecated since version 2.6: The bsddb module has been removed in Python 3.” :-/ here is the current:
Python "bindings" for Oracle Berkeley DB SSL cert is ‘invalid’ c’est la vie

Resolved with using pythons virtual environment :smiley:

@jdbower said:
The comcut/comchap scripts do something interesting which isn’t immediately obvious to me but maybe it would help you:
GitHub - BrettSheleski/comchap: Commercial detection script to add chapters into video file

I’m full of regret for so easily dismissing your suggestion. Comcut solved another issue. Thank you for sharing it.

@Gloppie_ said:
Resolved with using pythons virtual environment :smiley:

Can you expand on this? I’m not a python guy, and I’ve got the same problem with PlexComskip on Debian. Works great as the plex user from a shell, but fails during postprocessing.