[GH-ISSUE #543] Ugly stacktrace when the target directory for the cast doesn't exist #912

Closed
opened 2026-03-15 10:56:48 +03:00 by kerem · 1 comment
Owner

Originally created by @PawelLipski on GitHub (Apr 1, 2023).
Original GitHub issue: https://github.com/asciinema/asciinema/issues/543

$ asciinema rec foo/bar/qux
asciinema: recording asciicast to foo/bar/qux
asciinema: press <ctrl-d> or type "exit" when you're done
bash-5.2$ Process Process-2:
                            Traceback (most recent call last):
                                                                File "/usr/local/Cellar/python@3.11/3.11.2_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/multiprocessing/process.py", line 314, in _bootstrap
                                                                                                                                                                                                                              self.run()
                                                                                                                                                                                                                                          File "/usr/local/Cellar/python@3.11/3.11.2_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/multiprocessing/process.py", line 108, in run
                                                                                                                                   self._target(*self._args, **self._kwargs)
                                                                                                                                                                              File "/usr/local/Cellar/asciinema/2.2.0/libexec/lib/python3.11/site-packages/asciinema/recorder.py", line 141, in run
                                         with self.writer as w:
                                                                 File "/usr/local/Cellar/asciinema/2.2.0/libexec/lib/python3.11/site-packages/asciinema/asciicast/v2.py", line 126, in __enter__
                                                                                                                                                                                                    self._open_file()
                                                                                                                                                                                                                       File "/usr/local/Cellar/asciinema/2.2.0/libexec/lib/python3.11/site-packages/asciinema/asciicast/v2.py", line 156, in _open_file
                                                                                             self.file = open(
                                                                                                                              ^^^^^
                                                                                                                                   FileNotFoundError: [Errno 2] No such file or directory: 'foo/bar/qux'
                                                                                                                                                                                                        Traceback (most recent call last):
  File "/usr/local/bin/asciinema", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/usr/local/Cellar/asciinema/2.2.0/libexec/lib/python3.11/site-packages/asciinema/__main__.py", line 215, in main
    code = command.execute()
           ^^^^^^^^^^^^^^^^^
  File "/usr/local/Cellar/asciinema/2.2.0/libexec/lib/python3.11/site-packages/asciinema/commands/record.py", line 106, in execute
    recorder.record(
  File "/usr/local/Cellar/asciinema/2.2.0/libexec/lib/python3.11/site-packages/asciinema/recorder.py", line 61, in record
    with async_writer(sync_writer, time_offset, record_stdin) as _writer:
  File "/usr/local/Cellar/asciinema/2.2.0/libexec/lib/python3.11/site-packages/asciinema/async_worker.py", line 35, in __exit__
    raise RuntimeError(
RuntimeError: worker process exited with code 1
Originally created by @PawelLipski on GitHub (Apr 1, 2023). Original GitHub issue: https://github.com/asciinema/asciinema/issues/543 ``` $ asciinema rec foo/bar/qux asciinema: recording asciicast to foo/bar/qux asciinema: press <ctrl-d> or type "exit" when you're done bash-5.2$ Process Process-2: Traceback (most recent call last): File "/usr/local/Cellar/python@3.11/3.11.2_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/multiprocessing/process.py", line 314, in _bootstrap self.run() File "/usr/local/Cellar/python@3.11/3.11.2_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/multiprocessing/process.py", line 108, in run self._target(*self._args, **self._kwargs) File "/usr/local/Cellar/asciinema/2.2.0/libexec/lib/python3.11/site-packages/asciinema/recorder.py", line 141, in run with self.writer as w: File "/usr/local/Cellar/asciinema/2.2.0/libexec/lib/python3.11/site-packages/asciinema/asciicast/v2.py", line 126, in __enter__ self._open_file() File "/usr/local/Cellar/asciinema/2.2.0/libexec/lib/python3.11/site-packages/asciinema/asciicast/v2.py", line 156, in _open_file self.file = open( ^^^^^ FileNotFoundError: [Errno 2] No such file or directory: 'foo/bar/qux' Traceback (most recent call last): File "/usr/local/bin/asciinema", line 8, in <module> sys.exit(main()) ^^^^^^ File "/usr/local/Cellar/asciinema/2.2.0/libexec/lib/python3.11/site-packages/asciinema/__main__.py", line 215, in main code = command.execute() ^^^^^^^^^^^^^^^^^ File "/usr/local/Cellar/asciinema/2.2.0/libexec/lib/python3.11/site-packages/asciinema/commands/record.py", line 106, in execute recorder.record( File "/usr/local/Cellar/asciinema/2.2.0/libexec/lib/python3.11/site-packages/asciinema/recorder.py", line 61, in record with async_writer(sync_writer, time_offset, record_stdin) as _writer: File "/usr/local/Cellar/asciinema/2.2.0/libexec/lib/python3.11/site-packages/asciinema/async_worker.py", line 35, in __exit__ raise RuntimeError( RuntimeError: worker process exited with code 1 ```
kerem closed this issue 2026-03-15 10:56:53 +03:00
Author
Owner

@ku1ik commented on GitHub (Apr 1, 2023):

Yeah, those are ugly indeed :)

<!-- gh-comment-id:1493069480 --> @ku1ik commented on GitHub (Apr 1, 2023): Yeah, those are ugly indeed :)
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/asciinema#912
No description provided.