zerodha / pykiteconnect

The official Python client library for the Kite Connect trading APIs
MIT License
978 stars 467 forks source link

Replaced urljoin function in favour of Concatenation #126

Closed techie-subhadeep closed 2 years ago

techie-subhadeep commented 2 years ago

urljoin produced un-intuitive joins for example

from urllib.parse import urljoin

>>> urljoin('some', 'thing')
'thing'
>>> urljoin('http://some', 'thing')
'http://some/thing'
>>> urljoin('http://some/more', 'thing')
'http://some/thing'
>>> urljoin('http://some/more/', 'thing') # just a / after 'more'
'http://some/more/thing'
urljoin('http://some/more/', '/thing')
'http://some/thing'

to simplify the final URL generation process, it is proposed to replaced urljoin with simple string concatenation

vividvilla commented 2 years ago

The reason we do this is that we take the root URL from the user which can end with /. So in this case full URL will have double forward slash.