From owner-freebsd-ports-bugs Sun Mar 23 19:20: 7 2003 Delivered-To: freebsd-ports-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1B7A037B401 for ; Sun, 23 Mar 2003 19:20:04 -0800 (PST) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 06E4F43FDD for ; Sun, 23 Mar 2003 19:20:03 -0800 (PST) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.6/8.12.6) with ESMTP id h2O3K2NS094500 for ; Sun, 23 Mar 2003 19:20:02 -0800 (PST) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.6/8.12.6/Submit) id h2O3K24D094499; Sun, 23 Mar 2003 19:20:02 -0800 (PST) Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A4EE037B401 for ; Sun, 23 Mar 2003 19:10:17 -0800 (PST) Received: from esp.branda.to (179.c210-85-224.ethome.net.tw [210.85.224.179]) by mx1.FreeBSD.org (Postfix) with ESMTP id AD49D43F85 for ; Sun, 23 Mar 2003 19:10:14 -0800 (PST) (envelope-from thinker@esp.branda.to) Received: from esp.branda.to (localhost [127.0.0.1]) by esp.branda.to (8.12.6/8.12.6) with ESMTP id h2O3AU5a042064 for ; Mon, 24 Mar 2003 11:10:30 +0800 (CST) (envelope-from thinker@esp.branda.to) Received: (from root@localhost) by esp.branda.to (8.12.6/8.12.6/Submit) id h2O3AT9E042063; Mon, 24 Mar 2003 11:10:29 +0800 (CST) Message-Id: <200303240310.h2O3AT9E042063@esp.branda.to> Date: Mon, 24 Mar 2003 11:10:29 +0800 (CST) From: thinker@branda.to Reply-To: thinker@branda.to To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Subject: ports/50230: grail don't work with Python 2.x. Sender: owner-freebsd-ports-bugs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org >Number: 50230 >Category: ports >Synopsis: grail don't work with Python 2.x. >Confidential: no >Severity: non-critical >Priority: medium >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Sun Mar 23 19:20:02 PST 2003 >Closed-Date: >Last-Modified: >Originator: thinker@branda.to >Release: FreeBSD 5.0-CURRENT i386 >Organization: http://netlab.cse.yzu.edu.tw/ >Environment: System: FreeBSD esp.branda.to 5.0-CURRENT FreeBSD 5.0-CURRENT #3: Sun Jan 5 04:01:59 CST 2003 thinker@esp.branda.to:/usr/src/sys/i386/compile/esp i386 >Description: Grail 0.6 is not updated, since May 2000. It could not work with Python 2.x, but work well with Python 1.x. The problem is caused by changes of Python's libraries. >How-To-Repeat: execute grail with Python 2.x. >Fix: apply patch. --- patches begins here --- # This is a shell archive. Save it in a file, remove anything before # this line, and then unpack it by entering "sh file". Note, it may # create directories; files and directories will be owned by you and # have default permissions. # # This archive contains: # # patch-ab # patch-ac # echo x - patch-ab sed 's/^X//' >patch-ab << 'END-of-patch-ab' X--- grailbase/app.py.orig Wed Mar 24 23:11:52 1999 X+++ grailbase/app.py Mon Mar 24 10:48:37 2003 X@@ -3,10 +3,10 @@ X X import os X import mimetypes X-import regex X+import re X import string X import utils X- X+regex = re X X class Application: X def __init__(self, prefs=None): X@@ -51,7 +51,7 @@ X X X __data_scheme_re = regex.compile( X- "data:\([^,;]*\)\(;\([^,]*\)\|\),", regex.casefold) X+ "data:\([^,;]*\)\(;\([^,]*\)\|\),") X X def guess_type(self, url): X """Guess the type of a file based on its URL. END-of-patch-ab echo x - patch-ac sed 's/^X//' >patch-ac << 'END-of-patch-ac' X--- protocols/httpAPI.py.orig Sat Mar 6 06:05:19 1999 X+++ protocols/httpAPI.py Mon Mar 24 10:47:50 2003 X@@ -52,9 +52,14 @@ X X class MyHTTP(httplib.HTTP): X X+ def __init__(self, host='', port=None, strict=None): X+ httplib.HTTP.__init__(self, host, port, strict) X+ self.putrequest_bk = self.putrequest X+ self.putrequest = lambda r,s: MyHTTP.putrequest(self, r, s) X+ X def putrequest(self, request, selector): X self.selector = selector X- httplib.HTTP.putrequest(self, request, selector) X+ self.putrequest_bk(request, selector) X X def getreply(self, file): X self.file = file X@@ -81,14 +86,14 @@ X def close(self): X if self.file: X self.file.close() X- if self.sock: X+ if self._conn.sock: X try: X- self.sock.close() X+ self._conn.sock.close() X except socket.error: X # What can you do? :-) X pass X self.file = None X- self.sock = None X+ self._conn.sock = None X X X class http_access: X@@ -168,7 +173,7 @@ X def pollmeta(self, timeout=0): X Assert(self.state == META) X X- sock = self.h.sock X+ sock = self.h._conn.sock X try: X if not select.select([sock], [], [], timeout)[0]: X return "waiting for server response", 0 X@@ -222,7 +227,7 @@ X self.readahead = self.readahead[maxbytes:] X return data X try: X- data = self.h.sock.recv(maxbytes) X+ data = self.h._conn.sock.recv(maxbytes) X except socket.error, msg: X raise IOError, msg, sys.exc_traceback X if not data: X@@ -231,7 +236,7 @@ X return data X X def fileno(self): X- return self.h.sock.fileno() X+ return self.h._conn.sock.fileno() X X X # To test this, use ProtocolAPI.test() END-of-patch-ac exit --- patches ends here --- >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-ports-bugs" in the body of the message