Page 1 of 1

Python interpreter seg fault....

Posted: Thu Nov 03, 2011 11:40 pm
by dja
I'm getting a weird error in the python2.6 interpreter, not sure what's up. FIgured I'd post here to see if I can some good info. Thanks!

$ python2.6
Python 2.6.5 (r265:79063, Jul 15 2010, 10:12:41)
[GCC 3.3.4] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import cookielib, urllib2
>>> cj = cookielib.CookieJar()
>>> opener = urllib2.build_opener(urllib2.HTTPCookieProcessor(cj))
>>> import urllib
>>> data = urllib.urlencode({'pw':'<password>', 'user': '<username>'})
>>> web_file = opener.open("https://members.sonic.net", data) # <-- this is the line that's causing the issue
Segmentation fault
_[Sonic:/home/d/dja]_
$

This same code works from my laptop at home, but not on bolt.sonic.net, I thought maybe it was safeguard against logging into member tools from the command line, but it also seg faults on http://www.gmail.com.

Re: Python interpreter seg fault....

Posted: Wed Nov 16, 2011 5:08 pm
by augie
Strace it, I think you'll find that urllib2 doesn't like the SSL certificates for some reason.

Re: Python interpreter seg fault....

Posted: Thu Nov 17, 2011 5:25 pm
by dja
Damn, good call! I didn't even think about running strace on it. thanks!
I'll check it out and post the results. I didn't realize at the time that my version of Python is 2.7, but the servers is 2.6 so that might also be part of the issue as to why it works at home but not on the server. Thanks Augie!