Open mayakrunal opened 1 year ago
Looking at the doc. https://docs.python.org/3/library/functions.html#open The default open mode is already text mode or we can use as below?
The type of file object returned by the open() function depends on the mode. When open() is used to open a file in a text mode ('w', 'r', 'wt', 'rt', etc.), it returns a subclass of io.TextIOBase (specifically io.TextIOWrapper).
Looking at the doc. https://docs.python.org/3/library/functions.html#open The default open mode is already text mode or we can use as below?
The type of file object returned by the open() function depends on the mode. When open() is used to open a file in a text mode ('w', 'r', 'wt', 'rt', etc.), it returns a subclass of io.TextIOBase (specifically io.TextIOWrapper).
Just dropping the mode should be enough. Thanks for reporting of this regression.
created pull request for the same
created pull request for the same
#59
I can confirm that this fixes this issue for me.
Not being able to see the diff in the changes section on python 3.11 due to "U" mode being deprecated on python 3.11
File "/usr/lib/python3.11/site-packages/snappergui/changesWindow.py", line 165, in get_lines_from_file return open(path, 'U').readlines() ^^^^^^^^^^^^^^^ ValueError: invalid mode: 'U'
From python docs: https://docs.python.org/3/whatsnew/3.11.html#porting-to-python-3-11