Skip to content

Saving file in Libre Office causes XLDateAmbiguous error #5

@joeflack4

Description

@joeflack4

Description

Opening an .xlsx file in Libre Office and then saving it appears to cause changes for some date cells, or how some cells are interpreted as dates. Changing the offending cells to plain text resolves the issue. No other issues were found when using Libre Office.

$ python2 -m qtools2.convert UGR6-FS-Female-Questionnaire-v5-jef.xlsx UGR6-FS-Household-Questionnaire-v5-jef.xlsx -r 
Traceback (most recent call last):                                                                                   
  File "C:\Program Files\Python27\lib\site-packages\qtools2\convert.py", line 130, in xlsform_offline                
    warnings = xlsform.xlsform_convert(validate=validate)                                                            
  File "C:\Program Files\Python27\lib\site-packages\qtools2\xlsform.py", line 108, in xlsform_convert                
    msg = xls2xform_convert(self.path, self.outpath, validate=validate)                                              
  File "C:\Program Files\Python27\lib\site-packages\pmaxform\xls2xform.py", line 17, in xls2xform_convert            
    json_survey = xls2json.parse_file_to_json(xlsform_path, warnings=warnings)                                       
  File "C:\Program Files\Python27\lib\site-packages\pmaxform\xls2json.py", line 955, in parse_file_to_json           
    workbook_dict = parse_file_to_workbook_dict(path, file_object)                                                   
  File "C:\Program Files\Python27\lib\site-packages\pmaxform\xls2json.py", line 936, in parse_file_to_workbook_dict  
    return xls_to_dict(file_object if file_object is not None else path)                                             
  File "C:\Program Files\Python27\lib\site-packages\pmaxform\xls2json_backends.py", line 311, in xls_to_dict         
    xls_to_dict_normal_sheet(sheet)                                                                                  
  File "C:\Program Files\Python27\lib\site-packages\pmaxform\xls2json_backends.py", line 116, in xls_to_dict_normal_s
heet                                                                                                                 
    raise err                                                                                                        
XLDateAmbiguous: 12.0                                                                                                
Traceback (most recent call last):                                                                                   
  File "C:\Program Files\Python27\lib\site-packages\qtools2\convert.py", line 130, in xlsform_offline                
    warnings = xlsform.xlsform_convert(validate=validate)                                                            
  File "C:\Program Files\Python27\lib\site-packages\qtools2\xlsform.py", line 108, in xlsform_convert                
    msg = xls2xform_convert(self.path, self.outpath, validate=validate)                                              
  File "C:\Program Files\Python27\lib\site-packages\pmaxform\xls2xform.py", line 17, in xls2xform_convert            
    json_survey = xls2json.parse_file_to_json(xlsform_path, warnings=warnings)                                       
  File "C:\Program Files\Python27\lib\site-packages\pmaxform\xls2json.py", line 955, in parse_file_to_json           
    workbook_dict = parse_file_to_workbook_dict(path, file_object)                                                   
  File "C:\Program Files\Python27\lib\site-packages\pmaxform\xls2json.py", line 936, in parse_file_to_workbook_dict  
    return xls_to_dict(file_object if file_object is not None else path)                                             
  File "C:\Program Files\Python27\lib\site-packages\pmaxform\xls2json_backends.py", line 311, in xls_to_dict         
    xls_to_dict_normal_sheet(sheet)                                                                                  
  File "C:\Program Files\Python27\lib\site-packages\pmaxform\xls2json_backends.py", line 116, in xls_to_dict_normal_s
heet                                                                                                                 
    raise err                                                                                                        
XLDateAmbiguous: 12.0                                                                                                
Offending row:                                                                                                       
2                                                                                                                    
{u'date': u'2019-03-11 00:00:00', u'v': u'2'}                                                                        
Offending key:                                                                                                       
time (EAT)                                                                                                           
### Unexpected error: XLDateAmbiguous(12.0,)                                                                         
### Deleting "UGR6-FS-Female-Questionnaire-v5-jef.xml"                                                               
Offending row:                                                                                                       
2                                                                                                                    
{u'date': u'2019-03-11 00:00:00', u'v': u'2'}                                                                        
Offending key:                                                                                                       
time (EAT)                                                                                                           
### Unexpected error: XLDateAmbiguous(12.0,)                                                                         
========== XML creation failures (2/2) ===========                                                                   
 -- UGR6-FS-Female-Questionnaire-v5-jef.xml                                                                          
 -- UGR6-FS-Household-Questionnaire-v5-jef.xml                                                                       

This is probably related to pyxform or perhaps even XLRD, but I'm only posting this here for now since I don't see PyXform in the stack trace.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions