thingsiplay / fpath

Reformat and stylize file path like text output.
MIT License
2 stars 0 forks source link

Syntax error #1

Closed mcmikemn closed 1 month ago

mcmikemn commented 1 month ago

This might be user error, but when I run fpath (e.g., fpath or ls | fpath) , I get:

File "/usr/local/bin/fpath", line 1148
help=f"Subjects: {", ".join(choices)}",
                   ^
SyntaxError: f-string: expecting '}'

I'm using Ubutnu 22.04.4.

thingsiplay commented 1 month ago

Hi thank you for the report. This might be an oversight be me, but oddly enough it works fine on my Python (again I have a newer version than Ubuntu 22.04). Would you please edit the fpath file with an editor this line to replace 2 double quotation marks to single? If this works, then I will update the code. Go to line 1148 in fpath:

        help=f"Subjects: {", ".join(choices)}",

change it to

        help=f"Subjects: {', '.join(choices)}",

However, as with the other script, this might be a case of incompatibility with older Python version.

mcmikemn commented 1 month ago

Changing double quotes to single quotes on line 1148 fixed the issue for me. Thanks again!

thingsiplay commented 1 month ago

Good to know. I have no idea why this works for me, as it is not valid Python code. I will update the script quickly with this fix. Thank you for the report and testing.

Edit: https://github.com/thingsiplay/fpath/commit/457794bc6c981faf4544cb0ab59850b864abfb5e