[Windows] AttributeError: 'bytes' object has no attribute 'casefold'
heaths opened this issue · comments
Despite installing the latest powerline via pip install git+https://github.com/powerline/powerline.git@develop
(commit 50d73bf), on Windows I see an exception raised with vim9. In a log, I see:
2022-11-30 14:02:19,542:ERROR:vim:branch:Exception while computing segment: 'bytes' object has no attribute 'casefold'"
0.247150 : raw terminal output: "
Traceback (most recent call last)�|48;35H�|K"
0.247251 : raw terminal output: "�|48;1H File "C:\Users\heaths\AppData\Local\Programs\Python\Python311\Lib\site-packages\powerline\segment.py", line 173, in process_segment"
0.247490 : raw terminal output: "
contents = segment['contents_func'](pl, segment_info)�|48;58H�|K"
0.247566 : raw terminal output: "�|48;5H ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^"
0.247675 : raw terminal output: "
File "C:\Users\heaths\AppData\Local\Programs\Python\Python311\Lib\site-packages\powerline\segment.py", line 412, in <lambda>"
0.247944 : raw terminal output: "
contents_func = lambda pl, segment_info: _contents_func(pl=pl, segment_info=segment_info, **args)�|48;102H�|K"
0.248050 : raw terminal output: "�|48;5H ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^"
0.248155 : raw terminal output: "
File "C:\Users\heaths\AppData\Local\Programs\Python\Python311\Li...te-packages\powerline\segments\common\vcs.py", line 21, in __call__"
0.248424 : raw terminal output: "
repo = guess(path=name, create_watcher=create_watcher)�|48;59H�|K"
0.248525 : raw terminal output: "�|48;5H ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^"
0.248634 : raw terminal output: "
File "C:\Users\heaths\AppData\Local\Programs\Python\Python311\Lib\site-packages\powerline\lib\vcs\__init__.py", line 230, in guess"
0.248926 : raw terminal output: "
for directory in generate_directories(path):�|48;49H�|K"
0.249042 : raw terminal output: "�|48;3HFile "C:\Users\heaths\AppData\Local\Programs\Python\Python311\Li...es\powerline\lib\vcs\__init__.py", line 19, in generate_directories"
0.249526 : raw terminal output: "
if os.path.ismount(path):�|48;30H�|K"
0.249821 : raw terminal output: "�|48;5H ^^^^^^^^^^^^^^^^^^^^^�|48;29H�|K"
0.249920 : raw terminal output: "�|48;3HFile "<frozen ntpath>", line 303, in ismount"
0.250006 : raw terminal output: "
Powerline seems to work okay otherwise - at least no issues I've seen yet - but this a little concerning that something might not be working.
Looks like this is a bug that was just recently fixed in Python (for 3.12, alas): python/cpython#96192, though there is a bot-created port for 3.11 that vim9 needs: python/cpython#99455