mirror of
				https://github.com/python/cpython.git
				synced 2025-10-31 21:51:50 +00:00 
			
		
		
		
	Bug #1588217: don't parse "= " as a soft line break in binascii's
a2b_qp() function, instead leave it in the string as quopri.decode() does.
This commit is contained in:
		
							parent
							
								
									540821183b
								
							
						
					
					
						commit
						25aabf4cbb
					
				
					 3 changed files with 6 additions and 3 deletions
				
			
		|  | @ -134,7 +134,7 @@ def test_qp(self): | ||||||
|             pass |             pass | ||||||
|         else: |         else: | ||||||
|             self.fail("binascii.a2b_qp(**{1:1}) didn't raise TypeError") |             self.fail("binascii.a2b_qp(**{1:1}) didn't raise TypeError") | ||||||
|         self.assertEqual(binascii.a2b_qp("= "), "") |         self.assertEqual(binascii.a2b_qp("= "), "= ") | ||||||
|         self.assertEqual(binascii.a2b_qp("=="), "=") |         self.assertEqual(binascii.a2b_qp("=="), "=") | ||||||
|         self.assertEqual(binascii.a2b_qp("=AX"), "=AX") |         self.assertEqual(binascii.a2b_qp("=AX"), "=AX") | ||||||
|         self.assertRaises(TypeError, binascii.b2a_qp, foo="bar") |         self.assertRaises(TypeError, binascii.b2a_qp, foo="bar") | ||||||
|  |  | ||||||
|  | @ -219,6 +219,10 @@ Library | ||||||
| Extension Modules | Extension Modules | ||||||
| ----------------- | ----------------- | ||||||
| 
 | 
 | ||||||
|  | - Bug #1588217: don't parse "= " as a soft line break in binascii's | ||||||
|  |   a2b_qp() function, instead leave it in the string as quopri.decode() | ||||||
|  |   does. | ||||||
|  | 
 | ||||||
| - Bug #1567666: Emulate GetFileAttributesExA for Win95. | - Bug #1567666: Emulate GetFileAttributesExA for Win95. | ||||||
| 
 | 
 | ||||||
| - Patch #1576166: Support os.utime for directories on Windows NT+. | - Patch #1576166: Support os.utime for directories on Windows NT+. | ||||||
|  |  | ||||||
|  | @ -1057,8 +1057,7 @@ binascii_a2b_qp(PyObject *self, PyObject *args, PyObject *kwargs) | ||||||
| 			in++; | 			in++; | ||||||
| 			if (in >= datalen) break; | 			if (in >= datalen) break; | ||||||
| 			/* Soft line breaks */ | 			/* Soft line breaks */ | ||||||
| 			if ((data[in] == '\n') || (data[in] == '\r') || | 			if ((data[in] == '\n') || (data[in] == '\r')) { | ||||||
| 			    (data[in] == ' ') || (data[in] == '\t')) { |  | ||||||
| 				if (data[in] != '\n') { | 				if (data[in] != '\n') { | ||||||
| 					while (in < datalen && data[in] != '\n') in++; | 					while (in < datalen && data[in] != '\n') in++; | ||||||
| 				} | 				} | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Georg Brandl
						Georg Brandl