mirror of
				https://github.com/python/cpython.git
				synced 2025-11-04 03:44:55 +00:00 
			
		
		
		
	Milton L. Hankin reports that on Windows it is possible to have two
different values in the environ dict with the same key (although he couldn't explain exactly how this came to be). Since getenv() uses the first one, Python should do too. (Some doubts about case sensitivity, but for now this at least seems the right thing to do regardless of platform.)
This commit is contained in:
		
							parent
							
								
									3427c1f71b
								
							
						
					
					
						commit
						9068da4b6d
					
				
					 1 changed files with 2 additions and 1 deletions
				
			
		| 
						 | 
					@ -300,6 +300,7 @@ convertenviron()
 | 
				
			||||||
		if (v == NULL)
 | 
							if (v == NULL)
 | 
				
			||||||
			continue;
 | 
								continue;
 | 
				
			||||||
		*p = '\0';
 | 
							*p = '\0';
 | 
				
			||||||
 | 
							if (PyDict_GetItemString(d, *e) == NULL)
 | 
				
			||||||
			(void) PyDict_SetItemString(d, *e, v);
 | 
								(void) PyDict_SetItemString(d, *e, v);
 | 
				
			||||||
		*p = '=';
 | 
							*p = '=';
 | 
				
			||||||
		Py_DECREF(v);
 | 
							Py_DECREF(v);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue