Skip to content

Python 3.11 open(path,"U") -->invalid mode. #58

Description

@mayakrunal

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

open(), io.open(), codecs.open() and fileinput.FileInput no longer accept 'U' (“universal newline”) in the file mode. In Python 3, “universal newline” mode is used by default whenever a file is opened in text mode, and the 'U' flag has been deprecated since Python 3.3. The newline parameter to these functions controls how universal newlines work. (Contributed by Victor Stinner in bpo-37330.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions