From 784e26fa38153cc3a04684187cc6e0ec5cd6e98d Mon Sep 17 00:00:00 2001 From: tron Date: Wed, 6 May 1998 21:39:52 +0000 Subject: Add or update patches for Python 1.5.1 as suggested by Jaromir Dolecek in PR pkg/5407 and PR pkg/5412. --- lang/python/patches/patch-aj | 33 ++++++++++---------- lang/python/patches/patch-ak | 71 +++++++++++++------------------------------- lang/python/patches/patch-an | 19 ++++++++++++ lang/python/patches/patch-ao | 12 ++++++++ 4 files changed, 67 insertions(+), 68 deletions(-) create mode 100644 lang/python/patches/patch-an create mode 100644 lang/python/patches/patch-ao (limited to 'lang/python') diff --git a/lang/python/patches/patch-aj b/lang/python/patches/patch-aj index dc7acbd886f..06c2b493ff0 100644 --- a/lang/python/patches/patch-aj +++ b/lang/python/patches/patch-aj @@ -1,18 +1,15 @@ -Index: Objects/fileobject.c -=================================================================== -RCS file: /projects/cvsroot/python/dist/src/Objects/fileobject.c,v -retrieving revision 2.58 -diff -c -r2.58 fileobject.c -*** fileobject.c 1998/04/10 22:16:34 2.58 ---- fileobject.c 1998/04/27 18:52:40 -*************** -*** 416,421 **** ---- 416,423 ---- - if (fstat(fileno(f->f_fp), &st) == 0) { - end = st.st_size; - pos = ftell(f->f_fp); -+ if (pos < 0) -+ clearerr(f->f_fp); - if (end > pos && pos >= 0) - return end - pos + 1; - /* Add 1 so if the file were to grow we'd notice. */ +--- Objects/fileobject.c.orig Sat Apr 11 00:16:34 1998 ++++ Objects/fileobject.c Wed May 6 23:09:41 1998 +@@ -415,7 +415,11 @@ + struct stat st; + if (fstat(fileno(f->f_fp), &st) == 0) { + end = st.st_size; +- pos = ftell(f->f_fp); ++ pos = lseek(fileno(f->f_fp), 0L, SEEK_CUR); ++ if (pos >= 0) ++ pos = ftell(f->f_fp); ++ if (pos < 0) ++ clearerr(f->f_fp); + if (end > pos && pos >= 0) + return end - pos + 1; + /* Add 1 so if the file were to grow we'd notice. */ diff --git a/lang/python/patches/patch-ak b/lang/python/patches/patch-ak index 076996ca62a..0aff359273f 100644 --- a/lang/python/patches/patch-ak +++ b/lang/python/patches/patch-ak @@ -1,50 +1,21 @@ -Index: Lib/urllib.py -=================================================================== -RCS file: /projects/cvsroot/python/dist/src/Lib/urllib.py,v -retrieving revision 1.64 -retrieving revision 1.65 -diff -c -r1.64 -r1.65 -*** urllib.py 1998/04/11 01:18:35 1.64 ---- urllib.py 1998/04/27 15:19:17 1.65 -*************** -*** 214,222 **** - # Use HTTP protocol - def open_http(self, url, data=None): - import httplib - if type(url) is type(""): - host, selector = splithost(url) -! user_passwd, host = splituser(host) - realhost = host - else: - host, selector = url ---- 214,224 ---- - # Use HTTP protocol - def open_http(self, url, data=None): - import httplib -+ user_passwd = None - if type(url) is type(""): - host, selector = splithost(url) -! if host: -! user_passwd, host = splituser(host) - realhost = host - else: - host, selector = url -*************** -*** 226,232 **** - realhost = None - else: - realhost, rest = splithost(rest) -! user_passwd, realhost = splituser(realhost) - if user_passwd: - selector = "%s://%s%s" % (urltype, - realhost, ---- 228,236 ---- - realhost = None - else: - realhost, rest = splithost(rest) -! if realhost: -! user_passwd, realhost = \ -! splituser(realhost) - if user_passwd: - selector = "%s://%s%s" % (urltype, - realhost, +--- Lib/urllib.py.orig Sat Apr 11 03:18:35 1998 ++++ Lib/urllib.py Wed May 6 23:26:57 1998 +@@ -221,6 +221,7 @@ + else: + host, selector = url + urltype, rest = splittype(selector) ++ url = rest + user_passwd = None + if string.lower(urltype) != 'http': + realhost = None +@@ -455,8 +456,8 @@ + user, passwd = self.get_user_passwd(host, realm, i) + if not (user or passwd): return None + host = user + ':' + passwd + '@' + host +- newurl = '//' + host + selector +- return self.open_http(newurl) ++ newurl = 'http://' + host + selector ++ return self.open(newurl) + + def get_user_passwd(self, host, realm, clear_cache = 0): + key = realm + '@' + string.lower(host) diff --git a/lang/python/patches/patch-an b/lang/python/patches/patch-an new file mode 100644 index 00000000000..9ef1134d0a0 --- /dev/null +++ b/lang/python/patches/patch-an @@ -0,0 +1,19 @@ +--- Lib/sgmllib.py.orig Thu Mar 26 22:12:54 1998 ++++ Lib/sgmllib.py Wed May 6 23:10:29 1998 +@@ -30,12 +30,12 @@ + endbracket = re.compile('[<>]') + special = re.compile(']*>') + commentopen = re.compile('