Ticket #8669 (closed defect: fixed)
interrupting download in sage-spkg should delete the spkg file
| Reported by: | jhpalmieri | Owned by: | tbd |
|---|---|---|---|
| Priority: | minor | Milestone: | sage-4.4 |
| Component: | packages: optional | Keywords: | |
| Cc: | leif | Work issues: | |
| Report Upstream: | N/A | Reviewers: | Tim Dumol |
| Authors: | John Palmieri | Merged in: | sage-4.4.alpha1 |
| Dependencies: | Stopgaps: |
Description
If you run sage-spkg PKG_NAME and hit ctrl-c during downloading, you end up with a partial spkg file. Then if you run sage-spkg PKG_NAME again, it just opens up that file and then crashes because the file is incomplete.
The attached patch attempts to fix this. It seems to work, deleting the partially downloaded file, but for reasons I don't understand, it's not printing any of the accompanying messages.
Attachments
Change History
comment:2 follow-up: ↓ 3 Changed 3 years ago by leif
- Cc leif added
The reason for the "non-printing" is simple:
In local/bin/sage-sage, the output of sage-spkg is piped to tee, which is run from the same subshell and so gets the same signal.
(sage-spkg does print the messages, but tee does not "wait" for the post-Ctrl-C output.)
comment:3 in reply to: ↑ 2 Changed 3 years ago by jhpalmieri
Replying to leif:
The reason for the "non-printing" is simple:
In local/bin/sage-sage, the output of sage-spkg is piped to tee, which is run from the same subshell and so gets the same signal.
Any ideas how to fix this? I tried using "pipestatus" from #8306, but it doesn't seem to help: when I hit ctrl-C, it prints
[..^Cclose failed in file object destructor: Error in sys.excepthook: Original exception was:
Changed 3 years ago by jhpalmieri
-
attachment
trac_8669-download.3.patch
added
scripts repo (same as other patch)
comment:5 Changed 3 years ago by jhpalmieri
To the release manager: please delete all but "trac_8669-download.patch".

I'm marking this as "needs review", but if anyone can fix the printing problem mentioned in the summary, that would be great.