Supports Python 2.4

python is a complete amateur, but I've solved it, so make a note.

urlparse

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

The script that was running in Python 2.6 does not work in 2.4 with the above error.

I found this diff when I googled it, and it worked with similar modifications.

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

Before correction

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

Revised

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

Recommended Posts

Supports Python 2.4
Python
Note that it supports Python 3
Python basics ⑤
python + lottery 6
Python Summary
Built-in python
Python comprehension
Python technique
Studying python
Python 2.7 Countdown
Python memorandum
Python FlowFishMaster
Python service
python tips
python function ①
Python basics
ufo-> python (3)
Python comprehension
install python
Python Singleton
python memo
Python Jinja2
atCoder 173 Python
[Python] function
Python installation
python tips
Installing Python 3.4.3.
Try python
Python memo
Python algorithm
Python2 + word2vec
[Python] Variables
Python functions
Python sys.intern ()
Python tutorial
Python decimals
python underscore
Python summary
Start python
[Python] Sort
Note: Python
Python basics ③
python log
Python basics
[Scraping] Python scraping
Python update (2.6-> 2.7)
python memo
Python # sort
ufo-> python
Python nslookup
python learning
Hannari Python 2020
[Rpmbuild] Python 3.7.3.
Prorate Python (1)
python memorandum
Download python
started python
Python #JSON
python quiz
Python encoding