mirror of
				https://github.com/python/cpython.git
				synced 2025-10-31 13:41:24 +00:00 
			
		
		
		
	Add another try/except PermissionError to avoid depending on listdir order. Fix issues #24120 and #26012. (Merge 3.4->3.5)
This commit is contained in:
		
						commit
						c3a8272705
					
				
					 2 changed files with 16 additions and 13 deletions
				
			
		|  | @ -1236,7 +1236,7 @@ class _BasePathTest(object): | |||
|     #  |   |-- dirD | ||||
|     #  |   |   `-- fileD | ||||
|     #  |   `-- fileC | ||||
|     #  |-- dirE | ||||
|     #  |-- dirE  # No permissions | ||||
|     #  |-- fileA | ||||
|     #  |-- linkA -> fileA | ||||
|     #  `-- linkB -> dirB | ||||
|  | @ -1453,13 +1453,13 @@ def _check(glob, expected): | |||
|         p = P(BASE) | ||||
|         it = p.rglob("fileA") | ||||
|         self.assertIsInstance(it, collections.Iterator) | ||||
|         # XXX cannot test because of symlink loops in the test setup | ||||
|         #_check(it, ["fileA"]) | ||||
|         #_check(p.rglob("fileB"), ["dirB/fileB"]) | ||||
|         #_check(p.rglob("*/fileA"), [""]) | ||||
|         #_check(p.rglob("*/fileB"), ["dirB/fileB"]) | ||||
|         #_check(p.rglob("file*"), ["fileA", "dirB/fileB"]) | ||||
|         # No symlink loops here | ||||
|         _check(it, ["fileA"]) | ||||
|         _check(p.rglob("fileB"), ["dirB/fileB"]) | ||||
|         _check(p.rglob("*/fileA"), []) | ||||
|         _check(p.rglob("*/fileB"), ["dirB/fileB", "dirB/linkD/fileB", | ||||
|                                     "linkB/fileB", "dirA/linkC/fileB"]) | ||||
|         _check(p.rglob("file*"), ["fileA", "dirB/fileB", | ||||
|                                   "dirC/fileC", "dirC/dirD/fileD"]) | ||||
|         p = P(BASE, "dirC") | ||||
|         _check(p.rglob("file*"), ["dirC/fileC", "dirC/dirD/fileD"]) | ||||
|         _check(p.rglob("*/*"), ["dirC/dirD/fileD"]) | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Guido van Rossum
						Guido van Rossum