Opened 9 years ago
Last modified 9 years ago
#4750 new defect
Develop - create empty file is saved in logs directory
Reported by: | tonyforster | Owned by: | godiard |
---|---|---|---|
Priority: | Unspecified by Maintainer | Milestone: | Unspecified |
Component: | Develop | Version: | Unspecified |
Severity: | Unspecified | Keywords: | |
Cc: | Distribution/OS: | Unspecified | |
Bug Status: | Unconfirmed |
Description
Created an empty file 'blank.txt', it did not appear in the left pane and I could not find it in the file system.
On resuming Develop (after a restart), the left pane is not displayed. I then found the blank file in the previous sessions logs directory.
Two issues:
create empty file should be within the target Activities directory not logs, (regardless of the view in the left pane, I am not sure what it was showing at that time)
Develop should recover from a missing file without corrupting the UI
Traceback (most recent call last):
File "/usr/lib/python2.7/site-packages/sugar3/activity/activity.py", line 538, in canvas_map_cb
self.read_file(self._jobject.file_path)
File "/home/olpc/Activities/Develop.activity/develop_app.py", line 477, in read_file
self.load_file(filename)
File "/home/olpc/Activities/Develop.activity/develop_app.py", line 349, in load_file
self.editor.load_object(full_path, filename)
File "/home/olpc/Activities/Develop.activity/sourceview_editor.py", line 117, in load_object
page = GtkSourceview2Page(full_path)
File "/home/olpc/Activities/Develop.activity/sourceview_editor.py", line 331, in init
self.load_text()
File "/home/olpc/Activities/Develop.activity/sourceview_editor.py", line 353, in load_text
_file = file(self.full_path)
IOError: [Errno 2] No such file or directory: u'/home/olpc/.sugar/default/logs/blank.txt'
Change History (4)
comment:1 Changed 9 years ago by tonyforster
comment:2 follow-up: ↓ 4 Changed 9 years ago by godiard
I think the problem is we are using the active file, (in the tree view) to create the new file in the same directory. Maybe you created the file with the logs tree visible?
A possible solution is disable the "new file" button when the user have the logs tree visible, another possible solution is create the file in the activity directory in this case.
comment:3 Changed 9 years ago by tonyforster
To replicate corrupt UI:
Create empty file
Remove file - tab for empty file remains
Stop
Resume - left pane is missing
comment:4 in reply to: ↑ 2 Changed 9 years ago by tonyforster
Replying to godiard:
I think the problem is we are using the active file, (in the tree view) to create the new file in the same directory. Maybe you created the file with the logs tree visible?
I have been unable to replicate by saving with the log tree visible. Tried a few times and it saved ok in the target activity
I will let you know if I can get a reliable way do replicate the saving in the log directory.
I can replicate the UI corruption on a missing file:
Open Develop
Create empty file (mostly this is saved in the target Activity)
Delete empty file in Terminal
Close Develop
Open Develop
UI is corrupted, no left pane