After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 771498 - Text pasted/entered in blank comparison can't be saved
Text pasted/entered in blank comparison can't be saved
Status: RESOLVED FIXED
Product: meld
Classification: Other
Component: filediff
3.16.x
Other All
: Normal major
: ---
Assigned To: meld-maint
meld-maint
: 781586 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2016-09-15 18:13 UTC by Vasily Galkin
Modified: 2017-04-21 21:23 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Simple fix: save file in utf-8 since there is no original encoding. (892 bytes, patch)
2016-09-15 18:16 UTC, Vasily Galkin
none Details | Review
Simple fix: save file in utf-8 since there is no original encoding (review improvements). (913 bytes, patch)
2016-09-17 09:12 UTC, Vasily Galkin
none Details | Review

Description Vasily Galkin 2016-09-15 18:13:23 UTC
Meld can't save text entered/pasted in blank comparison.

Preparation steps:
1.Start meld without arguments.
2.Press "file compariosn", then "blank comparison"
3.Paste some data in both windows

Bug scenario 1 - crash while saving on window close:
4. Press close button on a window - a window suggesting saving appears
5. Press Save there - file selector appears for left pane
6. Enter file name in selector and press Save
Result: file is not saved, meld crashes with:

Traceback (most recent call last):
  • File "/home/vgalkin/opt/meld/meld/meldwindow.py", line 320 in on_delete_event
    response = page.on_delete_event()
  • File "/home/vgalkin/opt/meld/meld/filediff.py", line 852 in on_delete_event
    response = self.check_save_modified()
  • File "/home/vgalkin/opt/meld/meld/filediff.py", line 818 in check_save_modified
    self.save_file(i)
  • File "/home/vgalkin/opt/meld/meld/filediff.py", line 1498 in save_file
    encoding = source_encoding.get_charset()

Bug scenario 2 - file is not saved after using save:
4. Select "Save as..." in context menu of a left file - file selector appears for left pane
5. Enter file name in selector and press Save
Result: file is NOT saved, meld continues working without showing any GUI errors. same traceback in terminal.
Comment 1 Vasily Galkin 2016-09-15 18:16:43 UTC
Created attachment 335659 [details] [review]
Simple fix: save file in utf-8 since there is no original encoding.
Comment 2 Kai Willadsen 2016-09-16 22:50:51 UTC
Review of attachment 335659 [details] [review]:

Looks good to me, other than the minor style issue below.

::: meld/filediff.py
@@ +1495,2 @@
         source_encoding = bufdata.sourcefile.get_encoding()
+        if not source_encoding: #no encoding for new blank comparison

Can you please fix this comment to be PEP8: either on its own line, or two spaces before the hash, and always one space after the hash. The general preference in new Meld code is on its own line, but whatever works for you.
Comment 3 Vasily Galkin 2016-09-17 09:12:20 UTC
Created attachment 335756 [details] [review]
Simple fix: save file in utf-8 since there is no original encoding (review improvements).
Comment 4 Kai Willadsen 2016-09-17 21:07:38 UTC
Great, thanks. I've pushed your patch to master and the 3.16 branch.
Comment 5 Kai Willadsen 2017-04-21 21:05:15 UTC
*** Bug 781586 has been marked as a duplicate of this bug. ***
Comment 6 Nrbrtx 2017-04-21 21:23:25 UTC
Thank you, Kai!
I installed 3.16.3 and it works as expected.