well urljoin is very dangerous and often do what you dont want:

http://stackoverflow.com/questions/10893374/python-confusions-with-urljoin