Fix bug, yay.

This commit is contained in:
Jeremy Fincher 2004-07-24 05:07:24 +00:00
parent 97cfeef28c
commit fe63755592

View File

@ -31,10 +31,10 @@
__revision__ = "$Id$"
import fix
import supybot.fix as fix
import re
import conf
import supybot.conf as conf
import socket
import urllib2
import urlparse
@ -71,10 +71,12 @@ def strError(e):
def getUrlFd(url):
"""Gets a file-like object for a url."""
try:
if not isinstance(url, urllib2.Request):
if '#' in url:
i = url.index('#')
url = url[:i]
url = url[:url.index('#')]
request = urllib2.Request(url)
else:
request = url
httpProxy = conf.supybot.protocols.http.proxy()
if httpProxy:
request.set_proxy(httpProxy, 'http')