mirror of
				https://github.com/python/cpython.git
				synced 2025-10-31 05:31:20 +00:00 
			
		
		
		
	Issue #13087: BufferedReader.seek() now always raises UnsupportedOperation
if the underlying raw stream is unseekable, even if the seek could be satisfied using the internal buffer. Patch by John O'Connor.
This commit is contained in:
		
							parent
							
								
									94190bb6e7
								
							
						
					
					
						commit
						1e44fecc52
					
				
					 3 changed files with 15 additions and 0 deletions
				
			
		|  | @ -1086,6 +1086,9 @@ buffered_seek(buffered *self, PyObject *args) | |||
| 
 | ||||
|     CHECK_CLOSED(self, "seek of closed file") | ||||
| 
 | ||||
|     if (_PyIOBase_check_seekable(self->raw, Py_True) == NULL) | ||||
|         return NULL; | ||||
| 
 | ||||
|     target = PyNumber_AsOff_t(targetobj, PyExc_ValueError); | ||||
|     if (target == -1 && PyErr_Occurred()) | ||||
|         return NULL; | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Antoine Pitrou
						Antoine Pitrou