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

Unhandled exception can occur when using MDTM against a file modified before year 1900 #90

Closed
giampaolo opened this issue May 28, 2014 · 6 comments
Labels
bug Component-Library imported imported from old googlecode site and very likely outdated Priority-Low

Comments

@giampaolo
Copy link
Owner

From billiej...@gmail.com on November 13, 2008 18:01:58

This most likely will never happen unless someone specifically force the
last modification time of a file in some way (if I remember correctly there
should be a Windows utility which does that).

The test case in attachment shows how to emulate the issue by forcing
os.path.getmtime to return an unexpected value producing the following
traceback message:

test_unforseen_mdtm_event (__main__.TestFtpFsOperations) ... Traceback
(most rec
ent call last):
  File "C:\Python25\lib\asyncore.py", line 68, in read
    obj.handle_read_event()
  File "C:\Python25\lib\asyncore.py", line 390, in handle_read_event
    self.handle_read()
  File "C:\Python25\lib\asynchat.py", line 137, in handle_read
    self.found_terminator()
  File "c:\python25\lib\site-packages\pyftpdlib\ftpserver.py", line 1776,
in fou
nd_terminator
    method(arg)
  File "c:\python25\lib\site-packages\pyftpdlib\ftpserver.py", line 2662,
in ftp
_MDTM
    lmt = time.strftime("%Y%m%d%H%M%S", 
time.localtime(lmt))
ValueError: (22, 'Invalid argument')

Attachment: mdtm.diff

Original issue: http://code.google.com/p/pyftpdlib/issues/detail?id=90

@giampaolo
Copy link
Owner Author

From billiej...@gmail.com on November 13, 2008 09:25:44

Summary: Unhandled exception can occur when using MDTM against a file modified before year 1970

@giampaolo
Copy link
Owner Author

From billiej...@gmail.com on November 13, 2008 09:58:14

Fixed in r436 .

Status: Finished

@giampaolo
Copy link
Owner Author

From billiej...@gmail.com on November 13, 2008 11:14:48

Summary: Unhandled exception can occur when using MDTM against a file modified before year 1900

@giampaolo
Copy link
Owner Author

From billiej...@gmail.com on November 20, 2008 12:56:33

Labels: Milestone-0.5.1

@giampaolo
Copy link
Owner Author

From billiej...@gmail.com on January 21, 2009 10:05:51

Fixed in version 0.5.1 released on 2009-01-21.

Status: Fixed

@giampaolo
Copy link
Owner Author

From billiej...@gmail.com on April 02, 2009 08:53:55

Labels: -OpSys-All

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Component-Library imported imported from old googlecode site and very likely outdated Priority-Low
Projects
None yet
Development

No branches or pull requests

1 participant