Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #34339
| Path | csiph.com!usenet.pasdenom.info!dedibox.gegeweb.org!gegeweb.eu!nntpfeed.proxad.net!feeder1-1.proxad.net!proxad.net!feeder1-2.proxad.net!news.tele.dk!news.tele.dk!small.news.tele.dk!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail |
|---|---|
| Return-Path | <nick.cash@npcinternational.com> |
| X-Original-To | python-list@python.org |
| Delivered-To | python-list@mail.python.org |
| X-Spam-Status | OK 0.005 |
| X-Spam-Evidence | '*H*': 0.99; '*S*': 0.00; '2to3': 0.09; 'path,': 0.09; 'file,': 0.15; 'properly': 0.15; '"file': 0.16; 'anymore': 0.16; 'etc...': 0.16; 'python3.': 0.16; 'subject:python3': 0.16; 'url.': 0.16; 'urllib': 0.16; 'specify': 0.17; 'appears': 0.18; 'to:name:python-list@python.org': 0.20; 'http': 0.22; 'to:2**1': 0.23; 'received:169.254': 0.24; 'command': 0.24; 'script': 0.24; 'header:In-Reply-To:1': 0.25; 'skip:" 20': 0.26; 'i.e.': 0.27; 'regular': 0.27; 'convert': 0.29; 'received:169': 0.29; 'header:Received:8': 0.30; 'file': 0.32; 'handle': 0.33; 'to:addr :python-list': 0.33; 'whatever': 0.35; 'received:bigfish.com': 0.35; 'remote': 0.35; 'something': 0.35; 'skip:u 20': 0.36; 'but': 0.36; 'charset:us-ascii': 0.36; 'correctly': 0.37; 'does': 0.37; 'subject:: ': 0.38; 'received:10': 0.38; 'to:addr:python.org': 0.39; 'skip:" 10': 0.40; 'refuses': 0.84 |
| X-Forefront-Antispam-Report | CIP:157.56.240.117; KIP:(null); UIP:(null); IPV:NLI; H:BL2PRD0610HT002.namprd06.prod.outlook.com; RD:none; EFVD:NLI |
| X-SpamScore | -1 |
| X-BigFish | PS-1(zzd772h1432Izz1de0h1202h1d1ah1d2ahzzz2fh2a8h668h839h944hd25hf0ah1220h1288h12a5h12a9h12bdh137ah13b6h1441h1504h1537h153bh15d0h162dh1631h1155h) |
| Received-SPF | pass (mail198-co9: domain of npcinternational.com designates 157.56.240.117 as permitted sender) client-ip=157.56.240.117; envelope-from=nick.cash@npcinternational.com; helo=BL2PRD0610HT002.namprd06.prod.outlook.com ; .outlook.com ; |
| From | Nick Cash <nick.cash@npcinternational.com> |
| To | Olive <diolu.remove_this_part@bigfoot.com>, "python-list@python.org" <python-list@python.org> |
| Subject | RE: urlopen in python3 |
| Thread-Topic | urlopen in python3 |
| Thread-Index | AQHN0zo2Jjm0abmgz06B4EdC55esu5gKzygw |
| Date | Wed, 5 Dec 2012 22:54:32 +0000 |
| References | <20121205234020.76a9d88d@pcolivier.chezmoi.net> |
| In-Reply-To | <20121205234020.76a9d88d@pcolivier.chezmoi.net> |
| Accept-Language | en-US |
| Content-Language | en-US |
| X-MS-Has-Attach | |
| X-MS-TNEF-Correlator | |
| x-originating-ip | [70.166.238.194] |
| Content-Type | text/plain; charset="us-ascii" |
| Content-Transfer-Encoding | quoted-printable |
| MIME-Version | 1.0 |
| X-OriginatorOrg | npcinternational.com |
| X-BeenThere | python-list@python.org |
| X-Mailman-Version | 2.1.15 |
| Precedence | list |
| List-Id | General discussion list for the Python programming language <python-list.python.org> |
| List-Unsubscribe | <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe> |
| List-Archive | <http://mail.python.org/pipermail/python-list/> |
| List-Post | <mailto:python-list@python.org> |
| List-Help | <mailto:python-list-request@python.org?subject=help> |
| List-Subscribe | <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.535.1354748088.29569.python-list@python.org> (permalink) |
| Lines | 14 |
| NNTP-Posting-Host | 2001:888:2000:d::a6 |
| X-Trace | 1354748088 news.xs4all.nl 6842 [2001:888:2000:d::a6]:37880 |
| X-Complaints-To | abuse@xs4all.nl |
| Xref | csiph.com comp.lang.python:34339 |
Show key headers only | View raw
> In python2, this work if "something" is a regular file on the system as > well as a remote URL. The 2to3 script convert this to > urllib.request.urlopen. But it does not work anymore if "something" > is just a file name. > > My aim is to let the user specify a "file" on the command line and have > something that works, whatever the "file " actually is: a regular file, > an http url, etc... A file path, such as "/etc/passwd", isn't properly a URL, so urllib correctly refuses to handle it. You can make it a URL by using the file:// protocol, i.e. "file:///etc/passwd"... which appears to work in both python2 and python3.
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
urlopen in python3 Olive <diolu.remove_this_part@bigfoot.com> - 2012-12-05 23:40 +0100
RE: urlopen in python3 Nick Cash <nick.cash@npcinternational.com> - 2012-12-05 22:54 +0000
Re: urlopen in python3 Olive <diolu.remove_this_part@bigfoot.com> - 2012-12-06 00:42 +0100
csiph-web