From d0c3d124d07bbce406c36895c6f29f4fdde264c2 Mon Sep 17 00:00:00 2001 From: calvin Date: Thu, 1 May 2003 13:21:23 +0000 Subject: [PATCH] quote urls before request or html output git-svn-id: https://linkchecker.svn.sourceforge.net/svnroot/linkchecker/trunk/linkchecker@875 e7d03fd6-7b0d-0410-9947-9c21f3af8025 --- linkcheck/HttpUrlData.py | 4 ++-- linkcheck/log/HtmlLogger.py | 7 ++++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/linkcheck/HttpUrlData.py b/linkcheck/HttpUrlData.py index b7895f8f..fd11f25e 100644 --- a/linkcheck/HttpUrlData.py +++ b/linkcheck/HttpUrlData.py @@ -16,7 +16,7 @@ # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. import urlparse, sys, time, re, httplib -from urllib import unquote +from urllib import quote, unquote import Config, StringUtil, i18n from linkcheck import robotparser from debug import * @@ -242,7 +242,7 @@ class HttpUrlData (ProxyUrlData): else: path = urlparse.urlunsplit(('', '', self.urlparts[2], self.urlparts[3], self.urlparts[4])) - self.urlConnection.putrequest(method, path, skip_host=1) + self.urlConnection.putrequest(method, quote(path), skip_host=1) self.urlConnection.putheader("Host", host) # userinfo is from http://user@pass:host/ if self.userinfo: diff --git a/linkcheck/log/HtmlLogger.py b/linkcheck/log/HtmlLogger.py index e3067724..475f5250 100644 --- a/linkcheck/log/HtmlLogger.py +++ b/linkcheck/log/HtmlLogger.py @@ -18,6 +18,7 @@ from StandardLogger import StandardLogger from Logger import Logger from linkcheck.log import strtime from linkcheck import StringUtil, i18n, Config +from urllib import quote import time HTML_HEADER = """ @@ -81,8 +82,8 @@ class HtmlLogger (StandardLogger): urlData.name+"\n\n") if urlData.parentName and self.has_field("parenturl"): self.fd.write("\n"+self.field("parenturl")+ - '\n'+ - urlData.parentName+"") + '\n'+urlData.parentName+"") if urlData.line: self.fd.write(i18n._(", line %d")%urlData.line) if urlData.column: @@ -93,7 +94,7 @@ class HtmlLogger (StandardLogger): urlData.baseRef+"\n\n") if urlData.url and self.has_field("realurl"): self.fd.write("\n"+self.field("realurl")+"\n"+ - ''+urlData.url+"\n\n") if urlData.dltime>=0 and self.has_field("dltime"): self.fd.write("\n"+self.field("dltime")+"\n"+