Skip to content

fix_tempfile_path #64

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Aug 1, 2013
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion qiniu/test/resumable_io_test.py
Original file line number Diff line number Diff line change
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