SUMMARY STEPS TO REPRODUCE 1. activate "Type" column in Dolphin to be able to see the file type text 2. create new text file "example.py" 3. write "class Example:" as line 1, press Ctrl+S to save OBSERVED RESULT a) after step 2: Dolphin shows Python file type b) after step 3: Dolphin shows "Modelica model" file type c) shell command "file example.py" says "example.py: Python script, ASCII text executable" d) even after typing a correct Python class the file type stays "Modelica model" (Example: class Example: def f(self): pass print('Hello') ) EXPECTED RESULT - file type is Python SOFTWARE/OS VERSIONS Windows: macOS: Linux/KDE Plasma: KDE Neon 5.16.4 (available in About System) KDE Plasma Version: KDE Frameworks Version: 5.62.0 Qt Version: 5.12.3 ADDITIONAL INFORMATION
I forgot: Edit the file with Kate.
(In reply to Christian Janoff from comment #0) > c) shell command "file example.py" says "example.py: Python script, ASCII Please show the output of "xdg-mime query filetype example.py"
Are you able to provide the requested information? It would also help to attach an affected file.
Dear Bug Submitter, This bug has been in NEEDSINFO status with no change for at least 15 days. Please provide the requested information as soon as possible and set the bug status as REPORTED. Due to regular bug tracker maintenance, if the bug is still in NEEDSINFO status with no change in 30 days the bug will be closed as RESOLVED > WORKSFORME due to lack of needed information. For more information about our bug triaging procedures please read the wiki located here: https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging If you have already provided the requested information, please mark the bug as REPORTED so that the KDE team knows that the bug is ready to be confirmed. Thank you for helping us make KDE software even better for everyone!
This bug has been in NEEDSINFO status with no change for at least 30 days. The bug is now closed as RESOLVED > WORKSFORME due to lack of needed information. For more information about our bug triaging procedures please read the wiki located here: https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging Thank you for helping us make KDE software even better for everyone!
I'm (finally) able to provide the requested info: "xdg-mime query filetype example.py" returns "text/x-modelica" I also managed to analyse this further, down to kmimetypefinder5 which gets called by that xdg tool: "kmimetypefinder5 example.py" returns "text/x-modelica" while (non-KDE:) "mimetype --brief --dereference example.py returns "text/x-python". So it seems to be a kmimetypefinder5 problem.
Created attachment 126933 [details] Simple example Python file used to describe the bug
The problem is in shared-mime-info. Please report it upstream here: https://gitlab.freedesktop.org/xdg/shared-mime-info/issues Workaround: add a shebang to your python file, e.g. #!/usr/bin/python
After xdgmime and shared-mime-info changes, the bug can finally be fixed in Qt itself: https://codereview.qt-project.org/c/qt/qtbase/+/328240
Awesome :)