Skip to content

Conversation

@sicherha
Copy link
Contributor

@sicherha sicherha commented Jan 10, 2025

  • Fix a TypeError in the Vim statusline that occurs with Python 3.13.
  • Fix a ValueError in powerline-daemon that will occur with Python 3.14 - nesting argument groups has been removed (https://bugzilla.redhat.com/show_bug.cgi?id=2336943).
  • While at it, fix a bunch of typos.
  • Fix the CI pipeline.

…us line

This occurs when opening a file inside a Git repository; the `path`
parameter is of type `bytes` instead of the expected `str`. The above
error message gets printed at the position where the file name and size
would normally be displayed.

The error was observed on Fedora 41 with Python 3.13. The exact root
cause is unclear - but explicitly converting `path` to `str` prevents
the `TypeError`.
Nesting argument groups was deprecated in Python 3.11 and will be
removed in the upcoming Python 3.14:
python/cpython#127133

Trying to add a nested group will trigger a `ValueError`.

To prepare the code for Python 3.14, remove the nested groups and add
all arguments at the top level. The mutual exclusion between `--kill`
and `--foreground`/`--replace` is already checked separately within the
`main()` function in `scripts/powerline-daemon`, so the user-observable
behaviour remains unchanged.
Python 3.7 seems to be no longer available.
> Error: Version 3.7 with arch x64 not found
@badshah400
Copy link

Hi, on openSUSE Tumbleweed, which just moved to python 3.13 as the default, we applied your patch to make the vim plugin work again. Many thanks. In addition, we also needed the following patch to fix a test file issue to get powerline building again with its test suite enabled.

Index: powerline-2.8.4/tests/test_python/test_cmdline.py
===================================================================
--- powerline-2.8.4.orig/tests/test_python/test_cmdline.py
+++ powerline-2.8.4/tests/test_python/test_cmdline.py
@@ -52,7 +52,7 @@ class TestParser(TestCase):
 			]:
 				self.assertRaises(SystemExit, parser.parse_args, raising_args)
 				self.assertFalse(out.getvalue())
-				self.assertRegexpMatches(err.getvalue(), raising_reg)
+				self.assertRegex(err.getvalue(), raising_reg)
 				flush()
 
 	def test_main_normal(self):

`assertRegexpMatches()` was renamed to `assertRegex()` in Python 3.2.
@sicherha
Copy link
Contributor Author

Thanks! I have added a commit to this PR that applies your diff.

And I'll see to it that Fedora's powerline.spec file, too, gets a %check section.

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 this pull request may close these issues.

2 participants