<match> in mime/packages/freedesktop.org.xml is matching wrong files

Bug #2041672 reported by Dan Gut
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
shared-mime-info (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

/usr/share/mime/packages/freedesktop.org.xml
line 10466 -> value="import Qt" offset="0:3000"
context:
    <magic priority="80">
      <match type="string" value="/bin/env qml" offset="2:16"/>
      <match type="string" value="import Qt" offset="0:3000">
 <match type="string" value="{" offset="9:3009"/>
      </match>
      <match type="string" value="import Qml" offset="0:3000">
 <match type="string" value="{" offset="9:3009"/>
      </match>
    </magic>

is matching python files using Pyside
with imports like:

from PySide2.QtCore import Qt, QSettings, QSize

considering them 'Qt Markup Language files (text/x-qml)' thus wrecking havoc down the line. Maybe just remove this match entry as it seems very broad

Dan Gut (dangutter)
summary: - glob in mime/packages/freedesktop.org.xml is matching wron files
+ glob in mime/packages/freedesktop.org.xml is matching wrong files
Revision history for this message
Dan Gut (dangutter) wrote : Re: glob in mime/packages/freedesktop.org.xml is matching wrong files

removing

      <match type="string" value="import Qt" offset="0:3000">
 <match type="string" value="{" offset="9:3009"/>
      </match>

and

sudo update-mime-database /usr/share/mime

fixes the issue locally until the next update

summary: - glob in mime/packages/freedesktop.org.xml is matching wrong files
+ <match> in mime/packages/freedesktop.org.xml is matching wrong files
Revision history for this message
Jeremy Bícha (jbicha) wrote :

When reporting bugs in the future please use apport by using 'ubuntu-bug' and the name of the package affected. You can learn more about this functionality at https://wiki.ubuntu.com/ReportingBugs.

This issue is believed to be fixed in shared-mime-info 2.2 which is available in Ubuntu 22.10 and higher:
https://gitlab.freedesktop.org/xdg/shared-mime-info/-/commit/b5df32dc

Changed in shared-mime-info (Ubuntu):
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.