Bug 2403290 - Playonlinux aborts at start, error includes mainwindow.py:710: SyntaxWarning
Summary: Playonlinux aborts at start, error includes mainwindow.py:710: SyntaxWarning
Keywords:
Status: NEW
Alias: None
Product: Fedora
Classification: Fedora
Component: playonlinux
Version: 43
Hardware: x86_64
OS: Linux
unspecified
urgent
Target Milestone: ---
Assignee: Robert Scheck
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2025-10-11 15:08 UTC by Sean Carlos
Modified: 2025-12-06 21:28 UTC (History)
3 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed:
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Sean Carlos 2025-10-11 15:08:42 UTC
Playonlinux aborts at start

Reproducible: Always

Steps to Reproduce:
1. Run playonlinux
Actual Results:
Output: 

$ playonlinux
Looking for python3... 3.14.0 - selected
/usr/share/playonlinux/python/mainwindow.py:710: SyntaxWarning: "\|" is an invalid escape sequence. Such sequences will not work in the future. Did you mean "\\|"? A raw string is also an option.
  \|XPM (*.xpm)|*.xpm;*.XPM\
1.0
Traceback (most recent call last):
  File "/usr/share/playonlinux/python/mainwindow.py", line 45, in <module>
    from setupwindow import gui_server
  File "/usr/share/playonlinux/python/setupwindow/gui_server.py", line 27, in <module>
    from .POL_SetupFrame import POL_SetupFrame
  File "/usr/share/playonlinux/python/setupwindow/POL_SetupFrame.py", line 36, in <module>
    urllib.request.URLopener.version = Variables.userAgent  # Arg ...
    ^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: module 'urllib.request' has no attribute 'URLopener'




Additional Information:
Commenting out this line:

urllib.request.URLopener.version = Variables.userAgent  # Arg ...

in

/usr/share/playonlinux/python/setupwindow/POL_SetupFrame.py

allows playonlinux to start. I'm not sure of the further implications.

Comment 1 Cyril DELBEGUE 2025-10-31 22:27:39 UTC
This is an old API that has been removed since Python 3.10.

The problem can be corrected by replacing line 36 of the file `/usr/share/playonlinux/python/setupwindow/POL_SetupFrame.py`: 
```
urllib.request.URLopener.version = Variables.userAgent
```
with:
```
opener = urllib.request.build_opener()
opener.addheaders = [('User-Agent', Variables.userAgent)]
urllib.request._urlopener = opener
```

I think these modifications should be added to the patch applied to the RPM sources.

Comment 2 Davide Repetto 2025-12-06 21:28:25 UTC
FYI the fix gently provided by Cyril up here, works for me.


Note You need to log in before you can comment on or make changes to this bug.