Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

That's some horrible url parsing code...

But honestly urllib sucks:

url.hostname doesn't return the port url.netloc also returns the basic auth part So you have to f"{u.hostname}:{u.port}"



Wait till you see the cPython stdlib email parser..

Any programming language these days should ship a decent rfc5234 API in the standard library, so you do not get these kinds of problems in slightly different fashion for each and every library/program.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: