mirror of
				https://github.com/python/cpython.git
				synced 2025-10-30 21:21:22 +00:00 
			
		
		
		
	Fix for Bug #110673: os.abspatth() now always returns os.getcwd() on Windows, if an empty path is specified. It previously did not if an empty path was delegated to win32api.GetFullPathName())
This commit is contained in:
		
							parent
							
								
									0d0b1e93e1
								
							
						
					
					
						commit
						647d2fe145
					
				
					 1 changed files with 7 additions and 4 deletions
				
			
		|  | @ -416,8 +416,11 @@ def _abspath(path): | ||||||
|             return normpath(path) |             return normpath(path) | ||||||
|         abspath = _abspath |         abspath = _abspath | ||||||
|         return _abspath(path) |         return _abspath(path) | ||||||
|  |     if path: # Empty path must return current working directory. | ||||||
|         try: |         try: | ||||||
|             path = win32api.GetFullPathName(path) |             path = win32api.GetFullPathName(path) | ||||||
|         except win32api.error: |         except win32api.error: | ||||||
|             pass # Bad path - return unchanged. |             pass # Bad path - return unchanged. | ||||||
|  |     else: | ||||||
|  |         path = os.getcwd() | ||||||
|     return normpath(path) |     return normpath(path) | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Mark Hammond
						Mark Hammond