Skip to content

Update POL_SetupFrame.py - Fix syntax warning with Python >= 3.10#81

Open
BorislavSabev wants to merge 1 commit intoPlayOnLinux:masterfrom
BorislavSabev:patch-1
Open

Update POL_SetupFrame.py - Fix syntax warning with Python >= 3.10#81
BorislavSabev wants to merge 1 commit intoPlayOnLinux:masterfrom
BorislavSabev:patch-1

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+

@BorislavSabev
Copy link
Author

All distributions seem to be above that except RHEL 8 / Rocky Linux 8

After some checks:
Debian 13 (Trixie) Python 3.13
Debian 12 (Bookworm) Python 3.11
Fedora 40/Rawhide Python 3.12-3.13
Fedora 43 Python 3.14
Linux Mint 22.x Python 3.12
Ubuntu 24.04 LTS Python 3.12
Ubuntu 22.04 LTS Python 3.10
Arch Linux (rolling) Python 3.13+
OpenSUSE Tumbleweed Python 3.12–3.13

@BorislavSabev
Copy link
Author

BorislavSabev commented Feb 2, 2026

@qparis is someone else going to check these changes? I mean make a test outside of my dev testing 🗡️
This code is in the setup POL and it's kind of critical. It'd be nice if someone else could also test it.

@qparis
Copy link
Member

qparis commented Feb 2, 2026

Yes I will test it

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