Opened 10 years ago
Last modified 6 years ago
#10229 needs_work defect
Deleting attached files causes major problems
Reported by: | flawrence | Owned by: | was |
---|---|---|---|
Priority: | major | Milestone: | sage-6.4 |
Component: | user interface | Keywords: | |
Cc: | Merged in: | ||
Authors: | Reviewers: | ||
Report Upstream: | N/A | Work issues: | |
Branch: | Commit: | ||
Dependencies: | Stopgaps: |
Description (last modified by )
Create a file, attach it in a Sage session, then delete/move the file. Sage does not like this - and every command results in OSError: [Errno 2] No such file or directory: '/path/to/attached/file.py
. It won't even let you detach the file.
At the moment before each command is executed, Sage checks to see if any attached files have been modified. Presumably instead it should except this error, remove the file from the list of attached files, and inform the user.
Discovered by rossk when reviewing #378.
Apply trac_10229-2.patch
Attachments (2)
Change History (13)
comment:1 Changed 9 years ago by
- Status changed from new to needs_info
comment:2 Changed 9 years ago by
- Status changed from needs_info to needs_review
comment:3 Changed 9 years ago by
- Description modified (diff)
Here is a new patch that detaches inaccessible files and issues warnings. Doctests for the re-written function modified_attached_files
have been overhauled as well. Please review!
comment:4 Changed 9 years ago by
- Status changed from needs_review to needs_work
Oops, looks like the patchbot isn't happy. Changing this to "needs work" until I (or someone else) has time to investigate.
comment:5 Changed 9 years ago by
- Status changed from needs_work to needs_review
Apply trac_10229-2.patch
comment:6 Changed 9 years ago by
Apply trac_10229-2.patch
comment:7 Changed 9 years ago by
- Status changed from needs_review to needs_work
It looks like something introduced in sage-5.0.beta8 interferes with this as the following test fails:
sage -t "devel/sage-main/sage/misc/preparser.py"
comment:8 Changed 7 years ago by
- Milestone changed from sage-5.11 to sage-5.12
comment:9 Changed 7 years ago by
- Milestone changed from sage-6.1 to sage-6.2
comment:10 Changed 7 years ago by
- Milestone changed from sage-6.2 to sage-6.3
comment:11 Changed 6 years ago by
- Milestone changed from sage-6.3 to sage-6.4
I wish I could include a patch here, but my sage install is having an unrelated issue right now, but this is an easy fix so it may be worth mentioning.
For sage/misc/preparser.py, wrap lines 1790 to 1794 in a try block, and use
{{except OSError, e:
}}
This will at least make it continue working. What would be our desired response to a moved/deleted file? I think it would make sense to detach it, since otherwise it will just keep attempting to go through this. Do we want to display a message to the user as well?
Sorry for not posting a patch, I will try to when I fix my sage install.