reproduce-14067_1.py 510 B

123456789101112
  1. def execute_code(loop, timeout=None):
  2. with BytesIO() as file_stream:
  3. service_principal = DefaultAzureCredential(exclude_cli_credential=True)
  4. future = asyncio.run_coroutine_threadsafe(
  5. download_blob_using_blobclient(account_name,service_principal, container_name, blob_to_read, file_stream),
  6. loop=loop)
  7. future.result(timeout)
  8. file_stream.flush()
  9. file_stream.seek(0)
  10. bw=TextIOWrapper(file_stream).read()
  11. print(bw)
  12. return