0

Running Docker Version 17.12.0-ce-mac49 (21995) on mac. Converting an existing working python script that performs some feed parsing on a password protected feed. Standard alone python 2.7 script works perfectly.

Created an alpine based container with working python and associated site-packages for the script. Executing the script will give me an error:

d = feedparser.parse('http://user:pwd@192.168.1.121:4321/rss/feed')

d {'feed': {}, 'bozo': 1, 'bozo_exception': URLError(gaierror(-2, 'Name does not resolve'),), 'entries': []}

I get a 'Name does not resolve' error, however the user and password hasn't changed. The code is exactly the same - the only difference is that the version in the docker container doesn't work.

If I try the command without a username/password, I get the appropriate 401 error:

d = feedparser.parse('http://192.168.1.121:4321/rss/feed')

d {'feed': {}, 'status': 401, 'version': u'', 'encoding': u'utf-8', 'bozo': 1, 'headers': {'date': 'Tue, 06 Feb 2018 19:30:53 GMT', 'content-length': '90', 'content-type': 'text/html; charset=utf-8', 'www-authenticate': 'Basic realm="Login Required"'}, 'href': u'http://192.168.1.121:4321/rss/feed', 'namespaces': {}, 'entries': [], 'bozo_exception': SAXParseException('syntax error',)}

So it can find the host & port is accessible. I've even tried passing the credentials via HTTPDigestAuthHandler and still the same issue.

Any ideas what's doing on?

J. Taylor
  • 31
  • 3

1 Answers1

0

Well, it looks like the issue had something to do with the user's password. It contained a # as the first character.

I created another user, test, with a password of test and the code worked both in the container and out of the container.

oh - another thing I wanted to mention is that I did use HTTPDigestBasicHandler in the original question - not DigestHandler.

Obviously this doesn't solve the issue - but it does give me a work-around.

J. Taylor
  • 31
  • 3