Skip to content

Commit ad1a9b5

Browse files
committed
Merge pull request #64 from coaku/feature/b_xzk_fix_tempfile_create
fix_tempfile_path
2 parents e406430 + 4600ce8 commit ad1a9b5

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

qiniu/test/resumable_io_test.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import unittest
44
import string
55
import random
6+
import platform
67
try:
78
import zlib as binascii
89
except ImportError:
@@ -52,7 +53,11 @@ def test_block(self):
5253

5354
def test_put(self):
5455
src = urllib.urlopen("http://cheneya.qiniudn.com/hello_jpg")
55-
tmpf = os.tmpnam()
56+
ostype = platform.system()
57+
if ostype.lower().find("windows") != -1:
58+
tmpf = "".join([os.getcwd(), os.tmpnam()])
59+
else:
60+
tmpf = os.tmpnam()
5661
dst = open(tmpf, 'wb')
5762
shutil.copyfileobj(src, dst)
5863
src.close()

0 commit comments

Comments
 (0)