migrating from python 2.4 to python 2.6
Hi I have a large code base that was written in python 2.4. I want to migrate to python 2.6. Are there any tools that will aid me in this migration? Thanks A -- http://mail.python.org/mailman/listinfo/python-list
(No subject)
Hi I'm brand new to python and I was wondering if anybody knew of a easy way to change every character in a list into its lower case form. The list is like so: commands = ['CLASS-MAP MATCH-ALL cmap1', 'MaTch Ip AnY', 'CLASS-map Match-Any cmap2', 'MaTch AnY', 'Policy-map policy1', 'Class cmap1', 'policy-Map policy2', 'Service-PoLicy policy1', 'claSS cmap2'] and what I want is: commands = ['class-map match-all cmap1', 'match ip any', 'class-map match-any cmap2', 'match any', 'policy-map policy1', 'class cmap1', 'policy-map policy2', 'service-policy policy1', 'class cmap2'] Are there any defined method within any known modules to do this in one go? Thanks in advance _ Sign up for eircom broadband now and get a free two month trial.* Phone 1850 73 00 73 or visit http://home.eircom.net/broadbandoffer -- http://mail.python.org/mailman/listinfo/python-list
Re: create lowercase strings in lists - was: (No subject)
Actually what I want is element 'class-map match-all cmap1' from list 1 to match 'class-map cmap1 (match-all)' or 'class-map cmap1 mark match-all done' in list 2 but not to match 'class-map cmap1'. Each element in both lists have multiple words in them. If all the words of any element of the first list appear in any order within any element of the second list I want a match but if any of the words are missing then there is no match. There are far more elements in list 2 than in list 1. Steve Holden <[EMAIL PROTECTED]> wrote: > > Mark Devine wrote: > > > Sorry for not putting a subject in the last e-mail. The function lower > > suited my case exactly. Here however is my main problem: > > Given that my new list is : > > [class-map match-all cmap1', 'match ip any', 'class-map match-any cmap2', > > 'match any', 'policy-map policy1', 'class cmap1', 'policy-map policy2', > > 'service-policy policy1', 'class cmap2'] > > > > Each element in my new list could appear in any order together within > > another larger list (list1) and I want to count how many matches occur. For > > example the larger list could have an element 'class-map cmap2 (match any)' > > and I want to match that but if only 'class-map match-any' or 'class-map > > cmap2' appears I don't want it to match. > > > > Can anybody help? > > Is my problem clearly stated? > > > > Well, let's see: you'd like to know which strings occur in both lists, > right? > > You might like to look at the "Efficient grep using Python?" thread for > suggestions. My favorite would be: > > .>>> lst1 = ["ab", "ac", "ba", "bb", "bc"] > .>>> lst2 = ["ac", "ab", "bd", "cb", "bb"] > .>>> dct1 = dict.fromkeys(lst1) > .>>> [x for x in lst2 if x not in dct1] > ['bd', 'cb'] > .>>> [x for x in lst2 if x in dct1] > ['ac', 'ab', 'bb'] > > regards > Steve > -- > Steve Holden http://www.holdenweb.com/ > Python Web Programming http://pydish.holdenweb.com/ > Holden Web LLC +1 703 861 4237 +1 800 494 3119 > -- > http://mail.python.org/mailman/listinfo/python-list > _ Sign up for eircom broadband now and get a free two month trial.* Phone 1850 73 00 73 or visit http://home.eircom.net/broadbandoffer -- http://mail.python.org/mailman/listinfo/python-list
Re: create lowercase strings in lists - was: (No subject)
Thanks for the help. This is the final script: #!/usr/bin/env python import os import sys import time import string import pexpect import commands # Test if the words of list2 elements appear in any order in list1 elements # disregarding case and parens # Reference list list1 = ["a b C (D)", "D A B", "A B E"] # Test list list2 = ["A B C D", "A B D", "A E F", "A (E) B", "A B", "E A B" ] def normalize(text, unwanted = "()", table = string.maketrans(string.ascii_uppercase,string.ascii_lowercase)): text.translate(table,unwanted) return set(text.split()) reflist = [normalize(element) for element in list1] print reflist #This is the list of sets to test against def testmember(element): """is element a member of the reflist, according to the above rules?""" testelement = normalize(element) #brute force comparison until match - depends on small reflist for el in reflist: if el.issuperset(testelement): return True return False for element in list2: print element, testmember(element) the trouble is it throws up the following error for set: $ ./test.py Traceback (most recent call last): File "./test.py", line 23, in ? reflist = [normalize(element) for element in list1] File "./test.py", line 20, in normalize return set(text.split()) NameError: global name 'set' is not defined when I checked http://docs.python.org/lib/genindex.html#letter-s it said that set() (built-in function) The python I use is the one that comes with cygwin. Does anybody know if the following version of python is incomplete or do I need to call built in functions in a different way? $ python Python 2.3.4 (#1, Jun 13 2004, 11:21:03) [GCC 3.3.1 (cygming special)] on cygwin Type "help", "copyright", "credits" or "license" for more information. Michael Spencer <[EMAIL PROTECTED]> wrote: > > Steve Holden wrote: > > Mark Devine wrote: > > > >> Actually what I want is element 'class-map match-all cmap1' from list > >> 1 to match 'class-map cmap1 (match-all)' or 'class-map cmap1 mark > >> match-all done' in list 2 but not to match 'class-map cmap1'. > >> Each element in both lists have multiple words in them. If all the > >> words of any element of the first list appear in any order within any > >> element of the second list I want a match but if any of the words are > >> missing then there is no match. There are far more elements in list 2 > >> than in list 1. > >> > > > sounds like a case for sets... > > >>> # NB Python 2.4 > ... > >>> # Test if the words of list2 elements appear in any order in list1 > elements > >>> # disregarding case and parens > ... > >>> # Reference list > >>> list1 = ["a b C (D)", > ... "D A B", > ... "A B E"] > >>> # Test list > >>> list2 = ["A B C D", #True > ... "A B D", #True > ... "A E F", #False > ... "A (E) B",#True > ... "A B", #True > ... "E A B" ] > ... > >>> def normalize(text, unwanted = "()"): > ... conv = "".join(char.lower() for char in text if char not in > unwanted) > ... return set(conv.split()) > ... > >>> reflist = [normalize(element) for element in list1] > >>> print reflist > ... > [set(['a', 'c', 'b', 'd']), set(['a', 'b', 'd']), set(['a', 'b', 'e'])] > > This is the list of sets to test against > > > >>> def testmember(element): > ... """is element a member of the reflist, according to the above > rules?""" > ... testelement = normalize(element) > ... #brute force comparison until match - depends on small reflist > ... for el in reflist: > ... if el.issuperset(testelement): > ... return True > ... return False > ... > >>> for element in list2: > ... print element, testmember(element) > ... > A B C D True > A B D True > A E F False > A (E) B True > A B True > E A B True > >>> > > Michael > > -- > http://mail.python.org/mailman/listinfo/python-list > _ Sign up for eircom broadband now and get a free two month trial.* Phone 1850 73 00 73 or visit http://home.eircom.net/broadbandoffer -- http://mail.python.org/mailman/listinfo/python-list
Re: create lowercase strings in lists - was: (No subject)
Thanks. This version is the version that comes with cygwin. They must be behind. Steven Bethard <[EMAIL PROTECTED]> wrote: > > Mark Devine wrote: > > the trouble is it throws up the following error for set: > > > > $ ./test.py > > Traceback (most recent call last): > > File "./test.py", line 23, in ? > > reflist = [normalize(element) for element in list1] > > File "./test.py", line 20, in normalize > > return set(text.split()) > > NameError: global name 'set' is not defined > > > > The set type became a builtin in Python 2.4. I would suggest upgrading, > but if this is not an option, you can put this at the top of the file, > and it should get rid of the NameError: > > from sets import Set as set > > Steve > -- > http://mail.python.org/mailman/listinfo/python-list > _ Sign up for eircom broadband now and get a free two month trial.* Phone 1850 73 00 73 or visit http://home.eircom.net/broadbandoffer -- http://mail.python.org/mailman/listinfo/python-list
Re: create lowercase strings in lists - was: (No subject)
I got the script working. Thanks for all your help everyone. Trouble is its not showing the correct results. Here is the script and results: #!/usr/bin/env python import os import sys import time import string import pexpect import commands from sets import Set as set # Test if the words of list2 elements appear in any order in list1 elements # disregarding case and parens # Reference list list1 = ["a b C (D)", "D A B", "A B E"] # Test list list2 = ["A B C D", "A B D", "A E F", "A (E) B", "A B", "E A B" ] def normalize(text, unwanted = "()", table = string.maketrans(string.ascii_uppercase,string.ascii_lowercase)): text.translate(table,unwanted) return set(text.split()) reflist = [normalize(element) for element in list1] print reflist #This is the list of sets to test against def testmember(element): """is element a member of the reflist, according to the above rules?""" testelement = normalize(element) #brute force comparison until match - depends on small reflist for el in reflist: if el.issuperset(testelement): return True return False for element in list2: print element, testmember(element) Here is the results: $ ./test.py [Set(['a', 'C', 'b', '(D)']), Set(['A', 'B', 'D']), Set(['A', 'B', 'E'])] A B C D False A B D True A E F False A (E) B False A B True E A B True The results should be: > A B C D True > A B D True > A E F False > A (E) B True > A B False > E A B True Michael Spencer <[EMAIL PROTECTED]> wrote: > > Steve Holden wrote: > > Mark Devine wrote: > > > >> Actually what I want is element 'class-map match-all cmap1' from list > >> 1 to match 'class-map cmap1 (match-all)' or 'class-map cmap1 mark > >> match-all done' in list 2 but not to match 'class-map cmap1'. > >> Each element in both lists have multiple words in them. If all the > >> words of any element of the first list appear in any order within any > >> element of the second list I want a match but if any of the words are > >> missing then there is no match. There are far more elements in list 2 > >> than in list 1. > >> > > > sounds like a case for sets... > > >>> # NB Python 2.4 > ... > >>> # Test if the words of list2 elements appear in any order in list1 > elements > >>> # disregarding case and parens > ... > >>> # Reference list > >>> list1 = ["a b C (D)", > ... "D A B", > ... "A B E"] > >>> # Test list > >>> list2 = ["A B C D", #True > ... "A B D", #True > ... "A E F", #False > ... "A (E) B",#True > ... "A B", #True > ... "E A B" ] > ... > >>> def normalize(text, unwanted = "()"): > ... conv = "".join(char.lower() for char in text if char not in > unwanted) > ... return set(conv.split()) > ... > >>> reflist = [normalize(element) for element in list1] > >>> print reflist > ... > [set(['a', 'c', 'b', 'd']), set(['a', 'b', 'd']), set(['a', 'b', 'e'])] > > This is the list of sets to test against > > > >>> def testmember(element): > ... """is element a member of the reflist, according to the above > rules?""" > ... testelement = normalize(element) > ... #brute force comparison until match - depends on small reflist > ... for el in reflist: > ... if el.issuperset(testelement): > ... return True > ... return False > ... > >>> for element in list2: > ... print element, testmember(element) > ... > A B C D True > A B D True > A E F False > A (E) B True > A B True > E A B True > >>> > > Michael > > -- > http://mail.python.org/mailman/listinfo/python-list > _ Sign up for eircom broadband now and get a free two month trial.* Phone 1850 73 00 73 or visit http://home.eircom.net/broadbandoffer -- http://mail.python.org/mailman/listinfo/python-list
Re: create lowercase strings in lists - was: (No subject)
If I use: if el.issubset(testelement): I get a closer anwser but the brackets cause a problem. They are optional in the test list so (D) in the test list is equal to D or (D) in the reference list. "Mark Devine" <[EMAIL PROTECTED]> wrote: > > I got the script working. Thanks for all your help everyone. Trouble is its > not showing the correct results. Here is the script and results: > > #!/usr/bin/env python > import os > import sys > import time > import string > import pexpect > import commands > from sets import Set as set > > > # Test if the words of list2 elements appear in any order in list1 elements > # disregarding case and parens > > # Reference list > list1 = ["a b C (D)", "D A B", "A B E"] > # Test list > list2 = ["A B C D", "A B D", "A E F", "A (E) B", "A B", "E A B" ] > > def normalize(text, unwanted = "()", table = > string.maketrans(string.ascii_uppercase,string.ascii_lowercase)): > text.translate(table,unwanted) > return set(text.split()) > > reflist = [normalize(element) for element in list1] > print reflist > > #This is the list of sets to test against > > > def testmember(element): > """is element a member of the reflist, according to the above rules?""" > testelement = normalize(element) > #brute force comparison until match - depends on small reflist > for el in reflist: > if el.issuperset(testelement): > return True > return False > > for element in list2: > print element, testmember(element) > > Here is the results: > > $ ./test.py > [Set(['a', 'C', 'b', '(D)']), Set(['A', 'B', 'D']), Set(['A', 'B', 'E'])] > A B C D False > A B D True > A E F False > A (E) B False > A B True > E A B True > > The results should be: > > > A B C D True > > A B D True > > A E F False > > A (E) B True > > A B False > > E A B True > > > > > > Michael Spencer <[EMAIL PROTECTED]> wrote: > > > > > Steve Holden wrote: > > > Mark Devine wrote: > > > > > >> Actually what I want is element 'class-map match-all cmap1' from list > > >> 1 to match 'class-map cmap1 (match-all)' or 'class-map cmap1 mark > > >> match-all done' in list 2 but not to match 'class-map cmap1'. > > >> Each element in both lists have multiple words in them. If all the > > >> words of any element of the first list appear in any order within any > > >> element of the second list I want a match but if any of the words are > > >> missing then there is no match. There are far more elements in list 2 > > >> than in list 1. > > >> > > > > > sounds like a case for sets... > > > > >>> # NB Python 2.4 > > ... > > >>> # Test if the words of list2 elements appear in any order in list1 > > elements > > >>> # disregarding case and parens > > ... > > >>> # Reference list > > >>> list1 = ["a b C (D)", > > ... "D A B", > > ... "A B E"] > > >>> # Test list > > >>> list2 = ["A B C D", #True > > ... "A B D", #True > > ... "A E F", #False > > ... "A (E) B",#True > > ... "A B", #True > > ... "E A B" ] > > ... > > >>> def normalize(text, unwanted = "()"): > > ... conv = "".join(char.lower() for char in text if char not in > > unwanted) > > ... return set(conv.split()) > > ... > > >>> reflist = [normalize(element) for element in list1] > > >>> print reflist > > ... > > [set(['a', 'c', 'b', 'd']), set(['a', 'b', 'd']), set(['a', 'b', 'e'])] > > > > This is the list of sets to test against > > > > > > >>> def testmember(element): > > ... """is element a member of the reflist, according to the above > > rules?""" > > ... testelement = normalize(element) > > ... #brute force comparison until match - depends on small reflist > > ... for el in reflist: > > ... if el.issuperset(testelement): > > ... return True > > ... return False > > ... > > >>> for element in list2: > > ... print element, testmember(element) > > ... > > A B C D True > > A B D True > > A E F False > > A (E) B True > > A B True > > E A B True > > >>> > > > > Michael > > > > -- > > http://mail.python.org/mailman/listinfo/python-list > > > > > > _ > Sign up for eircom broadband now and get a free two month trial.* > Phone 1850 73 00 73 or visit http://home.eircom.net/broadbandoffer > > > -- > http://mail.python.org/mailman/listinfo/python-list > _ Sign up for eircom broadband now and get a free two month trial.* Phone 1850 73 00 73 or visit http://home.eircom.net/broadbandoffer -- http://mail.python.org/mailman/listinfo/python-list
Fwd: Re: create lowercase strings in lists - was: (No subject)
I got this working now. Thanks everybody for your help.
_
Sign up for eircom broadband now and get a free two month trial.*
Phone 1850 73 00 73 or visit http://home.eircom.net/broadbandoffer
--- Begin Message ---
Happy to help. Pass it on.
regards
Steve
Mark Devine wrote:
I got it working correctly now thanks. I was on the right track it was a subset not a superset that was required in the end and all has worked out fine for me. Thank you for all your help
Steve Holden <[EMAIL PROTECTED]> wrote:
Mark Devine wrote:
I got the script working. Thanks for all your help everyone. Trouble is its not
showing the correct results. Here is the script and results:
Well, that's a pretty unusual interpretation of the word "working" :-)
> [...]
I see from later postings you are getting closer to an answer, but
obviously you still have to strip out the characters that you don't want
to affect the match (such as "(" and ")").
regards
Steve
--
Steve Holden http://www.holdenweb.com/
Python Web Programming http://pydish.holdenweb.com/
Holden Web LLC +1 703 861 4237 +1 800 494 3119
_
Sign up for eircom broadband now and get a free two month trial.*
Phone 1850 73 00 73 or visit http://home.eircom.net/broadbandoffer
--
Steve Holden http://www.holdenweb.com/
Python Web Programming http://pydish.holdenweb.com/
Holden Web LLC +1 703 861 4237 +1 800 494 3119
--- End Message ---
--
http://mail.python.org/mailman/listinfo/python-list
Re: create lowercase strings in lists - was: (No subject)
Sorry for not putting a subject in the last e-mail. The function lower suited my case exactly. Here however is my main problem: Given that my new list is : [class-map match-all cmap1', 'match ip any', 'class-map match-any cmap2', 'match any', 'policy-map policy1', 'class cmap1', 'policy-map policy2', 'service-policy policy1', 'class cmap2'] Each element in my new list could appear in any order together within another larger list (list1) and I want to count how many matches occur. For example the larger list could have an element 'class-map cmap2 (match any)' and I want to match that but if only 'class-map match-any' or 'class-map cmap2' appears I don't want it to match. Can anybody help? Is my problem clearly stated? "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > > Helpful subjects help > > commands = [c.lower() for c in commands] > > -- > Regards, > > Diez B. Roggisch > -- > http://mail.python.org/mailman/listinfo/python-list > _ Sign up for eircom broadband now and get a free two month trial.* Phone 1850 73 00 73 or visit http://home.eircom.net/broadbandoffer -- http://mail.python.org/mailman/listinfo/python-list
regular expressions in the pexpect module for python
HiI wonder if you can help me. I am using pexpect with python to access remote machines and run commands on them. I pass commands into code like so:def cmd(self, cmd): pp=[ "|", "]", "[", "(", ")", "$", "?", "*", ".", ":"]
expcmd=cmd for element in pp: expcmd=expcmd.replace(element, "\\%s" % element) self.spawn.setecho(False) self.spawn.sendline(cmd) self.spawn.expect
(expcmd) self.spawn.expect(self.prompt) return self.spawn.beforeThe above code is supposed to match the command, then match the prompt and then return what is in between. Since pexpect uses regular expressions to match what it sees
--
http://mail.python.org/mailman/listinfo/python-list
Re: Python-list Digest, Vol 37, Issue 23
HiSorry about that. Here is the full question:I wonder if you can help me. I am using pexpect with python to access remote machines and run commands on them. I pass commands into code like so:def cmd(self, cmd):
pp=[ "|", "]", "[", "(", ")", "$", "?", "*", ".", ":"] expcmd=cmd for element in pp:
expcmd=expcmd.replace(element, "\\%s" % element) self.spawn.setecho(False) self.spawn.sendline(cmd) self.spawn.expect(expcmd) self.spawn.expect(self.prompt
) return self.spawn.beforeThe above code is supposed to match the command, then match the prompt and then return what is in between. Since pexpect uses regular expressions to match what it sees, the command needs to have certain characters backslashed. The problem is that on some remote shells hidden characters are introduced that causes the expect statement (
self.spawn.expect(expcmd)) to timeout without matching. In perl there is a way to translate any character with an ascii value of less than 32 to "" so that all hidden characters are removed. Can this be done in python? Can this be applied to the regular _expression_ used by pexpect?
BewilderedOn 02/10/06, [EMAIL PROTECTED] <
[EMAIL PROTECTED]> wrote:Send Python-list mailing list submissions to
[email protected] subscribe or unsubscribe via the World Wide Web, visit
http://mail.python.org/mailman/listinfo/python-listor, via email, send a message with subject or body 'help' to
[EMAIL PROTECTED]You can reach the person managing the list at [EMAIL PROTECTED]
When replying, please edit your Subject line so it is more specificthan "Re: Contents of Python-list digest..."Today's Topics: 1. Re: Problems wth os.stat().st_mtime on Mac (Michael Glassford)
2. Re: Help with ConfigParser (TonyHa) 3. regular expressions in the pexpect module for python (Mark Devine) 4. commands.getstatusoutput result is not command line exit value!!! (Hari Sekhon)
5. PyCon proposals (was Re: PATCH: Speed up direct string concatenation by 20+%!) (Aahz) 6. Re: Python/UNO/OpenOffice? (John Machin) 7. Re: Help with ConfigParser (Enrico) 8. How to coerce a list of vars into a new type? (Matthew Wilson)
9. Making posts to an ASP.NET webform. (Bernard) 10. How can I make a class that can be converted into an int?
(Matthew Wilson) 11. Sort by domain name? (js )-- Forwarded message --From: Michael Glassford <[EMAIL PROTECTED]>
To: [email protected]: Mon, 02 Oct 2006 10:15:26 -0400Subject: Re: Problems wth os.stat().st_mtime on MacMartin v. Löwis wrote:> Michael Glassford schrieb:
>> Although not mentioned in the Python 2.5 News, apparently there was a>> similar change on Mac that I'm having some problems with. On the Mac,>> just as on Windows, os.stat().st_mtime now returns a float instead of an
>> integer.>> It's isn't really new; os.stat_float_times was introduced in Python 2.3.> What changed in 2.5 is that it is now true. See>>
http://docs.python.org/whatsnew/modules.htmlThanks, I wasn't aware of os.stat_float_times. This helps me a lot,since I can turn off the floating point times in places untilincompatible code can be fixed.
>>> a) Why the difference between machines?>> You really have to delve into OSX to answer this question. Several> reasons are possible:> - there is a change in the operating system implementations
Possible, I guess, although I don't know how to find out and there'slikely nothing I could do about it even if I did.> - you are using different Python versionsPython 2.5 on both.> - you are using different file systems
This is the first thing I thought of, but all of the drives areformatted using "Mac OS Extended (Journalled)", which I assumed meantthey are using the same file system.>>> b) Why do most files on this machine have ".0", while some (generally
>> those I created myself using Python 2.5, I think) don't?>> Hard to tell. Maybe the software that created those files explicitly> set a time stamp on them, and failed to use the API that supports
> subsecond resolution in setting those time stamps.>>> I understand how the results can be different: the os.stat() function>> returns a posix.stat_result object, which gives back an integer value
>> for the mtime if you call __str__ or __repr__, or if you iterate on it;>> and a float if you get the st_mtime attribute. But I would consider it a>> bug that the results are different: a float should be returned in either
>> case.>> That's for backwards compatibility: You shouldn't use the tuple> interface anymore, but use st_mtime for new code. T
urllib2.URLError: error using twill with python
Hi
I wonder if someone could point me in the right direction. I used the
following code to access gmail but I got a
urllib2.URLError:
error when I ran it. I have included the Traceback
import twill, string, os
b=twill.commands.get_browser()
b.set_agent_string("Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB;
rv:1.8.1.14) Gecko/20080404 Firefox/2.0.0.14")
b.clear_cookies()
b.go('http://www.gmail.com')
f=b.get_form("1")
b.showforms()
f['Email']= email
f['Passwd'] =password
b.clicked(f, f)
b.submit()
When I run the code I get:
Traceback (most recent call last):
File "", line 1, in ?
File "/home/mdevine/qa/aqa/mfe/site-packages/twill/browser.py", line
115, in go
self._journey('open', u)
File "/home/mdevine/qa/aqa/mfe/site-packages/twill/browser.py", line
540, in _journey
r = func(*args, **kwargs)
File
"/home/mdevine/qa/aqa/mfe/site-packages/twill/other_packages/mechanize/_mechanize.py",
line 156, in open
return self._mech_open(url, data)
File
"/home/mdevine/qa/aqa/mfe/site-packages/twill/other_packages/mechanize/_mechanize.py",
line 182, in _mech_open
response = UserAgentBase.open(self, request, data)
File
"/home/mdevine/qa/aqa/mfe/site-packages/twill/other_packages/mechanize/_opener.py",
line 191, in open
response = meth(req, response)
File
"/home/mdevine/qa/aqa/mfe/site-packages/twill/other_packages/mechanize/_http.py",
line 573, in http_response
response = self.parent.error(
File
"/home/mdevine/qa/aqa/mfe/site-packages/twill/other_packages/mechanize/_opener.py",
line 208, in error
result = apply(self._call_chain, args)
File "/opt/ams/mdevine/lib/python2.4/urllib2.py", line 337, in _call_chain
result = func(*args)
File
"/home/mdevine/qa/aqa/mfe/site-packages/twill/other_packages/mechanize/_http.py",
line 129, in http_error_302
return self.parent.open(new)
File
"/home/mdevine/qa/aqa/mfe/site-packages/twill/other_packages/mechanize/_mechanize.py",
line 156, in open
return self._mech_open(url, data)
File
"/home/mdevine/qa/aqa/mfe/site-packages/twill/other_packages/mechanize/_mechanize.py",
line 182, in _mech_open
response = UserAgentBase.open(self, request, data)
File
"/home/mdevine/qa/aqa/mfe/site-packages/twill/other_packages/mechanize/_opener.py",
line 191, in open
response = meth(req, response)
File
"/home/mdevine/qa/aqa/mfe/site-packages/twill/other_packages/mechanize/_http.py",
line 573, in http_response
response = self.parent.error(
File
"/home/mdevine/qa/aqa/mfe/site-packages/twill/other_packages/mechanize/_opener.py",
line 208, in error
result = apply(self._call_chain, args)
File "/opt/ams/mdevine/lib/python2.4/urllib2.py", line 337, in _call_chain
result = func(*args)
File
"/home/mdevine/qa/aqa/mfe/site-packages/twill/other_packages/mechanize/_http.py",
line 129, in http_error_302
return self.parent.open(new)
File
"/home/mdevine/qa/aqa/mfe/site-packages/twill/other_packages/mechanize/_mechanize.py",
line 156, in open
return self._mech_open(url, data)
File
"/home/mdevine/qa/aqa/mfe/site-packages/twill/other_packages/mechanize/_mechanize.py",
line 182, in _mech_open
response = UserAgentBase.open(self, request, data)
File
"/home/mdevine/qa/aqa/mfe/site-packages/twill/other_packages/mechanize/_opener.py",
line 191, in open
response = meth(req, response)
File "/home/mdevine/qa/aqa/mfe/site-packages/twill/utils.py", line
455, in http_response
"refresh", msg, hdrs)
File
"/home/mdevine/qa/aqa/mfe/site-packages/twill/other_packages/mechanize/_opener.py",
line 208, in error
result = apply(self._call_chain, args)
File "/opt/ams/mdevine/lib/python2.4/urllib2.py", line 337, in _call_chain
result = func(*args)
File
"/home/mdevine/qa/aqa/mfe/site-packages/twill/other_packages/mechanize/_http.py",
line 129, in http_error_302
return self.parent.open(new)
File
"/home/mdevine/qa/aqa/mfe/site-packages/twill/other_packages/mechanize/_mechanize.py",
line 156, in open
return self._mech_open(url, data)
File
"/home/mdevine/qa/aqa/mfe/site-packages/twill/other_packages/mechanize/_mechanize.py",
line 182, in _mech_open
response = UserAgentBase.open(self, request, data)
File
"/home/mdevine/qa/aqa/mfe/site-packages/twill/other_packages/mechanize/_opener.py",
line 180, in open
response = urlopen(self, req, data)
File "/opt/ams/mdevine/lib/python2.4/urllib2.py", line 381, in _open
'unknown_open', req)
File "/opt/ams/mdevine/lib/python2.4/urllib2.py", line 337, in _call_chain
result = func(*args)
File "/opt/ams/mdevine/lib/python2.4/urllib2.py", line 1053, in unknown_open
raise URLError('unknown url type: %s' % type)
urllib2.URLError:
Thanks
M
--
http://mail.python.org/mailman/listinfo/python-list
