Skip to content

Conversation

@BorislavSabev
Copy link

Description

PlayOnLinux fails to start with Python >= 3.10 because of the following syntax error:

/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'

This was observed on Fedora 43.
A reported BUG exists on RedHat's bug tracker as well.

With this PR I'm making the same patch as suggested in that report but directly to the upstream repository here.
Please review it asap.

Also are you planning to release 4.4.1 soon? It can see that there are a bunch of commits after that tag in master and it would be great if this fix can make it into a "version 4.4.1".

@qparis
Copy link
Member

qparis commented Jan 5, 2026

Thank you for your merge request.

No problem to release a 4.4.1 version. Can you confirm that your work is backward compatible with older python versions?

@BorislavSabev
Copy link
Author

BorislavSabev commented Jan 27, 2026

@qparis which Python versions must be supported here?
This code is fully compatible with Python 3.3+. For Python 3.0–3.2 it's technically feasible, however

  • Early 3.x had inconsistent behavior
  • _urlopener was less reliable and more buggy
  • These versions are long EOL and effectively irrelevant today

Python 2.x is not supported by this code.

Basically it should be OK as it is fully compatible with 3.3 -> 3.12+

@qparis
Copy link
Member

qparis commented Jan 30, 2026

Do you know what version is included in most distributions?
For playonmac, we need 3.8+

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants