1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Python2.4対応

Posted at

pythonは全くの素人ですが、一応解決できたのでメモ。

urlparse

AttributeError: 'tuple' object has no attribute 'scheme'

Python2.6で動かしていたスクリプトが2.4では上記エラーが出て動かない。

ググったらこのdiffが見つかり、同じような修正をすると動作するようになった。

http://code.google.com/p/pysimplesoap/issues/detail?id=53
http://code.google.com/p/pysimplesoap/source/diff?spec=svn80841894d88d2185751cbacd6eecea2e01e9daaa&name=80841894d88d&r=80841894d88d2185751cbacd6eecea2e01e9daaa&format=side&path=/pysimplesoap/client.py

修正前

from urlparse import urlparse
...
o = urlparse(url)
if not o.scheme in ('http','https', 'file'):
...
if o.scheme == 'file':

修正後

from urlparse import urlsplit
...
url_scheme, netloc, path, query, fragment = urlsplit(url)
if not url_scheme in ('http','https', 'file'):
...
if url_scheme == 'file':
1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?