Opened 9 years ago

Closed 9 years ago

#14557 closed defect (fixed)

doctesting framework doesn't properly handle atexit

Reported by: ohanar Owned by: roed
Priority: major Milestone: sage-5.10
Component: doctest framework Keywords:
Cc: jdemeyer, roed Merged in: sage-5.10.beta3
Authors: Jeroen Demeyer Reviewers: R. Andrew Ohana
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Status badges

Description

any commands that are registered through atexit are not run if they are called through a DocTestWorker.

For example

sage: import atexit, shutil, tempfile
sage: atexit.register(shutil.rmtree, tempfile.mkdtemp())

leaves a temporary file behind when run through the doctesting framework when there shouldn't be (the behaviour that you get when you run the same commands through the sage command line).

Attachments (1)

14557_doctest_atexit.patch (2.8 KB) - added by jdemeyer 9 years ago.

Download all attachments as: .zip

Change History (8)

comment:1 Changed 9 years ago by jdemeyer

I guess the bug is really that Python's multiprocess.Process() instances don't call atexit handlers when they die.

comment:2 Changed 9 years ago by jdemeyer

  • Authors set to Jeroen Demeyer

Working on a patch...

comment:3 Changed 9 years ago by jdemeyer

  • Status changed from new to needs_review

comment:4 Changed 9 years ago by ohanar

  • Reviewers set to R. Andrew Ohana
  • Status changed from needs_review to needs_work

when not running long doctests the second os.path.isfile(F) will fail, otherwise this looks good

Changed 9 years ago by jdemeyer

comment:5 Changed 9 years ago by jdemeyer

  • Status changed from needs_work to needs_review

comment:6 Changed 9 years ago by ohanar

  • Status changed from needs_review to positive_review

comment:7 Changed 9 years ago by jdemeyer

  • Merged in set to sage-5.10.beta3
  • Resolution set to fixed
  • Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.