Ticket #10264 (closed defect: fixed)
Doctest for r.chdir() should use realpath
| Reported by: | jdemeyer | Owned by: | mvngu |
|---|---|---|---|
| Priority: | critical | Milestone: | sage-4.6.1 |
| Component: | doctest coverage | Keywords: | |
| Cc: | mpatel | Work issues: | |
| Report Upstream: | N/A | Reviewers: | Mitesh Patel |
| Authors: | Jeroen Demeyer | Merged in: | sage-4.6.1.alpha2 |
| Dependencies: | Stopgaps: |
Description (last modified by jdemeyer) (diff)
The following test from sage/interfaces/r.py breaks when $TMPDIR (by default /tmp) is a symbolic link:
EXAMPLES::
sage: import tempfile
sage: tmpdir = tempfile.mkdtemp()
sage: r.chdir(tmpdir)
On Linux, we could use ``tmpdir == sageobj(r.getwd())``
to test this, but Mac prepends ``/private/`` to such
directories, so we check that the directory name string
is in the working directory string instead::
sage: tmpdir in sageobj(r.getwd())
True
Attachments
Change History
comment:7 Changed 3 years ago by mpatel
- Status changed from needs_review to positive_review
- Reviewers set to Mitesh Patel
The patch looks good. I tested it successfully on bsd.math (OS X 10.6), sage.math (Ubuntu 8.04.4 LTS), and fulvia.skynet (SunOS 5.10) with TMPDIR unset, set to a path with no symbolic links, and set to a path with a link.
Note: See
TracTickets for help on using
tickets.


Tested on Linux with
Tested on OS X 10.4 (where /tmp is a symlink to /private/tmp) with