This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: askopenfilename is missing from the Tkinter filedialog library in 2.7.17
Type: Stage: resolved
Components: Tkinter Versions: Python 2.7
process
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: Nosy List: ned.deily, rdnielsen
Priority: normal Keywords:

Created on 2020-01-17 14:47 by rdnielsen, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Messages (2)
msg360194 - (view) Author: Dreas Nielsen (rdnielsen) Date: 2020-01-17 14:47
In Python 2.7.17 on Linux, the code:

    import tkinter.filedialog as tkfiledialog
    dir(tkfiledialog.askopenfilename)

results in:

    AttributeError: 'module' object has no attribute 'askopenfilename'

Any attempt to use 'askopenfilename' has the same result, of course.
msg360208 - (view) Author: Ned Deily (ned.deily) * (Python committer) Date: 2020-01-17 19:10
In Python 2, askopenfilename was in the separate tkFileDialog module:

>>> import tkFileDialog
>>> dir(tkFileDialog.askopenfilename)
['__call__',  ...

https://docs.python.org/2/library/tkinter.html?highlight=tkfiledialog#tkinter-modules

"Other modules that provide Tk support include:
[...]
tkFileDialog
Common dialogs to allow the user to specify a file to open or save.
[...]
These have been renamed as well in Python 3; they were all made submodules of the new tkinter package."
History
Date User Action Args
2022-04-11 14:59:25adminsetgithub: 83551
2020-01-17 19:10:34ned.deilysetstatus: open -> closed

type: crash ->

nosy: + ned.deily
messages: + msg360208
resolution: not a bug
stage: resolved
2020-01-17 14:47:07rdnielsencreate