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

[0.21.4] client.list returns Value Error because date format does not match on Windows #170

Open
looopTools opened this issue Dec 1, 2023 · 1 comment

Comments

@looopTools
Copy link

I get the following error:

ValueError: ('All parsers failed to parse', b'06-07-22  12:55PM               334976 opencv_frame_2.png\r\n', [KeyError('6-'), ValueError("time data '06-07-22 12:55PM' does not match format '%m/%d/%Y %I:%M %p'")])

I can replicate it with this simple test application.

import asyncio
import aioftp
import os 

async def test():
    client = aioftp.Client()
    await client.connect(host='127.0.0.1', port=21)
    await client.login(user=os.environ['ftpusr'], password=os.environ['ftppass'])
    l = await client.list('/')
    print(l)


if __name__ == '__main__':
    asyncio.run(test())

My suspicion is that it is because the parser expect a US date and not a european date?

@pohmelie
Copy link
Collaborator

pohmelie commented Dec 1, 2023

All LIST outputs are for humans, they have no standard and they will be broken somehow all the time. What you can do here:

  • Use your own parse_list_line_custom routine
  • Add code to aioftp windows parser
  • Update your ftp server to support MLSx commands family

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

No branches or pull requests

2 participants