Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sentry_sdk raise FileNotFoundError:No such file or directory: 'nul' #2334

Closed
asgter opened this issue Aug 31, 2023 · 1 comment · Fixed by #2579
Closed

sentry_sdk raise FileNotFoundError:No such file or directory: 'nul' #2334

asgter opened this issue Aug 31, 2023 · 1 comment · Fixed by #2579
Assignees
Labels
Type: Bug Something isn't working

Comments

@asgter
Copy link

asgter commented Aug 31, 2023

How do you use Sentry?

Self-hosted/on-premise

Version

1.6.0

Steps to Reproduce

Operate System: Window 7

File"C:\Users\Administrator\AppData\local\python\lib\site-packages\setry_sdk\hub.py", line 105, in _init
client = Client(*args,**kwargs) # type: ignore
File"C:\Users\Administrator\AppData\local\python\lib\site-packages\setry_sdk\client.py",line 88, in init
self.options = get_options(*args,**kwargs) # type: Dict[str,Any]
File"C:\Users\Administrator\AppData\local\python\lib\site-packages\setry_sdk\client.py", line 68, in get_options
rv["release'] = get_default_release()
File"C:\Users\Administrator\AppData\local\python\lib\site-packages\setry_sdk\utils.py" line 65, in get_default_release
with open(os.path.devnull, "w+") as null:
FileNotFoundError: [Errno 2] No such file or directory: 'nul'

Expected Result

not raise error

Actual Result

raise Error

@sentrivana
Copy link
Contributor

sentrivana commented Aug 31, 2023

Hey @asgter, thanks for raising this. You seem to be on an SDK version that's more than a year old -- could you please try upgrading to 1.30.0?

For what it's worth I believe you'll still get the issue though. The code that's throwing the error is still part of the utils.py module. It's apparently trying to access the Windows equivalent of /dev/null called nul and failing. Maybe this is a Win 7 thing?

To work around it you could set the SENTRY_RELEASE environment variable explicitly yourself, then it shouldn't follow that codepath.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Something isn't working
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants