mirror of
				https://github.com/python/cpython.git
				synced 2025-11-03 23:21:29 +00:00 
			
		
		
		
	bpo-43564: preserve original exception in args of FTP URLError (#24938)
* bpo-43564: preserve original error in args of FTP URLError * Add NEWS blurb Co-authored-by: Carl Meyer <carljm@instagram.com>
This commit is contained in:
		
							parent
							
								
									fc342c62e0
								
							
						
					
					
						commit
						ad817cd5c4
					
				
					 2 changed files with 4 additions and 1 deletions
				
			
		| 
						 | 
				
			
			@ -1582,7 +1582,7 @@ def ftp_open(self, req):
 | 
			
		|||
            headers = email.message_from_string(headers)
 | 
			
		||||
            return addinfourl(fp, headers, req.full_url)
 | 
			
		||||
        except ftplib.all_errors as exp:
 | 
			
		||||
            raise URLError(f'ftp error: {exp}') from exp
 | 
			
		||||
            raise URLError(exp) from exp
 | 
			
		||||
 | 
			
		||||
    def connect_ftp(self, user, passwd, host, port, dirs, timeout):
 | 
			
		||||
        return ftpwrapper(user, passwd, host, port, dirs, timeout,
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -0,0 +1,3 @@
 | 
			
		|||
Wrap network errors consistently in urllib FTP support, so the test suite
 | 
			
		||||
doesn't fail when a network is available but the public internet is not
 | 
			
		||||
reachable.
 | 
			
		||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue