mirror of
				https://github.com/python/cpython.git
				synced 2025-10-31 13:41:24 +00:00 
			
		
		
		
	Issue #16181: cookiejar.http2time() now returns None if year is higher than datetime.MAXYEAR
This commit is contained in:
		
							parent
							
								
									f2b9a39813
								
							
						
					
					
						commit
						20be53e5b5
					
				
					 3 changed files with 11 additions and 1 deletions
				
			
		|  | @ -143,6 +143,10 @@ def offset_from_tz_string(tz): | |||
|     return offset | ||||
| 
 | ||||
| def _str2time(day, mon, yr, hr, min, sec, tz): | ||||
|     yr = int(yr) | ||||
|     if yr > datetime.MAXYEAR: | ||||
|         return None | ||||
| 
 | ||||
|     # translate month name to number | ||||
|     # month numbers start with 1 (January) | ||||
|     try: | ||||
|  | @ -163,7 +167,6 @@ def _str2time(day, mon, yr, hr, min, sec, tz): | |||
|     if min is None: min = 0 | ||||
|     if sec is None: sec = 0 | ||||
| 
 | ||||
|     yr = int(yr) | ||||
|     day = int(day) | ||||
|     hr = int(hr) | ||||
|     min = int(min) | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Berker Peksag
						Berker Peksag