Opened 7 years ago

Closed 7 years ago

#13195 closed defect (fixed)

import shutil in sage-ptest

Reported by: jdemeyer Owned by: leif
Priority: blocker Milestone: sage-5.1
Component: scripts Keywords:
Cc: Merged in: sage-5.1.rc1
Authors: Jeroen Demeyer Reviewers: Volker Braun
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Description (last modified by jdemeyer)

The following can happen when running sage -tp [...]:

Traceback (most recent call last):
  File "/SSD1/sage-5.1.rc0/local/bin/sage-ptest", line 396, in <module>
    shutil.rmtree(TMP)
NameError: name 'shutil' is not defined

apply 13195_ptest_shutil.patch to the scripts (local/bin) repository.

Attachments (1)

13195_ptest_shutil.patch (542 bytes) - added by jdemeyer 7 years ago.

Download all attachments as: .zip

Change History (6)

Changed 7 years ago by jdemeyer

comment:1 Changed 7 years ago by jdemeyer

  • Description modified (diff)
  • Status changed from new to needs_review

comment:2 Changed 7 years ago by vbraun

  • Reviewers set to Volker Braun
  • Status changed from needs_review to positive_review

I've never seen that error but its better to import it if we use it, of course ;-)

comment:3 Changed 7 years ago by jhpalmieri

For what it's worth, I tested it by adding a line:

  • sage-ptest

    diff --git a/sage-ptest b/sage-ptest
    a b for gr in range(0,numglobaliteration): 
    388388    # Should TMP be a subdirectory of tempfile.gettempdir() rather than SAGE_TE
    389389    TMP = os.path.join(SAGE_TESTDIR, '%s-%s' % (HOSTNAME, os.getpid()))
    390390    TMP = os.path.abspath(TMP)
     391    os.makedirs(TMP)
    391392    try:
    392393        os.makedirs(TMP)
    393394    except OSError:

Naturally, this resulted in an error before the patch, success after the patch.

comment:4 Changed 7 years ago by jdemeyer

  • Milestone changed from sage-5.2 to sage-5.1

comment:5 Changed 7 years ago by jdemeyer

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