mirror of
				https://github.com/python/cpython.git
				synced 2025-10-31 13:41:24 +00:00 
			
		
		
		
	GH-130608: Remove dirs_exist_ok argument from pathlib.Path.copy() (#130610)
				
					
				
			This feature isn't sufficiently motivated.
This commit is contained in:
		
							parent
							
								
									fdcbc29f26
								
							
						
					
					
						commit
						b545450961
					
				
					 6 changed files with 13 additions and 40 deletions
				
			
		|  | @ -340,19 +340,18 @@ def readlink(self): | |||
|         """ | ||||
|         raise NotImplementedError | ||||
| 
 | ||||
|     def copy(self, target, follow_symlinks=True, dirs_exist_ok=False, | ||||
|              preserve_metadata=False): | ||||
|     def copy(self, target, follow_symlinks=True, preserve_metadata=False): | ||||
|         """ | ||||
|         Recursively copy this file or directory tree to the given destination. | ||||
|         """ | ||||
|         if not hasattr(target, 'with_segments'): | ||||
|             target = self.with_segments(target) | ||||
|         ensure_distinct_paths(self, target) | ||||
|         copy_file(self, target, follow_symlinks, dirs_exist_ok, preserve_metadata) | ||||
|         copy_file(self, target, follow_symlinks, preserve_metadata) | ||||
|         return target.joinpath()  # Empty join to ensure fresh metadata. | ||||
| 
 | ||||
|     def copy_into(self, target_dir, *, follow_symlinks=True, | ||||
|                   dirs_exist_ok=False, preserve_metadata=False): | ||||
|                   preserve_metadata=False): | ||||
|         """ | ||||
|         Copy this file or directory tree into the given existing directory. | ||||
|         """ | ||||
|  | @ -364,7 +363,6 @@ def copy_into(self, target_dir, *, follow_symlinks=True, | |||
|         else: | ||||
|             target = self.with_segments(target_dir, name) | ||||
|         return self.copy(target, follow_symlinks=follow_symlinks, | ||||
|                          dirs_exist_ok=dirs_exist_ok, | ||||
|                          preserve_metadata=preserve_metadata) | ||||
| 
 | ||||
| 
 | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Barney Gale
						Barney Gale