search cancel

Email Data Feed - urllib2.HTTP error

book

Article ID: 172979

calendar_today

Updated On:

Products

Email Security.cloud Email Threat Detection and Response

Issue/Introduction

Unable to generate log files produced by the Email Data Feed service.

The following error will be displayed when the Python script is run from command prompt: 

 

File "C:\NdfConfig\NdfScript.py", line 98
  except urllib2.HTTPError, ex:
                            ^
SyntaxError: invalid syntax

Cause

"NdfScript.py" script was run using Python version 3.x

The script has a dependency on Python 2.x version. Due to changes to urllib in Python 3.x the script requires modification to run on Python 3.x.

Environment

Email Threat Detection and Response

Resolution

Locate and download Python 2.x version for your environment, and ensure that your system recognizes files with the .py extension and associates them with the interpreter.