Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tkFileDialog.askopenfiles crashes on Windows 7 #52258

Closed
PatrickHolz mannequin opened this issue Feb 24, 2010 · 4 comments
Closed

tkFileDialog.askopenfiles crashes on Windows 7 #52258

PatrickHolz mannequin opened this issue Feb 24, 2010 · 4 comments
Labels
OS-windows topic-tkinter type-bug An unexpected behavior, bug, or error

Comments

@PatrickHolz
Copy link
Mannequin

PatrickHolz mannequin commented Feb 24, 2010

BPO 8010
Nosy @amauryfa, @briancurtin, @serhiy-storchaka
Superseder
  • bpo-5712: tkinter - askopenfilenames returns string instead of tuple in windows 2.6.1 release
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = <Date 2013-10-13.17:59:53.597>
    created_at = <Date 2010-02-24.09:52:04.020>
    labels = ['type-bug', 'expert-tkinter', 'OS-windows']
    title = 'tkFileDialog.askopenfiles crashes on Windows 7'
    updated_at = <Date 2013-10-13.17:59:53.596>
    user = 'https://bugs.python.org/PatrickHolz'

    bugs.python.org fields:

    activity = <Date 2013-10-13.17:59:53.596>
    actor = 'georg.brandl'
    assignee = 'none'
    closed = True
    closed_date = <Date 2013-10-13.17:59:53.597>
    closer = 'georg.brandl'
    components = ['Tkinter', 'Windows']
    creation = <Date 2010-02-24.09:52:04.020>
    creator = 'Patrick.Holz'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 8010
    keywords = []
    message_count = 4.0
    messages = ['100020', '100022', '100036', '197771']
    nosy_count = 5.0
    nosy_names = ['amaury.forgeotdarc', 'tlesher', 'brian.curtin', 'Patrick.Holz', 'serhiy.storchaka']
    pr_nums = []
    priority = 'normal'
    resolution = 'duplicate'
    stage = 'needs patch'
    status = 'closed'
    superseder = '5712'
    type = 'behavior'
    url = 'https://bugs.python.org/issue8010'
    versions = ['Python 2.6']

    @PatrickHolz
    Copy link
    Mannequin Author

    PatrickHolz mannequin commented Feb 24, 2010

    When using the function "tkFileDialog.askopenfiles()" on Windows 7 (32-bit) the following error occurs after choosing one or more arbitrary files:

    Python 2.6.4 (r264:75708, Oct 26 2009, 08:23:19) [MSC v.1500 32 bit(Intel)] on win32
    Type "help", "copyright", "credits" or "license" for more information.
    >>> import tkFileDialog
    >>> tkFileDialog.askopenfiles()
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
      File "C:\Python26\lib\lib-tk\tkFileDialog.py", line 163, in askopenfiles
        ofiles.append(open(filename, mode))
    IOError: [Errno 2] No such file or directory: u'C'

    So it seems that the colon after "C" (the drive letter) is wrongly used as a delimiter. The functions "askopenfile" (for a single file to choose) and "askopenfilenames" (to choose only the filenames instead of open the files immediately) don't seem to be affected, furthermore the error doesn't occur on Linux or WinXP.

    @PatrickHolz PatrickHolz mannequin added type-crash A hard crash of the interpreter, possibly with a core dump topic-tkinter labels Feb 24, 2010
    @amauryfa
    Copy link
    Member

    I reproduce on winXP, and the explanation is simpler: askopenfilenames() returns a string, like "C:/t C:/t2", which is split into single chars...

    It works if I set Tkinter.wantobjects to False, but I don't know what this means.

    @briancurtin
    Copy link
    Member

    I'll have to try 7 later, but I'm not seeing this on XP.

    Changing type from crash to behavior, as this appears to just be an IOError.

    @briancurtin briancurtin added OS-windows type-bug An unexpected behavior, bug, or error and removed type-crash A hard crash of the interpreter, possibly with a core dump labels Feb 24, 2010
    @serhiy-storchaka
    Copy link
    Member

    Looks as a duplicate of bpo-5712.

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    OS-windows topic-tkinter type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    4 participants