search cancel

Email Data Feed - Invalid Escape Error


Article ID: 172914


Updated On:


Email Email Threat Detection and Response


Log files are not being generated when running the Python script on a Windows system.

ValueError: Invalid \escape: line 7 column 32  (char 260)


The Python configuration file (NdfConfig.json) is missing an extra slash “\”  in the cookies and log file path 

cookiesFilePath line is used to specify the path at which to store the persistent cookies that are used to mark your place in the feed.
logsFilePath line is used to specify the path at which to store the log files that the Data Feeds API connection session produces.


Advanced Threat Protection Email 


In a Windows environment, you must escape the slash in order for the Python script to run, otherwise the script will treat it as a special character. The file path can include multiple sub directories but the slash needs to be escaped e.g., C:\\directory\\sub_directory


Incorrect path:

        "cookiesFilePath" : "C:\datafeed\cookies",

        "logsFilePath" : "C:\datafeed\logs"


Correct path:

        "cookiesFilePath" : "C:\\datafeed\\cookies",

        "logsFilePath" : "C:\\datafeed\\logs"


The following table describes the characters that need to be escaped in python: