Skip to content

Conversation

@ddc
Copy link
Owner

@ddc ddc commented Jul 24, 2025

Summary

Checklist

  • If code changes were made, then they have been tested.
    • I have updated the documentation to reflect the changes.
  • I have thought about how this code may affect other services.
  • This PR fixes an issue.
  • This PR add/remove/change unit tests.
  • This PR adds something new (e.g. new method or parameters).
  • This PR is a breaking change (e.g. methods or parameters removed/renamed)
  • This PR is not a code change (e.g. documentation, README, ...)

Reviewer

  • I understand that approving this code, I am also responsible for it going into the codebase.

@ddc ddc self-assigned this Jul 24, 2025
@codecov
Copy link

codecov bot commented Jul 24, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

✅ All tests successful. No failed tests found.

Files with missing lines Coverage Δ
pythonLogs/log_utils.py 99.48% <100.00%> (+5.30%) ⬆️
pythonLogs/memory_utils.py 97.50% <100.00%> (ø)

ddc and others added 12 commits July 24, 2025 20:15
- Fix macOS failures by using temporary directories instead of hardcoded paths like /non-existent-directory
- Fix Windows failures by checking if zoneinfo/UTC is available before running timezone tests
- Use proper permission testing with temporary directories and cleanup
- Add test utility functions to handle zoneinfo availability checks
- Use @requires_zoneinfo_utc decorator for tests that specifically need UTC
- Fall back to safe timezone (localtime) for tests that just need any timezone
- Skip tests gracefully when zoneinfo/UTC data is not available on Windows

This addresses the ZoneInfoNotFoundError: 'No time zone found with key UTC'
errors on Windows systems without proper timezone data installed.
- Fix relative import issues by using absolute path calculations
- Properly add both project root and tests directory to sys.path
- This resolves 'ImportError: attempted relative import with no known parent package' errors
Core library changes:
- Add fallback to localtime in _get_timezone_offset() when requested timezone is missing
- Add fallback to localtime in get_timezone_function() when UTC or other timezones are missing
- Add fallback to local timezone in _get_stderr_timezone() when timezone data is unavailable

Test updates:
- Update timezone error handling tests to expect graceful fallbacks instead of exceptions
- Tests now verify that invalid timezones fall back to localtime instead of crashing
- This makes the system more robust on Windows systems without complete timezone data

This addresses the widespread 'ZoneInfoNotFoundError: No time zone found with key UTC'
errors on Windows systems by gracefully falling back to localtime when timezone data
is missing, while maintaining full functionality on systems with complete timezone data.
Update timezone-related tests to accommodate fallback behavior where UTC
falls back to localtime on systems without full timezone data (common on
Windows). Tests now verify format structure rather than expecting specific
timezone offsets, making them more robust across different platforms.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
@sonarqubecloud
Copy link

@ddc ddc closed this Jul 25, 2025
@ddc ddc deleted the v5.0.1 branch July 25, 2025 12:21
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