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.
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.