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

Date format string error on Windows when using --os flag #1495

Closed
umayado17 opened this issue Oct 24, 2024 · 2 comments · Fixed by #1496
Closed

Date format string error on Windows when using --os flag #1495

umayado17 opened this issue Oct 24, 2024 · 2 comments · Fixed by #1496

Comments

@umayado17
Copy link
Contributor

Describe the bug

I encountered an error when running interpreter --os on Windows. The error occurs due to an incompatible date format string.

Environment

  • OS: Windows
  • Python version: 3.11
  • open-interpreter version: 0.4.1

Error Message

ValueError: Invalid format string

Error Location

The error occurs in interpreter\computer_use\loop.py, where the date format string uses %-d which is not supported on Windows.

Current code:

datetime.today().strftime('%A, %B %-d, %Y')

## Solution
Changing %-d to %d fixes the issue. This suggests that the code should handle platform-specific date formatting.

## Suggestion
Consider using one of these approaches to fix this cross-platform issue:

Use %d instead of %-d
Add platform-specific handling for date formatting
Use a cross-platform date formatting library

This would improve the Windows user experience with open-interpreter.

### Reproduce

1. Run `pip install open-interpreter`
2. Run `interpreter --os`
3. The error occurs due to incompatible date format string
4. Error message shows: ValueError: Invalid format string

### Expected behavior

The program should start normally without any date format errors when using the --os flag on Windows.

### Screenshots

![image](https://github.com/user-attachments/assets/4ffc3a11-78e4-48d5-b44b-9b384a54bd36)


### Open Interpreter version

0.4.1

### Python version

3.11

### Operating System name and version

Windows 11

### Additional context

_No response_
@killerapp
Copy link

can confirm, seeing the same error on Win 11 in a pipx install

@jspronk
Copy link

jspronk commented Oct 26, 2024

Same issue with Windows 11.

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 a pull request may close this issue.

3 participants