Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replace configparser readfp with read_file (#1428)
readfp() was [deprecated in Python 3.2][1] and [removed in Python 3.12][2]. read_file() is a drop-in replacement. [1]: https://github.com/python/cpython/blob/dd0e8a62df8be2a09ef6035b4c92bd9a68a7b918/Lib/configparser.py#L757-L764 [2]: python/cpython@1fc41ae Fixes this error with Python 3.12: ``` Traceback (most recent call last): File "/usr/bin/pronterface.py", line 62, in <module> app = PronterApp(False) ^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.12/site-packages/printrun/pronterface.py", line 2596, in __init__ self.mainwindow = PronterWindow(self) ^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.12/site-packages/printrun/pronterface.py", line 220, in __init__ self.reload_ui() File "/usr/lib/python3.12/site-packages/printrun/pronterface.py", line 288, in reload_ui self.create_menu() File "/usr/lib/python3.12/site-packages/printrun/pronterface.py", line 862, in create_menu self.load_slic3r_configs(menus) File "/usr/lib/python3.12/site-packages/printrun/pronterface.py", line 2517, in load_slic3r_configs config = self.read_slic3r_config(configfile) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.12/site-packages/printrun/pronterface.py", line 2562, in read_slic3r_config parser.readfp(add_header(open(configfile)), configfile) ^^^^^^^^^^^^^ AttributeError: 'RawConfigParser' object has no attribute 'readfp'. Did you mean: 'read'? ```
- Loading branch information