aioftp icon indicating copy to clipboard operation
aioftp copied to clipboard

add new datetime parsing format for client to support windows FTP server list output

Open fti-akumari opened this issue 1 year ago • 3 comments

Description:-

This PR enhances the parse_list_line_windows method to support multiple date/time formats when parsing Microsoft Windows dir command output. Previously, only one specific date/time format was supported. The following improvements were made:

Changes:

  • Added support for two date/time formats: "%m/%d/%Y %I:%M %p" (e.g., 12/18/2024 04:40 PM) "%m-%d-%y %I:%M%p" (e.g., 12-18-24 04:40PM)

  • Introduced a loop to try each format and parse the date/time correctly.

  • Raised a ValueError if none of the formats match, ensuring robust error handling.

Why: Windows FTP servers may use different date/time formats depending on system configurations and locale settings. Supporting multiple formats improves compatibility and reduces parsing failures.

image (9)

fti-akumari avatar Dec 19 '24 11:12 fti-akumari

Codecov Report

Attention: Patch coverage is 70.00000% with 3 lines in your changes missing coverage. Please review.

Project coverage is 98.68%. Comparing base (8c774d8) to head (48ed29d).

Files with missing lines Patch % Lines
src/aioftp/client.py 70.00% 3 Missing :warning:
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #181      +/-   ##
==========================================
- Coverage   98.83%   98.68%   -0.16%     
==========================================
  Files           6        6              
  Lines        1896     1904       +8     
==========================================
+ Hits         1874     1879       +5     
- Misses         22       25       +3     

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov[bot] avatar Dec 20 '24 10:12 codecov[bot]

Sorry for the late response. I have addressed all the comments and made the necessary updates.

fti-akumari avatar Dec 26 '24 08:12 fti-akumari

lint check fails, fix your code according linters, use pre-commit run -a before commit your code

pohmelie avatar Dec 26 '24 12:12 pohmelie