Welcome, Guest. Please login or register.
Did you miss your activation email?

Author Topic: [EN] Streamtuner2 not working after python3 upgrade  (Read 1104 times)

Offline mdmarmer

  • User
  • Posts: 59
[EN] Streamtuner2 not working after python3 upgrade
« on: 2025/01/11, 14:08:28 »
Streamtuner2 not working after python3 upgrade -- streamtuner2 fails with error No module named 'pipes' and I believe the pipes module is removed in python3 version 3.13:

https://github.com/jupyter/nbclassic/issues/308

Offline charlyheinz

  • User
  • Posts: 135
Re: Streamtuner2 not working after python3 upgrade
« Reply #1 on: 2025/01/11, 15:01:27 »
Here the same. Iā€™d tried to find any help out there but could not find anything about this python piping issue corresponding to streamtuner2. Hope it will be fixed intime.

Offline xerol

  • User
  • Posts: 15
Re: Streamtuner2 not working after python3 upgrade
« Reply #2 on: 2025/01/11, 15:55:57 »
There has not been much activity in development for streamtuner -  v2.2.2 has been published 2 years ago, so do not expect any fix soon.

But you can run the downloaded sourceforge/fossil package https://fossil.include-once.org/streamtuner2/index  in a python 3.12 environment.

(There are still other packages not being updated to work with python 3.13: virtualbox, xpra, hplip, python3-fitz...)

Offline eriefisher

  • User
  • Posts: 334
Re: Streamtuner2 not working after python3 upgrade
« Reply #3 on: 2025/01/11, 16:51:40 »
I've been seeing python errors in the logs for some time now. It seems to be a bit of a moving target. Python3-uno was on the remove list for a few days due to package mismatch. All cleared now but Streamtuner has certainly been in the logs for at least several weeks now.

Offline DeepDayze

  • User
  • Posts: 479
Re: Streamtuner2 not working after python3 upgrade
« Reply #4 on: 2025/01/13, 17:59:41 »
The Python 3.13 upgrade breaks a  number of packages including hplip which I use for managing my HP printer. Seems 3.13 brings about some major changes.

Offline dexpressivet

  • Newbie
  • Posts: 1
    • Subway Surfers
Re: Streamtuner2 not working after python3 upgrade
« Reply #5 on: 2025/01/15, 04:44:42 »
I agree, the Python 3.13 upgrade has definitely caused issues with several packages, including Streamtuner2, due to the removal of the `pipes` module. It's frustrating when things break unexpectedly after an update, especially when there's limited support or information on how to fix it. Hopefully, developers will address this soon, as it's affecting multiple packages like hplip as well.

Offline DeepDayze

  • User
  • Posts: 479
Re: Streamtuner2 not working after python3 upgrade
« Reply #6 on: 2025/01/15, 04:53:11 »
Guess there's no other Python 3 module that replaces the pipes module or one that provides the necessary functionality.

Offline xerol

  • User
  • Posts: 15
Re: Streamtuner2 not working after python3 upgrade
« Reply #7 on: 2025/01/15, 07:59:30 »
More info about pipes and other removed modules in python 3.13 can be read here https://peps.python.org/pep-0594/

Offline xerol

  • User
  • Posts: 15
Re: Streamtuner2 not working after python3 upgrade
« Reply #8 on: 2025/01/15, 09:55:30 »
Guess there's no other Python 3 module that replaces the pipes module or one that provides the necessary functionality.
As mentioned in the link posted by mdmarmer, pipes can be replaced with shlex.

pipes only apears in two places in files action.py and st2subprocess.py:

Code: [Select]
diff -Nru streamtuner2/action.py streamtuner2_py313/action.py
--- streamtuner2/action.py 2018-12-31 12:14:17.000000000 +0100
+++ streamtuner2_py313/action.py 2025-01-15 09:08:21.289321876 +0100
@@ -37,7 +37,7 @@
 import platform
 import copy
 import json
-import subprocess, pipes
+import subprocess, shlex
 from datetime import datetime
 from xml.sax.saxutils import escape as xmlentities, unescape as xmlunescape
 
@@ -206,7 +206,7 @@
         if re.match("^\w[\w.:/\-]+$", ins):
             return ins
         else:
-            return pipes.quote(ins)
+            return shlex.quote(ins)
     #return "%r" % ins
 
 
diff -Nru streamtuner2/contrib/st2subprocess.py streamtuner2_py313/contrib/st2subprocess.py
--- streamtuner2/contrib/st2subprocess.py 2017-10-17 00:23:14.000000000 +0200
+++ streamtuner2_py313/contrib/st2subprocess.py 2025-01-15 09:08:43.537435156 +0100
@@ -50,7 +50,6 @@
 import subprocess
 import os
 import shlex
