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

Prefs dir IOError #168

Open
ImLucasBrown opened this issue Feb 15, 2021 · 1 comment
Open

Prefs dir IOError #168

ImLucasBrown opened this issue Feb 15, 2021 · 1 comment
Labels
bug Something isn't working

Comments

@ImLucasBrown
Copy link
Member

Describe the bug
If the prefs dir is removed while NXT is open, the pref object raises an IOError when it attempts to write a default pref value.

To Reproduce
Steps to reproduce the behavior:

  1. Start NXT
  2. Rename or delete the prefs dir
  3. Attempt to change the state of a pref like Node Tooltips
  4. Exception raised

Expected behavior
Gracefully handle missing pref dir after the app is running

Desktop (please complete the following information):

  • Version Editor v3.7.0

Additional context

Traceback (most recent call last):
  File "nxt_demo_py3\lib\site-packages\nxt_editor\actions.py", line 1336, in toggle_tooltip
    user_dir.user_prefs[pref_key] = tooltip_state
  File "nxt_demo_py3\lib\site-packages\nxt_editor\user_dir.py", line 139, in __setitem__
    self.write()
  File "nxt_demo_py3\lib\site-packages\nxt_editor\user_dir.py", line 167, in write
    with open(self.path, 'w+') as fp:
FileNotFoundError: [Errno 2] No such file or directory: 'C:\\Users\\Lucas\\nxt\\prefs\\3\\prefs.json'
@ImLucasBrown ImLucasBrown added the bug Something isn't working label Feb 15, 2021
@matthew-schiller
Copy link

NXT Maya plugin just has to be initialized for this error to happen.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants