Title: Bug: `OSError` on Windows due to Invalid Filename Characters in ISO 8601 Timestamps · Issue #377 · getappmap/appmap-python · GitHub
Open Graph Title: Bug: `OSError` on Windows due to Invalid Filename Characters in ISO 8601 Timestamps · Issue #377 · getappmap/appmap-python
X Title: Bug: `OSError` on Windows due to Invalid Filename Characters in ISO 8601 Timestamps · Issue #377 · getappmap/appmap-python
Description: When using AppMap for Python on Windows, an OSError occurs during the file-renaming process. This is because the ISO 8601 formatted timestamp, which includes colons (:), is directly used in the AppMap filename. The colon character is for...
Open Graph Description: When using AppMap for Python on Windows, an OSError occurs during the file-renaming process. This is because the ISO 8601 formatted timestamp, which includes colons (:), is directly used in the App...
X Description: When using AppMap for Python on Windows, an OSError occurs during the file-renaming process. This is because the ISO 8601 formatted timestamp, which includes colons (:), is directly used in the App...
Opengraph URL: https://github.com/getappmap/appmap-python/issues/377
X: @github
Domain: github.com
IPv4 address: 140.82.112.4
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Bug: `OSError` on Windows due to Invalid Filename Characters in ISO 8601 Timestamps","articleBody":"When using **AppMap for Python on Windows**, an `OSError` occurs during the file-renaming process. This is because the **ISO 8601 formatted timestamp**, which includes colons (`:`), is directly used in the AppMap filename. The colon character is forbidden in Windows filenames, causing the operation to fail.\n\n-----\n\n### **Reproduction**\n\nThe issue can be reproduced by running the `appmap-python` command on Windows. The specific paths and filenames will vary, but the error remains the same.\n\n```\nappmap-python --record process C:\\path\\to\\your\\project\\.venv\\Scripts\\python.exe C:\\path\\to\\your\\project\\main.py\n```\n\nThe command fails with the following traceback:\n\n```\nOSError: [WinError 123] The filename, directory name, or volume label syntax is incorrect: 'C:\\\\path\\\\to\\\\your\\\\project\\\\tmp\\\\appmap\\\\process\\\\tmp_some_string' -> 'C:\\\\path\\\\to\\\\your\\\\project\\\\tmp\\\\appmap\\\\process\\\\2024-01-20T10:30:00Z_12345.appmap.json'\n```\n\n-----\n\n### **Cause**\n\nThe problem lies on **line 120** of `recording.py`, where the `appmap_name` variable is constructed using an `iso_time` string. The standard ISO 8601 format includes a colon (`:`) to separate hours, minutes, and seconds (e.g., `10:30:00Z`), which is not a valid character for filenames in the Windows file system.\n\nThe code snippet from `recording.py` is:\n\n```python\nappmap_name = f\"{iso_time}_{process_id}\"\n```\n\n-----\n\n### **Suggested Fix**\n\nTo fix this, the **ISO 8601 timestamp must be sanitized** to remove or replace the colons before being used in the filename. A simple solution would be to use the `.replace()` method as a temporary workaround:\n\n```python\n# Before\nappmap_name = f\"{iso_time}_{process_id}\"\n\n# After (Proposed Fix)\nappmap_name = f\"{iso_time.replace(':', '')}_{process_id}\"\n```","author":{"url":"https://github.com/dividedmind","@type":"Person","name":"dividedmind"},"datePublished":"2025-09-12T14:44:29Z","url":"https://github.com/getappmap/appmap-python/issues/377"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:b30be6f3-14e1-d24f-8f50-b156503d15d0 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | B9C2:7189C:24A3AEA:30A3348:6B032C67 |
| html-safe-nonce | ab56c35438d0a198dacfde0c3b8a4d62a19c103729d5bf5837f3061c3b7c2af3 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCOUMyOjcxODlDOjI0QTNBRUE6MzBBMzM0ODo2QjAzMkM2NyIsInZpc2l0b3JfaWQiOiI0NDc5ODYzMjI2MTE2NTQ5NzM1IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | c69b01646af3e23e16680d13a9a9bec99b4fb7e92757286f6b4cb373cb429cdb |
| hovercard-subject-tag | issue:3410788070 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/getappmap/appmap-python/377/issue_layout |
| twitter:image | https://opengraph.githubassets.com/e4d333b11841e7e832943661dc8afae6912cda986ba14988286d2997a5ec5a84/getappmap/appmap-python/issues/377 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/e4d333b11841e7e832943661dc8afae6912cda986ba14988286d2997a5ec5a84/getappmap/appmap-python/issues/377 |
| og:image:alt | When using AppMap for Python on Windows, an OSError occurs during the file-renaming process. This is because the ISO 8601 formatted timestamp, which includes colons (:), is directly used in the App... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | dividedmind |
| hostname | github.com |
| expected-hostname | github.com |
| None | 87e774ee7c6b3bee0490394e4d3e57ec9dbc956f74b87ea685dc8996c1676456 |
| turbo-cache-control | no-preview |
| go-import | github.com/getappmap/appmap-python git https://github.com/getappmap/appmap-python.git |
| octolytics-dimension-user_id | 46610017 |
| octolytics-dimension-user_login | getappmap |
| octolytics-dimension-repository_id | 314785884 |
| octolytics-dimension-repository_nwo | getappmap/appmap-python |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 314785884 |
| octolytics-dimension-repository_network_root_nwo | getappmap/appmap-python |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 423dbb54c5e7bfecc838eb387c1435eb3d0e760d |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width