-import pipes
 import re
 from config import *
 from channels import FeaturePlugin
@@ -100,7 +99,7 @@
         if conf.cmd_spawn in ("system", "default", "win32api") or type(ins) is list:
             return orig_quote(ins)
         # only Posix-style shell quoting
-        return pipes.quote(ins)
+        return shlex.quote(ins)
     
 
     # override for action.run (os.system exec method)

Offline DeepDayze

  • User
  • Posts: 479
Re: Streamtuner2 not working after python3 upgrade
« Reply #9 on: 2025/01/15, 13:46:36 »
Guess there's no other Python 3 module that replaces the pipes module or one that provides the necessary functionality.
As mentioned in the link posted by mdmarmer, pipes can be replaced with shlex.

pipes only apears in two places in files action.py and st2subprocess.py:

Code: [Select]
diff -Nru streamtuner2/action.py streamtuner2_py313/action.py
--- streamtuner2/action.py 2018-12-31 12:14:17.000000000 +0100
+++ streamtuner2_py313/action.py 2025-01-15 09:08:21.289321876 +0100
@@ -37,7 +37,7 @@
 import platform
 import copy
 import json
-import subprocess, pipes
+import subprocess, shlex
 from datetime import datetime
 from xml.sax.saxutils import escape as xmlentities, unescape as xmlunescape
 
@@ -206,7 +206,7 @@
         if re.match("^\w[\w.:/\-]+$", ins):
             return ins
         else:
-            return pipes.quote(ins)
+            return shlex.quote(ins)
     #return "%r" % ins
 
 
diff -Nru streamtuner2/contrib/st2subprocess.py streamtuner2_py313/contrib/st2subprocess.py
--- streamtuner2/contrib/st2subprocess.py 2017-10-17 00:23:14.000000000 +0200
+++ streamtuner2_py313/contrib/st2subprocess.py 2025-01-15 09:08:43.537435156 +0100
@@ -50,7 +50,6 @@
 import subprocess
 import os
 import shlex
-import pipes
 import re
 from config import *
 from channels import FeaturePlugin
@@ -100,7 +99,7 @@
         if conf.cmd_spawn in ("system", "default", "win32api") or type(ins) is list:
             return orig_quote(ins)
         # only Posix-style shell quoting
-        return pipes.quote(ins)
+        return shlex.quote(ins)
     
 
     # override for action.run (os.system exec method)

Nice find and does Streamtuner2 work with that change? Was also wondering if the arguments to shlex the same as for pipes and if so that should be a quick little hack to get ST2 working again considering pipes was used in just 2 places in the code.

Offline charlyheinz

  • User
  • Posts: 135
Re: Streamtuner2 not working after python3 upgrade
« Reply #10 on: 2025/01/15, 17:25:24 »
I've just booted the last Siduction ISO "shine on" on my laptop and installed streamtuner2 on it and it's running nicely with the following Python packages which have been installed during the installation process:

python3-pyquery,  python3-webob

I do not know what will happen if I upgrade this Version when it is installed and if it is neccesary to stat this python3 plugs on hold?

My mistake: it is running 'cause it's still Python3 3.12.7-1 and not the upgraded 3.13.1-2.  Sorry !!

As expeced: after upgrading to 3.13.1-2 still the same issue.

Dos it make sence to put Python3 on hold or how do I implement the changes into Python3 as xerol told to.

And again: this ISO / distri everytime is lovely. Thanks to all the people who are involved!!
« Last Edit: 2025/01/15, 18:15:01 by charlyheinz »

Offline xerol

  • User
  • Posts: 15
Re: Streamtuner2 not working after python3 upgrade
« Reply #11 on: 2025/01/16, 10:41:48 »
As expeced: after upgrading to 3.13.1-2 still the same issue.

Dos it make sence to put Python3 on hold or how do I implement the changes into Python3 as xerol told to.
No. You may put it on hold termporarly, but in the long run putting python3 on hold will break many packages which are essential for the system.
As mentioned above, you should download the the sources, create a python3.12 environment and run it from there.

As an alternative, this command is an ugly quick fix:
Code: [Select]
sudo sed -i "s/pipes/shlex/" /usr/share/streamtuner2/action.py

As I am distributing  syncronized audio streams in my house with  mopidy/snapcast, I do not use streamtuner2. I just did a short test run.

Offline charlyheinz

  • User
  • Posts: 135
Re: Streamtuner2 not working after python3 upgrade
« Reply #12 on: 2025/01/16, 15:01:52 »
thx xerol
Sttreamtuner is working again with your advice.
Are you using mopidy/snapcast just for listening or are you providing streams?
I like streamtuner2 because it is very easy to listen and search audio-streams all over the world on different platforms.

Thanks a lot for your hint and stay tuned ;-)