Skip to content

Commit

Permalink
Fix ValueError on NULL time fields
Browse files Browse the repository at this point in the history
  • Loading branch information
mherrmann committed Mar 16, 2020
1 parent 12e657b commit ccd3888
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pypxlib/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
PX_boot()
atexit.register(PX_shutdown)

_NULL_IN_PARADOX = -2147483648

class Table(object):

PX_ENCODING = 'ascii'
Expand Down Expand Up @@ -219,6 +221,8 @@ def _deserialize(cls, pxval_value):
return cls._deserialize_ms(pxval_value.lval)
@classmethod
def _deserialize_ms(cls, ms_since_midnight):
if ms_since_midnight == _NULL_IN_PARADOX:
return None
ms = ms_since_midnight % 1000
seconds_since_midnight = ms_since_midnight // 1000
seconds = seconds_since_midnight % 60
Expand Down

1 comment on commit ccd3888

@Das332021
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi ,
I got this error and i don't understand where is the problem can someone help me please:
pypxlib.PXError: Could not retrieve row 16 of file C:......\ .. .db.
Number of records counted in blocks does not match number of records in header (16 != 17)
PXLib: Could not find record in database.
PXLib: Could not read data for record with number 16.

Please sign in to comment.