TST: add a test for tilde in tempfile for the PS backend #5958

Merged
merged 1 commit into from Feb 3, 2016

Conversation

Projects
None yet
4 participants
Contributor

janschulz commented Feb 2, 2016

The PS uses latex in some cases (usetex=True) and latex does not like to be called with dirnames with ~ in it (reserved char). The Fix for that was in #5928, this is just a testcase to test for the fix.

mdboom added the needs_review label Feb 2, 2016

@QuLogic QuLogic and 1 other commented on an outdated diff Feb 2, 2016

lib/matplotlib/tests/test_backend_ps.py
@@ -134,6 +134,46 @@ def test_patheffects():
fig.savefig(ps, format='ps')
+@cleanup
+@needs_tex
+@needs_ghostscript
+def test_tilde_in_tempfilename():
+ # Tilde ~ in the tempdir path (e.g. TMPDIR, TMP oder TEMP on windows
+ # when the username is very long and windows uses a short name) breaks
+ # latex before https://github.com/matplotlib/matplotlib/pull/5928
+ import tempfile
+ import shutil
+ import os
+ import os.path
+
+ dirpath = None
@QuLogic

QuLogic Feb 2, 2016

Member

Where is this set to anything else?

@QuLogic

QuLogic Feb 2, 2016

Member

I think maybe this should be tempdir.

@janschulz

janschulz Feb 2, 2016

Contributor

yes, that should have been tempdir, so that if that is set, it will remove in the finally...

@janschulz

janschulz Feb 2, 2016

Contributor

done (amended and force pushed)

@janschulz janschulz TST: add a test for tilde in tempfile for the PS backend
The PS uses latex in some cases (usetex=True) and latex does not
like to be called with dirnames with ~ in it (reserved char).
The Fix for that was in
#5928, this is just a
testcase to test for the fix.
df9204b

@tacaswell tacaswell added a commit that referenced this pull request Feb 3, 2016

@tacaswell tacaswell Merge pull request #5958 from JanSchulz/tilde-in-temp
TST: add a test for tilde in tempfile for the PS backend
1fa2697

@tacaswell tacaswell merged commit 1fa2697 into matplotlib:master Feb 3, 2016

2 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

tacaswell removed the needs_review label Feb 3, 2016

@tacaswell tacaswell added a commit that referenced this pull request Feb 3, 2016

@tacaswell tacaswell Merge pull request #5958 from JanSchulz/tilde-in-temp
TST: add a test for tilde in tempfile for the PS backend
a25bcbf
Owner

tacaswell commented Feb 3, 2016

backported to 1.5.x as a25bcbf

@tacaswell tacaswell added a commit to tacaswell/matplotlib that referenced this pull request May 22, 2016

@tacaswell tacaswell Merge pull request #5958 from JanSchulz/tilde-in-temp
TST: add a test for tilde in tempfile for the PS backend
1e5ff75
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment