Nautilus miss-identifies MIME type of certain scripts that begin with "--"

Bug #115035 reported by Kaso
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
shared-mime-info (Ubuntu)
Triaged
Low
Unassigned

Bug Description

Binary package hint: nautilus

When opening the properties window for certain lua scripts the "Type:" is reported as "VHDL document" and "MIME type:" as "text/x-vhdl" when the file is infact a valid lua script.

gnomevfs-info core.lua | grep MIME

for the offending file however returns "MIME type : text/x-lua"

As far as i can tell this is linked to using comments on the first line of the lua script, for example

-- [[ test ]]
tableT={"this","is","a","lua","script"}
for key,val in pairs(tableT) do
 print(val)
end

Is Identified as a VHDL document whereas

tableT={"this","is","a","lua","script"}
-- [[ test ]]
for key,val in pairs(tableT) do
 print(val)
end

Is properly Identified as a lua script.

Revision history for this message
Kaso (jonathanduncan) wrote :

I though i should add this is
» Ubuntu version 7.04 Feisty Fawn
» Nautilus 2.18.1

Revision history for this message
Sebastien Bacher (seb128) wrote :

Thank you for your bug. The shared-mime-info database lists vhdl files as starting with "--" and lua files as starting with "/bin/lua" or "/bin/env lua". Reassigning to shared-mime-info, not sure if that's a bug though, your lua script should likely start with the interpreter to be correct

Changed in nautilus:
importance: Undecided → Low
Revision history for this message
Pedro Villavicencio (pedro) wrote :

Thank you for taking the time to report this bug and helping to make Ubuntu better. You reported this bug a while ago and there hasn't been any activity in it recently. We were wondering is this still an issue for you? Could you try to reproduce the same with Ubuntu 8.10 or 9.04? Thanks in advance.

Changed in shared-mime-info:
status: New → Incomplete
Revision history for this message
Pedro Villavicencio (pedro) wrote :

We are closing this bug report because it lacks the information we need to investigate the problem, as described in the previous comments. Please reopen it if you can give us the missing information, and don't hesitate to submit bug reports in the future. To reopen the bug report you can click on the current status, under the Status column, and change the Status back to New. Thanks again!.

Changed in shared-mime-info (Ubuntu):
status: Incomplete → Invalid
Revision history for this message
Ryan T Long (rtlong) wrote :

I can confirm this bug. It seems the method of recognising a VHDL document is too ambiguous. I am finding YAML files (which should begin with a line containing the begin-stream header: '---') are also recognised as VHDL. If this header is removed the type is reported as text/plain in nautilus.

I'm not sure if it's related or not, but it seems YAML files that I have tested with gnomevfs-info as done above are reported as application/octet-stream instead of text/x-yaml.

Changed in shared-mime-info (Ubuntu):
status: Invalid → Confirmed
Revision history for this message
Ryan T Long (rtlong) wrote :

I apologise. I mis-read the comment regarding reopening this bug. I'm new to this. Nevertheless, I'm able to unofficially confirm this bug.

Changed in shared-mime-info (Ubuntu):
status: Confirmed → New
summary: - Nautilus miss-identifies MIME type of certain lua scripts
+ Nautilus miss-identifies MIME type of certain scripts that begin with
+ "--"
Revision history for this message
Sebastien Bacher (seb128) wrote :

could you add a buggy example to the bug?

Changed in shared-mime-info (Ubuntu):
status: New → Incomplete
Revision history for this message
Ryan T Long (rtlong) wrote :

Upon further inspection, I am seeing other behavior as well. I looked at some other YAML files and they are reported as either a text/patch or a text/x-yaml. I will include an example of each file.

Revision history for this message
Ryan T Long (rtlong) wrote :
Revision history for this message
Ryan T Long (rtlong) wrote :
Revision history for this message
Ryan T Long (rtlong) wrote :
Revision history for this message
rusivi2 (rusivi2-deactivatedaccount) wrote :

Thank you for taking the time to report this bug and helping to make Ubuntu better. I noticed the package your bugging is updated in Maverick. Does this occur in it? If so, please feel free to mark this bug as new. Thanks in advance!

Revision history for this message
Jean-Baptiste Lallement (jibel) wrote :

Yes it's still an issue.
rusivi, the reporter and commenters provided trivial steps to reproduce the issue, so please try it before asking. Thanks.

Changed in shared-mime-info (Ubuntu):
status: Incomplete → Triaged
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.