jborean93 / smbprotocol

Python SMBv2 and v3 Client
MIT License
320 stars 74 forks source link

Datetime overflow #125

Closed jborean93 closed 3 years ago

jborean93 commented 3 years ago

Python has a max datetime value of 9999-12-31T23:59:59.999999Z while FILETIME can go beyond this. We handle the overflow error by setting the datetime field to that max value. This unfortunately means that data can be lost but this is so far into the future I don't really think it's too much of a problem. The alternative is to not use datetime.datetime which has far reaching compatibility issues that it isn't worth looking into.

Fixes https://github.com/jborean93/smbprotocol/issues/114

codecov[bot] commented 3 years ago

Codecov Report

Merging #125 (a7c7f4a) into master (306fdbd) will not change coverage. The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #125   +/-   ##
=======================================
  Coverage   98.90%   98.90%           
=======================================
  Files          23       23           
  Lines        4951     4951           
=======================================
  Hits         4897     4897           
  Misses         54       54           
Impacted Files Coverage Δ
smbprotocol/structure.py 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 306fdbd...a7c7f4a. Read the comment docs.