Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Linux script uses formatted string literals only present since Python 3.6 #270

Closed
paulmenzel opened this issue Jun 16, 2023 · 8 comments · May be fixed by #284
Closed

Linux script uses formatted string literals only present since Python 3.6 #270

paulmenzel opened this issue Jun 16, 2023 · 8 comments · May be fixed by #284

Comments

@paulmenzel
Copy link

We got a report from a user that the script fails to run with Python 3.5.3.

$ python3 eduroam-linux-MfmG-general.py
   File "eduroam-linux-MfmG-general.py", line 754
     interface += f"phase2=\"auth={Config.eap_inner}\"\n" \
                                                        ^
 SyntaxError: invalid syntax 

It runs with Python 3.6.0. It looks like merge/pull request #219 introduced Formatted string literals, introduced with Python 3.6.

Please stay as compatible with old Python (3) versions as possible.

@paulmenzel
Copy link
Author

if Config.eap_outer in ('PEAP', 'TTLS'):
interface += f"phase2=\"auth={Config.eap_inner}\"\n" \
f"\tpassword=\"{user_data.password}\"\n"
if Config.anonymous_identity != '':
interface += f"\tanonymous_identity=\"{Config.anonymous_identity}\"\n"
elif Config.eap_outer == 'TLS':
interface += f"\tprivate_key_passwd=\"{user_data.password}\"\n" \
f"\tprivate_key=\"{os.environ.get('HOME')}/.cat_installer/user.p12"

@Kangie
Copy link

Kangie commented Jan 31, 2024

Python 3.6 was released 7 years ago. It went EoL just over two years ago. Python 3.5 went EOL nearly three and a half years ago.

To quote my response in 284;

If you are stuck using crusty old EoL python in 2023/2024 you really need to think about how to fix that, and not make everyone's scripts slower and harder to read. Please.

@DimitriPapadopoulos
Copy link
Contributor

True. Which exact OS ships Python 3.5.3?

@paulmenzel
Copy link
Author

@Kangie, CAT is supposed to run on as many systems as possible, and speed is certainly not an issue.

@paulmenzel
Copy link
Author

True. Which exact OS ships Python 3.5.3?

No idea, I won’t dig that out. Some user out there, starting an old outdated system wants to use the Internet with Eduroam. No idea, why they shouldn’t.

@Kangie
Copy link

Kangie commented Jan 31, 2024

True. Which exact OS ships Python 3.5.3?

No idea, I won’t dig that out. Some user out there, starting an old outdated system wants to use the Internet with Eduroam. No idea, why they shouldn’t.

There are plenty of reasons that an old outdated system should not connect to the internet via eduroam. 😉

There's really not that much out there

EPEL will handle it for RHEL >= 7, RHEL 6 is < 4 months away from ELS (and who is actually running it on a laptop?). Even SLES 12 can install a python36 package. to get access to a reasonably modern python. Ubuntu is the outlier as the PPAs that used to enable installation of sane python versions on 14, 16, and 18 releases have been pulled... presumably because there's an upgrade path to supported releases.

I guess it comes down to how much we should support an OS that would restrict us to using python 2.6 features. I think it can be safely written off, especially as our CI/CD only tests on Ubuntu 22.04 (though that should really be extended to include some other distros / releases)

@paulmenzel
Copy link
Author

True. Which exact OS ships Python 3.5.3?

No idea, I won’t dig that out. Some user out there, starting an old outdated system wants to use the Internet with Eduroam. No idea, why they shouldn’t.

There are plenty of reasons that an old outdated system should not connect to the internet via eduroam. 😉

Please enlighten me, which ones? Using Eduroam gives you nothing but Internet access in our environment. And not forget, how shall a user update without Internet access.

There's really not that much out there

EPEL will handle it for RHEL >= 7, RHEL 6 is < 4 months away from ELS (and who is actually running it on a laptop?). Even SLES 12 can install a python36 package to get access to a reasonably modern python.

How do you install that without Internet access?

Ubuntu is the outlier as the PPAs that used to enable installation of sane python versions on 14, 16, and 18 releases have been pulled... presumably because there's an upgrade path to supported releases.

I guess it comes down to how much we should support an OS that would restrict us to using python 2.6 features. I think it can be safely written off, especially as our CI/CD only tests on Ubuntu 22.04 (though that should really be extended to include some other distros / releases)

Sorry, I think you have some wrong assumptions about the whole user base and the purpose of the CAT installer.

But let’s agree to disagree, and I am going to close the issue.

@restena-sw
Copy link
Contributor

FWIW, the manual at https://wiki.geant.org/display/H2eduroam/A+guide+to+eduroam+CAT+for+IdP+administrators#AguidetoeduroamCATforIdPadministrators-SupportPolicyforoperatingsystemsversions has a section on device support and states:

"eduroam CAT generally tries to follow vendors' end of life dates:"

There is no bullet for Linux below that because there are too numerous distributions and forks and EOL trains enumerate.

But if there is a distribution which still needs old-style Python to work, then that is an argument towards keeping up support until that last distribution finally goes away.

Also, I think it's worth noting that even with such a policy, we are sometimes told that our policy is /not conservative enough/ and both users and admins typically demand /longer/ support than what the OS vendors give. Especially for Windows we were urged to keep $ANYVERSION (replace with anything from XP onwards) up for much longer than is warranted. We are not actively pushing to remove even Windows 7 at this point in time because yes, people are using that despite all advice to the contrary.

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 a pull request may close this issue.

4 participants