Skip to content

Commit

Permalink
Remove "U" mode from from_file's open() for 3.12 compatability. (#171)
Browse files Browse the repository at this point in the history
The "U" file mode tells Python to read the file in "universal newlines" mode.  This has been the default as of Python 3.0 and should be controlled from the newline keyword parameter which deprecated the "U" mode specifier.

"U" was removed in Python 3.12 and now causes a ValueError if used.
  • Loading branch information
mcshlanta authored Dec 31, 2024
1 parent f3dca9c commit a201de7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion instrumental/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

def copy_file_text(from_path, to_path):
"""Copies a text file, using platform-specific line endings"""
with open(from_path, 'rU') as from_file:
with open(from_path, 'r') as from_file:
with open(to_path, 'w') as to_file:
to_file.writelines((line for line in from_file))

Expand Down

0 comments on commit a201de7

Please sign in to comment.