-
Notifications
You must be signed in to change notification settings - Fork 21
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
Python syntax error on humble.py #25
Comments
Hi, @mfabbri Sorry for not answering sooner ... it seems that Github.com has been down for a while in my country :(. Indeed, in Python versions lower than 3.12 this use of f-string is not possible; the line with the error, based on the most recent version of “humble.py”, is this. And, even though I regularly use vermin to check the minimum Python version required for “humble” ... it seems that this particular case does not detect it :/. This Friday I will change it to remove those backslashes so you can test it again. Thanks for reporting it!!. Best regards, |
No hay problema Rafa, thank you for making this useful tool available to the community! |
Hi, @mfabbri Please, take a look at e48f839. Can you confirm that you are no longer reproducing the error with that commit?, It's a pity that vermin does not have support for rules associated with Python 3.12 and higher versions ... I will restrict the minimum supported version of Python, for using 'humble', to the minimum currently supported, 3.9 (https://devguide.python.org/versions/). I think it is also good practice to use only supported versions. Regards, |
#25 Unfortunately vermin, the tool I used to check the minimum Python version required to use 'humble' is not updated with rules for (at least) Python 3.12 ... and in fact it may not be updated for earlier versions of Python either. So its results, at least for those versions of Python, are not reliable. So, apart from stopping using vermin, I will indicate from now on that 'humble' is compatible with (at least) the minimum supported version of Python, which is currently 3.9: https://devguide.python.org/versions/ In the short/medium term I will investigate unit tests on github for that version of Python, trying to get ahead of any bugs that may arise.
Hi @rfc-st , I tested the build process with docker 27.5.1 in Windows and I cannot reproduce the issue. |
Hi, @mfabbri I just want to thank you for reporting this error and that I have included you in the Acknowledgements section :). Regards, |
Describe the bug
File "humble.py", line 1144
print(f"\n {get_detail('[args_skipped_unknown]', replace=True)}
^
SyntaxError: f-string expression part cannot include a backslash
To Reproduce
Execute humble.py from command line or docker command
Expected behavior
humble.py should be executed without syntax errors
Desktop (please complete the following information):
Additional context
I've fixed the issue with the solution proposed by ChatGPT
def print_unsupported_headers(unsupported_headers):
headers_str = ', '.join(f'"{header}"' for header in unsupported_headers)
print(f"\n {get_detail('[args_skipped_unknown]', replace=True)} ({headers_str})")
sys.exit()
Maybe there is a better way to do it but it worked. Thanks
The text was updated successfully, but these errors were encountered: