Content of file with .theme extension is destroyed when renamed

Bug #277379 reported by Isaac Raway
4
Affects Status Importance Assigned to Milestone
Nautilus
New
Medium
nautilus (Ubuntu)
Fix Released
Low
Ubuntu Desktop Bugs

Bug Description

Binary package hint: nautilus

I'm using Ubuntu 8.04, and doing some file work using Nautilus 2.22.3. If I rename a file that already has the .theme extension, it's contents are suddenly replaced. The file itself is however not actually renamed.

I am attaching the destroyed file. The version of the file that's on the server is a few hundred lines long. Please note that while the upload is named "chameleon.theme" it shows in my system as lkbart.theme. Will attach screen shots to prove this.

This doesn't happen when adding the .theme extension to a file that doesn't already have it. It doesn't appear to matter what you rename the file TO, if it HAD the .theme extension, it is destroyed.

This is easy to recreate:

1. Open Nautilus to home directory
2. Create a new file in Nautilus Right click -> Create Document -> empty file
3. Name the file foo.txt
4. Edit the file (double click) - add several lines of text.
5. Rename the file to foo.bar

Expect: file to be renamed and preserved as is.
What happened: Contents of the file are replaced with INI formatted data. Sometimes the previous text is partially preserved at the bottom of the file - heavily truncated.

Steps to confirm file is not actually renamed:
1. Open a new terminal.
2. CD to home directory
3. ls
4. foo.theme shows in the listing - foo.bar is not present.
5. cat foo.theme prints the INI formated data that Nautilus thinks is in foo.bar

Revision history for this message
Isaac Raway (isaac-raway) wrote :
Revision history for this message
Isaac Raway (isaac-raway) wrote :

*** Missed a step to reproduce ***

1. Open Nautilus to home directory
2. Create a new file in Nautilus Right click -> Create Document -> empty file
3. Name the file foo.txt
4. Edit the file (double click) - add several lines of text.
5. *** Rename the file to foo.theme (Right click -> Rename) ***
6. Rename the file to foo.bar (Right click -> Rename)

Revision history for this message
Jason Ribeiro (jrib) wrote :

I can confirm this behavior in nautilus 1:2.22.3-0ubuntu2 on hardy.

Steps to reproduce:
1. Open Nautilus to home directory
2. Create a new file in Nautilus Right click -> Create Document -> empty file
3. Name the file foo.theme
4. Edit the file (double click) - add several lines of text.
5. Rename the file to foo.bar

Note that Isaac made a typo above in step 3. You must create a .theme file originally (not .txt) and then rename it to some other extension.

This bug causes data loss as a user does not expect the behavior nor is he warned by nautilus that it is going to overwrite the contents of the file.

Changed in nautilus:
status: New → Confirmed
Revision history for this message
Isaac Raway (isaac-raway) wrote :
Revision history for this message
Sebastien Bacher (seb128) wrote :

that's not really a bug, .themes is a special format to describe themes and is handled differently

Revision history for this message
Isaac Raway (isaac-raway) wrote :

This is absolutely a bug. It causes user data loss. An operating system does not get to have special file extensions that it reserves for itself, beyond the standard accepted ones. *.theme files are used by Drupal and probably many other applications for their own theming purposes, assuming that just because a file has this extension that it must be some sort of Ubuntu or Gnome or whatever theme file is incorrect behavior. Perhaps, if this behavior is desired for files that truly are of that theming format it should confirm that they actually contain the expected data format before changing it.

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

could you open the bug on bugzilla.gnome.org where people writting the software will actually read it? it's not likely to be worked in an ubuntu specific way

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

could somebody send this issue upstream to bugzilla.gnome.org ? for forwarding instructions please have a look to https://wiki.ubuntu.com/Bugs/Upstream/GNOME; leaving this as incomplete until that, thanks in advance.

Changed in nautilus:
assignee: nobody → desktop-bugs
status: Confirmed → Incomplete
Revision history for this message
Martin Mai (mrkanister-deactivatedaccount-deactivatedaccount) wrote :

Forwarded it upstream

Changed in nautilus:
importance: Undecided → Unknown
status: New → Unknown
Changed in nautilus:
status: Unknown → New
Changed in nautilus:
status: Incomplete → Triaged
Changed in nautilus:
importance: Unknown → Medium
Revision history for this message
Sebastien Bacher (seb128) wrote :

The issue seems fixed in the current version (tested on disco)

Changed in nautilus (Ubuntu):
status: Triaged → 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.