Log warning if null byte is detected in size field

This commit is contained in:
Lance Edgar 2020-04-01 00:03:00 -05:00
parent c5b1cf01af
commit 16c80082ad

View file

@ -220,7 +220,9 @@ class InventoryItemImporter(FromCore, catapult_importing.model.InventoryItemImpo
# TODO: this logic may actually be client-specific? i just happened to
# find some of these chars in a client DB and needed to avoid them, b/c
# the openpyxl lib said IllegalCharacterError
if size is not None:
if size is not None and '\x00' in size:
log.warning("product %s has null byte in size field: %s",
product.upc, product)
size = size.replace('\x00', '')
price_divider = None