Ticket #8669 (closed defect: fixed)

Opened 3 years ago

Last modified 3 years ago

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

trac_8669-download.2.patch Download (1.7 KB) - added by jhpalmieri 3 years ago.
scripts repo
trac_8669-download.patch Download (1.7 KB) - added by jhpalmieri 3 years ago.
scripts repo
trac_8669-download.3.patch Download (1.7 KB) - added by jhpalmieri 3 years ago.
scripts repo (same as other patch)

Change History

comment:1 Changed 3 years ago by jhpalmieri

  • Status changed from new to needs_review

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

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:

comment:4 Changed 3 years ago by jhpalmieri

Okay, here's a new patch without any printing problems.

Changed 3 years ago by jhpalmieri

scripts repo

Changed 3 years ago by jhpalmieri

scripts repo

Changed 3 years ago by jhpalmieri

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".

comment:6 Changed 3 years ago by timdumol

  • Status changed from needs_review to positive_review
  • Reviewers set to Tim Dumol

Works as advertised. Positive review.

comment:7 Changed 3 years ago by jhpalmieri

  • Status changed from positive_review to closed
  • Resolution set to fixed
  • Merged in set to sage-4.4.alpha1

Merged "trac_8669-download.patch" into 4.4.alpha1.

Note: See TracTickets for help on using tickets.