Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Encoding problem #1

Closed
J-Gras opened this issue Sep 1, 2015 · 5 comments
Closed

Encoding problem #1

J-Gras opened this issue Sep 1, 2015 · 5 comments

Comments

@J-Gras
Copy link
Contributor

J-Gras commented Sep 1, 2015

Executing the script for the first time, the following error occurred:

Traceback (most recent call last):
  File "./otxv2-bro.py", line 155, in <module>
    firstRun()
  File "./otxv2-bro.py", line 81, in firstRun
    content = pulseToBRO(p)
  File "./otxv2-bro.py", line 30, in pulseToBRO
    source = "Alienvault OTX - %s - %s" % (pulse["name"].encode('utf-8').replace("\t", ""), pulse["id"])
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 40: ordinal not in range(128)

Moving the encode('utf-8') to line 42 worked for me.

@jaimeblasco
Copy link
Contributor

@J-Gras I can't reproduce. Do you have the title or Pulse id if the one that is causing the exception?

@J-Gras
Copy link
Contributor Author

J-Gras commented Sep 2, 2015

@jaimeblasco: I think the Pulse id was "55dccc2f67db8c7bb8cb7cdd".

@jaimeblasco
Copy link
Contributor

@J-Gras Can you try again?. I'm not getting the exception with the encode there

@J-Gras
Copy link
Contributor Author

J-Gras commented Sep 2, 2015

@jaimeblasco: Still the same message:

./otxv2-bro.py first_run
Installing files...
Downloading data from Alienvault OTX...
/home/jgrashof/devel//OTX-Apps-Bro-IDS/pulses/55e6bfb14637f22cb605746e.intel saved
/home/jgrashof/devel//OTX-Apps-Bro-IDS/pulses/55e557fa4637f21c54c1bb0d.intel saved
/home/jgrashof/devel//OTX-Apps-Bro-IDS/pulses/55e4266b4637f21c54c1afe5.intel saved
/home/jgrashof/devel//OTX-Apps-Bro-IDS/pulses/55dfc68967db8c7bb9cb72b9.intel saved
/home/jgrashof/devel//OTX-Apps-Bro-IDS/pulses/55dfc30067db8c7bb8cb9865.intel saved
/home/jgrashof/devel//OTX-Apps-Bro-IDS/pulses/553468d3b45ff5362e3ffd3e.intel saved
/home/jgrashof/devel//OTX-Apps-Bro-IDS/pulses/5580cbd1b45ff57c3925e6fa.intel saved
/home/jgrashof/devel//OTX-Apps-Bro-IDS/pulses/55df3d1167db8c7bb8cb8da8.intel saved
/home/jgrashof/devel//OTX-Apps-Bro-IDS/pulses/55df30f04637f21c54c1a2b2.intel saved
Traceback (most recent call last):
  File "./otxv2-bro.py", line 155, in <module>
    firstRun()
  File "./otxv2-bro.py", line 81, in firstRun
    content = pulseToBRO(p)
  File "./otxv2-bro.py", line 30, in pulseToBRO
    source = "Alienvault OTX - %s - %s" % (pulse["name"].encode("utf-8").replace("\t", ""), pulse["id"])
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 40: ordinal not in range(128)

J-Gras added a commit to J-Gras/OTX-Apps-Bro-IDS that referenced this issue Sep 4, 2015
jaimeblasco added a commit that referenced this issue Sep 7, 2015
@Matchjuan859
Copy link

Executing the script for the first time, the following error occurred:

Traceback (most recent call last):
  File "./otxv2-bro.py", line 155, in <module>
    firstRun()
  File "./otxv2-bro.py", line 81, in firstRun
    content = pulseToBRO(p)
  File "./otxv2-bro.py", line 30, in pulseToBRO
    source = "Alienvault OTX - %s - %s" % (pulse["name"].encode('utf-8').replace("\t", ""), pulse["id"])
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 40: ordinal not in range(128)

Moving the encode('utf-8') to line 42 worked for me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants