Thread: [A-a-p-user] A-A-P and proxy
Brought to you by:
vimboss
From: <coe...@cm...> - 2003-02-24 18:01:13
|
Hi all, I have a few remarks and questions regarding the use of A-A-P from behind a proxy server. I tried to install vim using A-A-P. I defined 3 environment variables: gopher_proxy=http://<our_proxy>:<port> http_proxy=http://<our_proxy>:<port> ftp_proxy=http://<our_proxy>:<port> (i.e. I used the actual proxy name & actual port number, but I don't want to publish those here.) Unfortunately, A-A-P crashed (or whatever it's called in Python terms). This is the verbose trace: nlattp1scm1|vim61_aap> aap --verbose Options: verbose: 1 Values: Targets: Aap: Reading recipe "/home/cengelbarts/bin/aap/exec/default.aap" Aap: Finished reading recipe "/home/cengelbarts/bin/aap/exec/default.aap" Aap: Reading recipe "main.aap" Aap: Finished reading recipe "main.aap" Aap: Building the "all" target Aap: 1 - updating target "all" Aap: 2 - Using dependency "all : fetch" Aap: 3 - updating target "fetch" Aap: 4 - Using dependency "fetch : " Aap: 3 - Updating "fetch" from "": virtual target Aap: :progsearch did not find any of ['cvs'] Getting Vim version 6.1 using ftp... Aap: :progsearch did not find any of ['bunzip2'] Aap: Start :update "gzip-61.done" Aap: 1 - updating target "gzip-61.done" Aap: 2 - Using dependency "gzip-61.done : " Aap: Cannot read sign file "AAPDIR/sign": [Errno 2] No such file or directory: '/home/cengelbarts/vim_unix/vim61_aap/AAPDIR/sign' Aap: 1 - Updating "gzip-61.done" from "": no old signature for "buildcheck" Aap: Looking up local name for ftp://ftp.vim.org/pub/vim/unix/vim-6.1-src1.tar.gz Aap: Attempting download of "ftp://ftp.vim.org/pub/vim/unix/vim-6.1-src1.tar.gz" Aap: Internal Error Traceback (most recent call last): File "./Process.py", line 966, in Process exec script in recdict, recdict File "<string>", line 10, in ? File "./Commands.py", line 1805, in aap_fetch verscont_cmd(line_nr, recdict, arg, "fetch") File "./Commands.py", line 1800, in verscont_cmd do_verscont_cmd(rpstack, recdict, action, attrdict, varlist) File "./Commands.py", line 1787, in do_verscont_cmd failed = fetch_nodelist(rpstack, recdict, nodelist, 0) File "./VersCont.py", line 179, in fetch_nodelist "fetch", [ "fetch", "commit" ]) File "./VersCont.py", line 157, in handle_nodelist use_cache, action) File "./VersCont.py", line 81, in verscont_command ok = download_file(recdict, dict, node, use_cache) File "./Remote.py", line 160, in download_file fname, use_cache = local_name(recdict, url_dl["name"], cu) File "./Cache.py", line 473, in local_name f, rtime = url_download(recdict, name, path) File "./Remote.py", line 121, in url_download resfile, h = urlretrieve(url, fname) File "/home/cengelbarts/local/lib/python2.2/urllib.py", line 80, in urlretrieve return _urlopener.retrieve(url, filename, reporthook, data) File "/home/cengelbarts/local/lib/python2.2/urllib.py", line 210, in retrieve fp = self.open(url, data) File "/home/cengelbarts/local/lib/python2.2/urllib.py", line 178, in open return getattr(self, name)(url) File "/home/cengelbarts/local/lib/python2.2/urllib.py", line 438, in open_ftp host, path = splithost(url) File "/home/cengelbarts/local/lib/python2.2/urllib.py", line 944, in splithost match = _hostprog.match(url) TypeError: expected string or buffer Aap: Aborted nlattp1scm1|vim61_aap> I added an extra print url, fname before line 121 of Remote.py, and it printed, as expected: ftp://ftp.vim.org/pub/vim/unix/vim-6.1-src1.tar.gz /home/cengelbarts/.aap/cache/91066340.1-src1.tar.gz My python skills are minimal, but after some Googling I found http://www.python.org/doc/1.5.2p2/lib/module-urllib.html , which seems to suggest that we should use urlopen() in stead of urlretrieve(). I use Python Python 2.2.1 (with the patch for pre.py that is suggested in A-A-P's README.txt). Bram wrote a while ago to this list: > I cannot try this myself, I don't have a proxy server. > > Please let me know if this works, I'll add a remark in the > documentation > then. Perhaps I should even add a mechanism for setting the proxy in > the recipe. Well, so far it does not seem to work for FTP :-( Even without the crash, I can not find any references to proxy authorisation in the A-A-P or Python documents. Does that mean that A-A-P and/or Python's urllib-module do not support proxy authorisation? Next problem: I am behind an NTLM proxy (i.e. Microsoft's proxy authorisation protocol) that requires NTLM authorisation. It blocks CVS, but it will allow FTP. I can probably find it if necessary. I am not sure if it already supports FTP. I don't know if A-A-P works with a HTTP-proxy, because there is no HTPP site to download vim-6.1-src1.tar.gz (hint hint ;-) ) I hope that these are some useful test result and sugestions. Coen |
From: Bram M. <Br...@mo...> - 2003-02-24 20:55:37
|
Coen Engelbarts wrote: > I have a few remarks and questions regarding the use of A-A-P from > behind a proxy server. > > I tried to install vim using A-A-P. I defined 3 environment variables: > gopher_proxy=http://<our_proxy>:<port> > http_proxy=http://<our_proxy>:<port> > ftp_proxy=http://<our_proxy>:<port> > (i.e. I used the actual proxy name & actual port number, but I don't > want to publish those here.) > > Unfortunately, A-A-P crashed (or whatever it's called in Python > terms). This is the verbose trace: [...] > File "./Remote.py", line 121, in url_download > resfile, h = urlretrieve(url, fname) > File "/home/cengelbarts/local/lib/python2.2/urllib.py", line 80, in urlretrieve > return _urlopener.retrieve(url, filename, reporthook, data) > File "/home/cengelbarts/local/lib/python2.2/urllib.py", line 210, in retrieve > fp = self.open(url, data) > File "/home/cengelbarts/local/lib/python2.2/urllib.py", line 178, in open > return getattr(self, name)(url) > File "/home/cengelbarts/local/lib/python2.2/urllib.py", line 438, in open_ftp > host, path = splithost(url) > File "/home/cengelbarts/local/lib/python2.2/urllib.py", line 944, in splithost > match = _hostprog.match(url) > TypeError: expected string or buffer This very much looks like an error in the Python urllib module. For open_http() there is a check whether "url" is an ordinary string or a tuple. This check is missing from open_ftp(). This probably means that FTP proxies are not supported yet. But they should not cause a crash because you set the "ftp_proxy" environment variable! I think you have enough info to file a bug report to the Python bug tracker. The essential statements are in URLopener.open(): url = (host, fullurl) # Signal special case to open_*() Hmm, this bug report appears to be for the same item: http://mail.python.org/pipermail/python-bugs-list/2002-March/010599.html I'm afraid I can't fix this in A-A-P (without replacing urllib). > My python skills are minimal, but after some Googling I found > http://www.python.org/doc/1.5.2p2/lib/module-urllib.html , which seems > to suggest that we should use urlopen() in stead of urlretrieve(). Urlopen() will do the same thing for opening the file. > Bram wrote a while ago to this list: > > > I cannot try this myself, I don't have a proxy server. > > > > Please let me know if this works, I'll add a remark in the > > documentation > > then. Perhaps I should even add a mechanism for setting the proxy in > > the recipe. > > Well, so far it does not seem to work for FTP :-( > > Even without the crash, I can not find any references to proxy > authorisation in the A-A-P or Python documents. Does that mean that > A-A-P and/or Python's urllib-module do not support proxy > authorisation? I don't think so. If you want to know for sure, look in the Python documentation or ask in one of the Python maillists. > I don't know if A-A-P works with a HTTP-proxy, because there is no > HTPP site to download vim-6.1-src1.tar.gz (hint hint ;-) ) There are ftp-to-http sites (can't find a URL right now...). You can even use a site that does ftp downloads by e-mail! Sorry I can't give you real help on this. I did add the ":proxy" command (see ref-commands in the docs). But it won't help you. -- Advice to worms: Sleep late. /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// Creator of Vim - Vi IMproved -- http://www.Vim.org \\\ \\\ Project leader for A-A-P -- http://www.A-A-P.org /// \\\ Help AIDS victims, buy at Amazon -- http://ICCF.nl/click1.html /// |