(unicode error) 'unicodeescape' codec can't decode bytes in position 2-3: truncated \UXXXXXXXX escape

   

  


(unicode error) 'unicodeescape' codec can't decode bytes in position 2-3: truncated \UXXXXXXXX escape


    This error message is generally come when we are passing the path in the python like reading the xml, csv etc files.

    For example lets say we have a function parser in which we need to pass the file path as below and if you run this function you will get the error message as below

    Error :- "(unicode error) 'unicodeescape' codec can't decode bytes in position 2-3: truncated \UXXXXXXXX escape"


    parseDocument("C:\Users\testing\Desktop\Learning\python\POC\convertedJSON\temp.html")


    TO solve the issue we need to change the use "\\" double forward slash instead of the single, please let me know if this help to resolve the issue 


Post a Comment