2

The function I use accepts only one path parameter. But the file data is in memory. It's too slow to open it after save. Is there any way to wrap bytesio into a path then i can pass it to the function?

simpia
  • 65
  • 7
  • Use `m.decode('utf-8')` – mousetail Jul 18 '22 at 09:50
  • if the function accepts file handle as input then you can pass the `io.bytes` object to it directly, otherwise your only option is to modify whatever function you are calling to accept a file handle, instead of a path – Ahmed AEK Jul 18 '22 at 09:56
  • try passing a file handle with `'rb'` instead of the file path to your function, if it accepts it then you can pass the `io.bytes` object instead. – Ahmed AEK Jul 18 '22 at 10:27

0 Answers0