Bug 418228

Summary: Python files temporarily taken as matlab files
Product: [I don't know] kde Reporter: David <david.cortes.rivera>
Component: generalAssignee: Unassigned bugs mailing-list <unassigned-bugs>
Status: RESOLVED UPSTREAM    
Severity: normal CC: nate
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Debian testing   
OS: Linux   
URL: https://gitlab.freedesktop.org/xdg/shared-mime-info/issues
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description David 2020-02-26 17:09:47 UTC
Steps to reproduce:
- Create some valid python (.py) file.
- Edit the file so that it would start with commented lines having 3 (three) "#" symbols.
- Edit some line so that it would contain a decimal number with exponential notation (e.g. 1e1).
- Inspect the folder in which the file is located with Dolphin, without pressing F5.

Expected behavior: should recognize the file as a python file.

Actual behavior: takes the file as a matlab file, until refreshing, after which it becomes a python file, but upon editing it again will become matlab once more, and will again become python upon next refresh.

Example:
### Some comment
### Another comment
### More comments

import numpy as np

n = int(1e1)
k = int(5e0)
nz = int(.5*n)
lam = 3e0
Comment 1 Nate Graham 2020-02-27 16:03:03 UTC
This is an issue in the shared-mime-info product. Please open a bug at https://gitlab.freedesktop.org/xdg/shared-mime-info/issues.

Thanks!
Comment 2 David 2020-02-27 16:04:12 UTC
(In reply to Nate Graham from comment #1)
> This is an issue in the shared-mime-info product. Please open a bug at
> https://gitlab.freedesktop.org/xdg/shared-mime-info/issues.
> 
> Thanks!

But the problem doesn't happen when I browse the folder with nemo or nautilus.
Comment 3 Nate Graham 2020-02-27 17:56:12 UTC
Hmm, maybe those apps use a different mechanism? Not sure. Either way, similar recent bugs have always been traced to shared-mime-info, so let's start there.