Skip to content

Commit

Permalink
Merge pull request #64 from coaku/feature/b_xzk_fix_tempfile_create
Browse files Browse the repository at this point in the history
fix_tempfile_path
  • Loading branch information
longbai committed Aug 1, 2013
2 parents e406430 + 4600ce8 commit ad1a9b5
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion qiniu/test/resumable_io_test.py
Expand Up @@ -3,6 +3,7 @@
import unittest
import string
import random
import platform
try:
import zlib as binascii
except ImportError:
Expand Down Expand Up @@ -52,7 +53,11 @@ def test_block(self):

def test_put(self):
src = urllib.urlopen("http://cheneya.qiniudn.com/hello_jpg")
tmpf = os.tmpnam()
ostype = platform.system()
if ostype.lower().find("windows") != -1:
tmpf = "".join([os.getcwd(), os.tmpnam()])
else:
tmpf = os.tmpnam()
dst = open(tmpf, 'wb')
shutil.copyfileobj(src, dst)
src.close()
Expand Down

0 comments on commit ad1a9b5

Please sign in to comment.