Q: Python 3 normalize URL Alright, so apparently python 3 is pretty ridiculous when it comes to urllib.
So, I have an url like this formatted like so, 
http_request = "http://localhost/system/index.php/index_file/store?cid={0}&cname={1}&fname={2}&fdir='{3}'"\
                       .format(client_id, client_name, each[1], each[2])

where each[1] and each[2] are the file names and file directories, respectively. 
So a generated result of http_request through print() would give something like this,
http://localhost/system/index.php/index_file/store? \
cid=90823&cname=John Smith&fname=Sample Document.doc& \
fdir='C:\Users\williamyang\Desktop\Files\90823 Michelle Moore\Sample Document.doc'

(The purpose of the lone backslash is just so it fits here better. The actual code doesn't have lone backslashes at the end of each line.)
And that was perfectly fine if I enter that URL into a browser. The PHP app recieved all the indices through $_GET, then off to MySQL, no problems. 
But if I let python do it, 
PHP tells me indices $_GET['fname'] and $_GET['fdir'] Does not exist!!! What madness. Okay, then,
I tried everything from urllib.parse, urllib encoding and decoding, http_request.replace('\\', '/'), and many others.
None of which worked.
I was once told by my prof python does funny things when it comes to character encoding.
here is how I send my URL, before all the crazy and useless urllib parse experiments
def getResponseCode(url):        
    conn = urllib.request.urlopen((url))
    return conn.read()

Where url = http_request
How can I go about solving this? 
PHP says $_GET['fname'] and $_GET['fdir'] Does not exist
But when I paste the auto-generated http_request into a browser,
Everything is fine

A: URLs are not supposed to contain spaces. Your browser will automatically percent-encode URLs, replacing characters that shouldn't be in a URL with something like %20 or +, following the rules of URL escaping. Python won't do this automatically; most likely, the convenience introduces ambiguities that matter for programming, but don't bother the average web user. The Python tools for url escaping are urllib.quote and urllib.quote_plus; you probably want quote_plus. Pass the path component of the URL to urllib.quote_plus before sticking it to the domain name, and you should be good to go.

A: Solution for python 2:
How can I normalize a URL in python
Solution for python 3:
Ma wonky solution>
right after reading directories from os.walk() do var.replace(" ", "_")
on php end,
$var = str_replace('_', ' ', $_GET['var']);
