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

Cancel save of SWC file triggers a file not found error #13

Open
cudmore opened this issue Jul 14, 2023 · 0 comments
Open

Cancel save of SWC file triggers a file not found error #13

cudmore opened this issue Jul 14, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@cudmore
Copy link
Member

cudmore commented Jul 14, 2023

While this does not cause problems, we should fix it. When user cancels the saving of a swc file, a file not found error is trigger. Should be simple to fix.

Here is the error trace

   INFO _widget.py save_tracing() line:678 - Saving tracing...
2023-07-14 09:56:50.864 napari[3353:32372405] +[CATransaction synchronize] called within transaction
   INFO _widget.py save_tracing() line:687 - Saving file as 
---------------------------------------------------------------------------
FileNotFoundError                         Traceback (most recent call last)
File ~/opt/miniconda3/envs/bright-env/lib/python3.9/site-packages/napari_tracing/_widget.py:692, in TracerWidget.save_tracing(self=<napari_tracing._widget.TracerWidget object>)
    690 segments = self.traced_segments[active_layer_id]
    691 trace_saver = TraceSaver(fileName[0], segments)
--> 692 trace_saver.save_trace()
        trace_saver = <napari_tracing._trace_saver.TraceSaver object at 0x7fc628b6d910>

File ~/opt/miniconda3/envs/bright-env/lib/python3.9/site-packages/napari_tracing/_trace_saver.py:13, in TraceSaver.save_trace(self=<napari_tracing._trace_saver.TraceSaver object>)
     12 def save_trace(self):
---> 13     with open(self.filename, "w") as f:
        self.filename = ''
        self = <napari_tracing._trace_saver.TraceSaver object at 0x7fc628b6d910>
     14         writer = csv.writer(f)
     15         column_headers = ["idx", "x", "y", "z", "prevIdx"]

FileNotFoundError: [Errno 2] No such file or directory: ''
@cudmore cudmore added the bug Something isn't working label Jul 14, 2023
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

1 participant