Skip to content

Conversation

@dividedmind
Copy link
Contributor

@dividedmind dividedmind commented Jan 26, 2026

Context

Process recordings generate a default filename incorporating a timestamp (e.g., 2023-10-27T10:00:00Z).

Problem

The ISO 8601 timestamp format includes colons (:), which are reserved characters on Windows file systems. This caused an OSError when attempting to save process recordings on Windows machines (issue #377).

Solution

This PR updates the filename generation logic in _appmap/recording.py to replace colons with hyphens in the timestamp string (e.g., 2023-10-27T10-00-00Z). It also changes the format to separate the PID from the timestamp with a dash for consistency, so the filenames are like 2023-10-27T10-00-00Z-31337.appmap.json.

Changes

  • _appmap/recording.py: Added .replace(":", "-") to the appmap_name generation.
  • _appmap/test/test_recording.py: Added a regression test test_process_recording_filename_is_sanitized to ensure generated filenames are valid and free of colons.
  • Changes the timestamp and PID separator in the filename to -.

Validation

  • Verified that new tests pass locally.
  • Confirmed the fix addresses the Windows path compatibility issue.

This commit addresses and resolves several `too-many-positional-arguments`
and `unused-argument` linting errors reported by pylint. The changes
primarily involve adding `too-many-positional-arguments` to existing
`pylint: disable` directives where the function signatures are fixed by
external frameworks (Django, SQLAlchemy) or by internal design
requirements (e.g., `__new__` methods, `HttpServerRequestEvent` init).
Additionally, an `unused-argument` was fixed by renaming a parameter
with a leading underscore to indicate its intentional non-use.

These modifications ensure that the codebase adheres to the pylint
standards without altering the intended functionality or API
compatibility.
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes a Windows compatibility issue where process recordings fail with an OSError because the ISO 8601 timestamp format includes colons, which are invalid in Windows filenames. The fix replaces colons in the timestamp with hyphens.

Changes:

  • Modified _appmap/recording.py to sanitize the timestamp by replacing colons with hyphens
  • Added a regression test to verify generated filenames don't contain colons
  • Updated pylint disable comments across multiple files to include too-many-positional-arguments for compatibility with newer pylint versions

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
_appmap/recording.py Modified process recording filename generation to replace colons with hyphens in timestamps, fixing Windows compatibility
_appmap/test/test_recording.py Added regression test test_process_recording_filename_is_sanitized to ensure filenames don't contain colons
appmap/sqlalchemy.py Added too-many-positional-arguments to pylint disables for callback functions
appmap/pytest.py Changed unused parameter name from item to _item to follow Python conventions
appmap/django.py Added too-many-positional-arguments to pylint disable for database wrapper callback
_appmap/web_framework.py Added too-many-positional-arguments to pylint disables for web framework functions
_appmap/test/test_django.py Added too-many-positional-arguments to pylint disable for test client adaptor
_appmap/test/test_configuration.py Added too-many-positional-arguments to pylint disable for test class
_appmap/importer.py Added too-many-positional-arguments to pylint disable for FilterableFn.__new__
_appmap/event.py Added too-many-positional-arguments to pylint disable for HttpServerRequestEvent.__init__

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Replace colons in ISO 8601 timestamps with hyphens when generating
filenames for process recordings. This prevents OSErrors on Windows
systems where colons are invalid characters in filenames.

Includes a regression test to verify that generated filenames do
not contain colons.

Also changes the format to use a dash to separate the timestamp
from the PID for consistency.

Fixes #377
@dividedmind dividedmind force-pushed the fix/windows-process-recording-names branch from 6196ab1 to ed76d19 Compare January 28, 2026 14:49
@dividedmind dividedmind merged commit eb0379f into master Jan 28, 2026
7 checks passed
@dividedmind dividedmind deleted the fix/windows-process-recording-names branch January 28, 2026 17:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants