Skip to content

Commit

Permalink
Fixed #46 - Use a proper temp dir instead of /tmp.
Browse files Browse the repository at this point in the history
  • Loading branch information
jezdez committed Jul 26, 2010
1 parent e475745 commit 68075ad
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions virtualenv.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import re
import shutil
import logging
import tempfile
import distutils.sysconfig
try:
import subprocess
Expand Down Expand Up @@ -286,7 +287,6 @@ def _install_req(py_executable, unzip=False, distribute=False):
if is_jython and os._name == 'nt':
# Jython's .bat sys.executable can't handle a command line
# argument with newlines
import tempfile
fd, ez_setup = tempfile.mkstemp('.py')
os.write(fd, bootstrap_script)
os.close(fd)
Expand Down Expand Up @@ -324,10 +324,10 @@ def _filter_ez_setup(line):
return filter_ez_setup(line, project_name)

if not os.access(os.getcwd(), os.W_OK):
cwd = '/tmp'
cwd = tempfile.mkdtemp()
if source is not None and os.path.exists(source):
# the current working dir is hostile, let's copy the
# tarball to /tmp
# tarball to a temp dir
target = os.path.join(cwd, os.path.split(source)[-1])
shutil.copy(source, target)
try:
Expand Down

0 comments on commit 68075ad

Please # to comment.