Opened 5 years ago

Closed 5 years ago

#16293 closed defect (fixed)

Fix sage-cleaner's rm_rf function on OS X

Reported by: jhpalmieri Owned by:
Priority: blocker Milestone: sage-6.2
Component: scripts Keywords:
Cc: Merged in:
Authors: John Palmieri Reviewers: Leif Leonhardy
Report Upstream: N/A Work issues:
Branch: a51436e (Commits) Commit: a51436eba20b2c05f84aa99439b960c65fc48500
Dependencies: Stopgaps:

Description

On OS X, if you use os.unlink on a directory, you get an OSError, "[Errno 1] Operation not permitted". We need to catch this so that sage-cleaner works properly. (On linux machines, you seem to get OSError, "[Errno 21] Is a directory".)

Change History (5)

comment:1 Changed 5 years ago by jhpalmieri

  • Status changed from new to needs_review

comment:2 Changed 5 years ago by jhpalmieri

Note that without this patch, sage-cleaner keeps writing this to the log file:

Checking PIDs [36850]
Process 36850 is no longer running, so we clean up
Deleting /Users/palmieri/.sage/temp/jpalmieri/36850

without successfully deleting the directory. So after a while, the log file is quite large, the directory is still there, and sage-cleaner is still running.

comment:3 follow-up: Changed 5 years ago by leif

Fix certainly looks correct, but I can't test whether it really fixes the problem on MacOS X right now...

comment:4 in reply to: ↑ 3 Changed 5 years ago by leif

  • Reviewers set to Leif Leonhardy
  • Status changed from needs_review to positive_review

Replying to leif:

I can't test whether it really fixes the problem on MacOS X right now...

WFM.

comment:5 Changed 5 years ago by vbraun

  • Branch changed from u/jhpalmieri/cleaner_rm_rf to a51436eba20b2c05f84aa99439b960c65fc48500
  • Resolution set to fixed
  • Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.