diff options
author | Filipp Lepalaan <f@0x00.co> | 2013-04-03 11:52:28 +0300 |
---|---|---|
committer | Filipp Lepalaan <f@0x00.co> | 2013-04-03 11:52:28 +0300 |
commit | 80f5cf00c8de0aea27c8ea6e897c85f7da730b92 (patch) | |
tree | da8fb9053a2f1b266f3fee65e925e11c9fc2d7c2 /gsxws.py | |
parent | e69ce467610530c4f4810c91d1faa070105e2813 (diff) | |
download | py-gsxws-80f5cf00c8de0aea27c8ea6e897c85f7da730b92.tar.gz py-gsxws-80f5cf00c8de0aea27c8ea6e897c85f7da730b92.tar.bz2 py-gsxws-80f5cf00c8de0aea27c8ea6e897c85f7da730b92.zip |
Fixed fetching Part image
Diffstat (limited to 'gsxws.py')
-rwxr-xr-x | gsxws.py | 5 |
1 files changed, 2 insertions, 3 deletions
@@ -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) |