mirror of
				https://github.com/python/cpython.git
				synced 2025-10-31 13:41:24 +00:00 
			
		
		
		
	Patch #1637: fix urlparse for URLs like 'http://x.com?arg=/foo'.
Fix by John Nagle.
This commit is contained in:
		
							parent
							
								
									3001c5463e
								
							
						
					
					
						commit
						c6a04c2629
					
				
					 3 changed files with 13 additions and 7 deletions
				
			
		|  | @ -169,13 +169,12 @@ def _splitparams(url): | |||
|     return url[:i], url[i+1:] | ||||
| 
 | ||||
| def _splitnetloc(url, start=0): | ||||
|     for c in '/?#': # the order is important! | ||||
|         delim = url.find(c, start) | ||||
|         if delim >= 0: | ||||
|             break | ||||
|     else: | ||||
|         delim = len(url) | ||||
|     return url[start:delim], url[delim:] | ||||
|     delim = len(url)   # position of end of domain part of url, default is end | ||||
|     for c in '/?#':    # look for delimiters; the order is NOT important | ||||
|         wdelim = url.find(c, start)        # find first of this delim | ||||
|         if wdelim >= 0:                    # if found | ||||
|             delim = min(delim, wdelim)     # use earliest delim position | ||||
|     return url[start:delim], url[delim:]   # return (domain, rest) | ||||
| 
 | ||||
| def urlsplit(url, scheme='', allow_fragments=True): | ||||
|     """Parse a URL into 5 components: | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Guido van Rossum
						Guido van Rossum