mirror of
				https://github.com/python/cpython.git
				synced 2025-10-31 05:31:20 +00:00 
			
		
		
		
	Fix issue 1300: Quote command line arguments that contain a '|' character in
subprocess.list2cmdline (windows).
This commit is contained in:
		
							parent
							
								
									92ffc634e4
								
							
						
					
					
						commit
						70eb2f91b4
					
				
					 2 changed files with 5 additions and 3 deletions
				
			
		|  | @ -471,8 +471,8 @@ def list2cmdline(seq): | |||
| 
 | ||||
|     2) A string surrounded by double quotation marks is | ||||
|        interpreted as a single argument, regardless of white space | ||||
|        contained within.  A quoted string can be embedded in an | ||||
|        argument. | ||||
|        or pipe characters contained within.  A quoted string can be | ||||
|        embedded in an argument. | ||||
| 
 | ||||
|     3) A double quotation mark preceded by a backslash is | ||||
|        interpreted as a literal double quotation mark. | ||||
|  | @ -498,7 +498,7 @@ def list2cmdline(seq): | |||
|         if result: | ||||
|             result.append(' ') | ||||
| 
 | ||||
|         needquote = (" " in arg) or ("\t" in arg) or not arg | ||||
|         needquote = (" " in arg) or ("\t" in arg) or ("|" in arg) or not arg | ||||
|         if needquote: | ||||
|             result.append('"') | ||||
| 
 | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Gregory P. Smith
						Gregory P. Smith