GNOME Bugzilla – Bug 403140
gedit doesn't close files when canceling opening (and blocks CDROM eject)
Last modified: 2007-02-06 13:38:52 UTC
That bug has been described on https://launchpad.net/ubuntu/+source/gedit/+bug/82539 "Binary package hint: gedit Ubuntu 6.10, x86, gedit 2.16.1 gedit doesn't close binary files properly. I tried to open (drag and drop) files from mounted CDROM in gedit. gedit warned me that it cannot detect character encoding, it offered some character sets. I selected CANCEL. Latter I found that file is still open in gedit when I was unable to umount CDROM. I used gedit to check files on CDROM, I was looking for some text files to read, I was not interested in binary files. $ lsof /dev/cdrw COMMAND PID USER FD TYPE DEVICE SIZE NODE NAME gedit 29196 oem 16r REG 22,64 10648 1871 /media/cdrom1/isolinux.bin gedit 29196 oem 17r REG 22,64 2048 1863 /media/cdrom1/boot.cat gedit 29196 oem 18r REG 22,64 10648 1871 /media/cdrom1/isolinux.bin $ ps aux | grep 29196 | grep -v grep oem 29196 0.1 1.5 66404 23696 ? S 20:20 0:04 gedit Steps to replicate: 1) open some regular text in gedit; this step is needed to have gedit copy up and running 2) put CDROM with some Linux to your CDROM 3) Ubuntu should mount CDROM 4) start new copy of gedit from menu, we will use this new gedit for our demo 5) open CDROM folder and 'drag and drop' some binary file to gedit 6) gedit should display message that it "cannot detect character encoding" 7) select CANCEL 8) I expect that gedit will release binary file after CANCEL but it seems that file is still open. Test with lsof tool."
Created attachment 81988 [details] [review] proposed patch This should fix the issue, but I do not have a cd (or a removable volume) handy here, can you guys test it and if ok apply it? If ok it should also go in 2.16
The patch applied to the feisty package fixes the problem
Thanks. I tested too and committed both on HEAD and 2.16