add new datetime parsing format for client to support windows FTP server list output#181
Open
ghost wants to merge 5 commits intoaio-libs:masterfrom
Open
add new datetime parsing format for client to support windows FTP server list output#181ghost wants to merge 5 commits intoaio-libs:masterfrom
ghost wants to merge 5 commits intoaio-libs:masterfrom
Conversation
pohmelie
requested changes
Dec 20, 2024
Codecov ReportAttention: Patch coverage is
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 ☔ View full report in Codecov by Sentry. |
Author
|
Sorry for the late response. I have addressed all the comments and made the necessary updates. |
pohmelie
requested changes
Dec 26, 2024
pohmelie
reviewed
Dec 26, 2024
pohmelie
reviewed
Dec 26, 2024
Collaborator
|
lint check fails, fix your code according linters, use |
pohmelie
reviewed
Dec 26, 2024
| filename = line[next_space:].lstrip() | ||
| if filename == "." or filename == "..": | ||
| raise ValueError | ||
|
|
Collaborator
There was a problem hiding this comment.
Why we need this additional empty line here?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.