Open yotam201410 opened 5 months ago
Thanks for reporting, I will take a look to this issue. Can you provide the entire error trace? Also I need more info about your operating system.
INFO: Started server process [21668]
INFO: Waiting for application startup.
INFO: Application startup complete.
INFO: Uvicorn running on http://127.0.0.1:8080 (Press CTRL+C to quit)
ERROR: Exception in ASGI application
Traceback (most recent call last):
File "C:\Users\yotam\AppData\Local\Programs\Python\Python310\lib\site-packages\uvicorn\protocols\http\httptools_impl.py", line 399, in run_asgi
result = await app( # type: ignore[func-returns-value]
File "C:\Users\yotam\AppData\Local\Programs\Python\Python310\lib\site-packages\uvicorn\middleware\proxy_headers.py", line 70, in __call__
return await self.app(scope, receive, send)
File "C:\Users\yotam\AppData\Local\Programs\Python\Python310\lib\site-packages\fastapi\applications.py", line 1054, in __call__
await super().__call__(scope, receive, send)
File "C:\Users\yotam\AppData\Local\Programs\Python\Python310\lib\site-packages\starlette\applications.py", line 123, in __call__
await self.middleware_stack(scope, receive, send)
File "C:\Users\yotam\AppData\Local\Programs\Python\Python310\lib\site-packages\starlette\middleware\errors.py", line 186, in __call__
raise exc
File "C:\Users\yotam\AppData\Local\Programs\Python\Python310\lib\site-packages\starlette\middleware\errors.py", line 164, in __call__
await self.app(scope, receive, _send)
File "C:\Users\yotam\AppData\Local\Programs\Python\Python310\lib\site-packages\profyle\infrastructure\middleware\fastapi.py", line 37, in __call__
with profyle(
File "C:\Users\yotam\AppData\Local\Programs\Python\Python310\lib\site-packages\profyle\application\profyle.py", line 46, in __exit__
self.tracer.save(temp_file.name)
File "C:\Users\yotam\AppData\Local\Programs\Python\Python310\lib\site-packages\viztracer\viztracer.py", line 235, in save
rb.save(output_file=output_file, file_info=file_info)
File "C:\Users\yotam\AppData\Local\Programs\Python\Python310\lib\site-packages\viztracer\report_builder.py", line 186, in save
with open(output_file, "w", encoding="utf-8") as f:
PermissionError: [Errno 13] Permission denied: 'C:\\Users\\yotam\\AppData\\Local\\Temp\\tmp8i7s87zd.json'
This is due to windows permissions, simply setting delete=False
on the NamedTemporaryFile fixes it:
https://github.com/vpcarlos/profyle/blob/main/profyle/application/profyle.py#L45
Relevant info: https://stackoverflow.com/questions/15588314/cant-access-temporary-files-created-with-tempfile
the example doesnt seem to work
i get the error mentioned in the title. your library seems really cool and i would really like to use it