Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 706709
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T04:11:47+00:00 2026-05-14T04:11:47+00:00

i am working on a project, which i am developing with Python and PyQT4.

  • 0

i am working on a project, which i am developing with Python and PyQT4. I have stumbled upon a somewhat odd behaviour of the QFileDialog, that is not occuring when running the project within in my IDE (Eclipse).

The problem is that QFileDialog in ExistingFiles-mode does fail to return the list of selected files, when one of the file paths is containing a german umlaut (ä,ü,ö, etc.)
The QFileDialog is not offering options or parameters to make it sensible regarding this scenario.
Does anyone have any ideas of how to tackle this issue?

edit: my deployment scenario in which the error occurs is looking like the following. i am building an executable with Py2Exe and then make it distributable with Inno Setup. don’t know if this may have been giving birth to the problem but the more info the better i think.

edit2:
I don’t have the exact code accessable until friday, but we’re having an if-statement waiting for the dialog to compplete. like this:

fileDialog = QFileDialog(...)
if fileDialog.exec_():
    # get the choosen files
    fileNames = fileDialog.getSelectedFiles()
    # test if if-statement is entered
    print fileNames
    # convert from QStringList to normal list of Strings
    fileNames = list(map(lambda x: str(x), fileNames))
    # to suffice as an example print each
    for fileName in fileNames:
        print fileName

The first print command does get executed the second doesn’t. As if something in between is not willing to terminate and Python is handling the exception somehow quietly. The QFileDialog however is closing as supposed after choosing the files and clicking “Open” or double clicking a file.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T04:11:47+00:00Added an answer on May 14, 2026 at 4:11 am
    1. Try to use lambda x: x.toUtf8(), or toLocal8Bit() or set TextCodec to any codepage you want, it should help. These methods return properly encoded python strings. Avoid using str() on QString, it is unaware of charmap you want.

    2. What is getSelectedFiles()? There is no such method in Qt 4.5 or higher in QFileDialog class. I assumed, that it was typo or some old Qt version, and changed it to selectedFiles() in my test code.

    3. Why don’t you use convenience methods of QFileDialog for file choosing:

      getExistingDirectory()
      getOpenFileName()
      getOpenFileNames()
      getSaveFileName()

    ?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm working on a project which requires us developing our own intermediate SMTP relay
I have been working on one project which is too complex and contain very
I am developing a PHP project and using PDT with XDebug which is working
I was working on a project which includes developing an application using java sockets.
I'm working on a project that requires developing an android application for a galaxy
I am working on a project that involves an embedded system which runs a
I'm currently working on a large project which is expected to have a large
I am developing a custom web part for a project that I am working
Can anyone help me find an up-to-date, working ATL project which has a main
Iam working on a project which involves writing a Mork File (Mork is a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.