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

attendance.py fails on Windows #36

Closed
elliot-100 opened this issue Oct 13, 2022 · 3 comments
Closed

attendance.py fails on Windows #36

elliot-100 opened this issue Oct 13, 2022 · 3 comments
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@elliot-100
Copy link
Collaborator

Following on from #27
Run wth no parameters:

C:\Users\Elliot\dev\Spond\venv37\Scripts\python.exe C:\Users\Elliot\dev\Spond\attendance.py 
Traceback (most recent call last):
  File "C:\Users\Elliot\dev\Spond\attendance.py", line 59, in <module>
    loop.run_until_complete(main())
  File "C:\Users\Elliot\AppData\Local\Programs\Python\Python37\lib\asyncio\base_events.py", line 587, in run_until_complete
    return future.result()
  File "C:\Users\Elliot\dev\Spond\attendance.py", line 24, in main
    with open(filename, 'w', newline='') as csvfile:
OSError: [Errno 22] Invalid argument: './exports\\2023-04-11T17:45:00Z-Redacted Redacted.csv'
Unclosed client session
client_session: <aiohttp.client.ClientSession object at 0x000002362A4D7748>
Unclosed connector
connections: ['[(<aiohttp.client_proto.ResponseHandler object at 0x000002362A4F8C18>, 2373424.39)]']
connector: <aiohttp.connector.TCPConnector object at 0x000002362A4D7788>

Process finished with exit code 1

I think the issue is that ":" characters are not valid in Windows filenames.

(What's best practice for timestamps in filenames?
This is only a sample script, and there will be other, potentially invalid characters in event headings...)

@elliot-100 elliot-100 added bug Something isn't working good first issue Good for newcomers labels Oct 13, 2022
@Olen
Copy link
Owner

Olen commented Nov 20, 2022

I usually replace ":" with either "_" or ".".

A simple rule is just to replace anything other than "A-z0-9_.-" with "_".
One could also first replacce ":" wilth "." and then replace everything else with "_".

But you also have stuff like "slugify" which may be another solution
https://github.com/un33k/python-slugify

@elliot-100
Copy link
Collaborator Author

Related: #53

@elliot-100
Copy link
Collaborator Author

I think this is probably fixed by #155, but I have abandoned trying to develop on Windows in any case

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants