mirror of
				https://github.com/python/cpython.git
				synced 2025-11-03 19:34:08 +00:00 
			
		
		
		
	Patches by Michael Reilly to correctly deal with ftp URLs of the form
ftp://user@host//root/path: the double slash in the pathname means to go to the root directory even if the initial directory isn't the root.
This commit is contained in:
		
							parent
							
								
									6c395ba316
								
							
						
					
					
						commit
						5e006a3cc3
					
				
					 1 changed files with 1 additions and 0 deletions
				
			
		| 
						 | 
					@ -362,6 +362,7 @@ class URLopener:
 | 
				
			||||||
        dirs = string.splitfields(path, '/')
 | 
					        dirs = string.splitfields(path, '/')
 | 
				
			||||||
        dirs, file = dirs[:-1], dirs[-1]
 | 
					        dirs, file = dirs[:-1], dirs[-1]
 | 
				
			||||||
        if dirs and not dirs[0]: dirs = dirs[1:]
 | 
					        if dirs and not dirs[0]: dirs = dirs[1:]
 | 
				
			||||||
 | 
					        if dirs and not dirs[0]: dirs[0] = '/'
 | 
				
			||||||
        key = (user, host, port, string.joinfields(dirs, '/'))
 | 
					        key = (user, host, port, string.joinfields(dirs, '/'))
 | 
				
			||||||
        # XXX thread unsafe!
 | 
					        # XXX thread unsafe!
 | 
				
			||||||
        if len(self.ftpcache) > MAXFTPCACHE:
 | 
					        if len(self.ftpcache) > MAXFTPCACHE:
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue