Forum Discussion

Connar_Rosebrau's avatar
Connar_Rosebrau
Icon for Nimbostratus rankNimbostratus
Jul 03, 2013

"basic auth failed" when creating a simple connection

Hello,

 

 

When I run the code at the following link from the command line (ie. "python example.py") I get the exception "suds.transport.TransportError: HTTP Error 401: basic auth failed"

 

 

http://pastebin.com/w60Vb9Ji

 

 

What makes this so bizarre is that if I set up this same BIGIP instance in the interpreter, it works just fine. So I am unable to run this from a script. What is making this happen? How do I solve this?

 

 

Thanks

 

  • L4L7,

     

     

    I am running Python 2.7.3 as the interpreter. Is there a way to tell which version of python is running scripts? I had a simple script that was simply "import sys; print sys.version_info" and when that was run using "python version.py" it said the version was 2.7.3 as well.

     

     

    The interpreter may be running a different version of urllib2, but that's another thing that I don't know how to check. I will return with the answer for that.

     

     

    edit:

     

    urllib2 is version 2.7 in both cases. what else could be causing this?

     

  • I remember running into this way back - there was some issue with the urllib2 library and an older python (2.6 if I recall). Are you sure you're using the same interpreter both for your shell and your script?