nwg-piotr/azote

Invalid escape sequence in main.py (Fedora 40 i3 Spin)

Closed this issue · 0 comments

Describe the bug
When attempting to run azote on Fedora 40 i3 Spin, a syntax warning regarding the escape sequence for the $ character is encountered. This issue can be resolved by either properly escaping the string with \$ or using a raw string r'$'.

wallpaper_path = box.wallpaper_path.replace('\\', '\\\\').replace("$", "\$").replace("`",

$ azote
/usr/lib/python3.12/site-packages/azote/main.py:466: SyntaxWarning: invalid escape sequence '\$'
  wallpaper_path = box.wallpaper_path.replace('\\', '\\\\').replace("$", "\$").replace("`",
Running on i3

(main.py:7336): Gdk-CRITICAL **: 08:04:23.192: gdk_window_thaw_toplevel_updates: assertion 'window->update_and_descendants_freeze_count > 0' failed
Available screen height: 1140 px; measurement delay: 300 ms

To Reproduce
Steps to reproduce the behavior:

  1. On a fresh install of Fedora i3 Spin run azote
$ azote
  1. Observe the SyntaxWarning and error log.

Expected behavior
Running azote should properly launch, and the GUI window should render without any syntax warnings.

Proposed solution
Modify the wallpaper_path assignment in main.py to escape the $ character properly using either:

  • wallpaper_path.replace("$", "\\$")
  • or wallpaper_path.replace("$", r"\$")

I will open a PR with the proposed fix.