aboutsummaryrefslogtreecommitdiffstats
path: root/gsxws.py
diff options
context:
space:
mode:
authorFilipp Lepalaan <f@0x00.co>2013-04-03 11:52:28 +0300
committerFilipp Lepalaan <f@0x00.co>2013-04-03 11:52:28 +0300
commit80f5cf00c8de0aea27c8ea6e897c85f7da730b92 (patch)
treeda8fb9053a2f1b266f3fee65e925e11c9fc2d7c2 /gsxws.py
parente69ce467610530c4f4810c91d1faa070105e2813 (diff)
downloadpy-gsxws-80f5cf00c8de0aea27c8ea6e897c85f7da730b92.tar.gz
py-gsxws-80f5cf00c8de0aea27c8ea6e897c85f7da730b92.tar.bz2
py-gsxws-80f5cf00c8de0aea27c8ea6e897c85f7da730b92.zip
Fixed fetching Part image
Diffstat (limited to 'gsxws.py')
-rwxr-xr-xgsxws.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/gsxws.py b/gsxws.py
index 23e3022..5a0597e 100755
--- a/gsxws.py
+++ b/gsxws.py
@@ -576,11 +576,10 @@ class Part(GsxObject):
image = '%s_350_350.gif' % self.partNumber
url = 'https://km.support.apple.com.edgekey.net/kb/imageService.jsp?image=%s' % image
- tmpfile = tempfile.NamedTemporaryFile(suffix=image)
+ tmpfile = tempfile.mkstemp(suffix=image)
try:
- result = urllib.urlretrieve(url, tmpfile.name)
- return result[0]
+ return urllib.urlretrieve(url, tmpfile[1])[0]
except Exception, e:
raise GsxError('Failed to fetch part image: %s' % e)