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

Python syntax error on humble.py #25

Closed
mfabbri opened this issue Feb 5, 2025 · 5 comments
Closed

Python syntax error on humble.py #25

mfabbri opened this issue Feb 5, 2025 · 5 comments
Assignees
Labels
bug Something isn't working

Comments

@mfabbri
Copy link

mfabbri commented Feb 5, 2025

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):

  • OS: Windows
  • Version: 22H2

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

@rfc-st rfc-st self-assigned this Feb 5, 2025
@rfc-st rfc-st added the bug Something isn't working label Feb 5, 2025
@rfc-st
Copy link
Owner

rfc-st commented Feb 5, 2025

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,

@mfabbri
Copy link
Author

mfabbri commented Feb 6, 2025

No hay problema Rafa, thank you for making this useful tool available to the community!

rfc-st added a commit that referenced this issue Feb 7, 2025
@rfc-st
Copy link
Owner

rfc-st commented Feb 7, 2025

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,

rfc-st added a commit that referenced this issue Feb 7, 2025
#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.
@mfabbri
Copy link
Author

mfabbri commented Feb 8, 2025

Hi @rfc-st , I tested the build process with docker 27.5.1 in Windows and I cannot reproduce the issue.
And yes, it's a good practice to use only supported versions.
Thank you again for your help

@mfabbri mfabbri closed this as completed Feb 8, 2025
@rfc-st
Copy link
Owner

rfc-st commented Feb 8, 2025

Hi, @mfabbri

I just want to thank you for reporting this error and that I have included you in the Acknowledgements section :).

Regards,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants