Skip to content

gh-152638: Deprecate tkinter.filedialog.askopenfiles()#152647

Open
serhiy-storchaka wants to merge 1 commit into
python:mainfrom
serhiy-storchaka:gh-152638-deprecate-askopenfiles
Open

gh-152638: Deprecate tkinter.filedialog.askopenfiles()#152647
serhiy-storchaka wants to merge 1 commit into
python:mainfrom
serhiy-storchaka:gh-152638-deprecate-askopenfiles

Conversation

@serhiy-storchaka

Copy link
Copy Markdown
Member

Opening several files at once is error-prone, and the returned list cannot be used in a with statement: if opening one of the files fails, the files already opened are leaked; correct cleanup on error is awkward; and the number of open file descriptors is limited.

Iterate over the names returned by askopenfilenames() and open them one by one instead.

The single-file askopenfile()/asksaveasfile() are not affected.

Opening several files at once is error-prone, and the returned list
cannot be used in a "with" statement.  Iterate over the names returned
by askopenfilenames() and open them one by one instead.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant