mirror of
				https://github.com/LonamiWebs/Telethon.git
				synced 2025-10-28 06:31:13 +03:00 
			
		
		
		
	Fix seeking on strings from c0828f5 when uploading files
				
					
				
			This commit is contained in:
		
							parent
							
								
									68291c7b3d
								
							
						
					
					
						commit
						2fb560624d
					
				|  | @ -39,10 +39,11 @@ def _resize_photo_if_needed( | |||
|             or (isinstance(file, io.IOBase) and not file.seekable())): | ||||
|         return file | ||||
| 
 | ||||
|     before = file.tell() if isinstance(file, io.IOBase) else 0 | ||||
|     if isinstance(file, bytes): | ||||
|         file = io.BytesIO(file) | ||||
| 
 | ||||
|     before = file.tell() if isinstance(file, io.IOBase) else None | ||||
| 
 | ||||
|     try: | ||||
|         # Don't use a `with` block for `image`, or `file` would be closed. | ||||
|         # See https://github.com/LonamiWebs/Telethon/issues/1121 for more. | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue
	
	Block a user