Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #47963

Re: Must we include urllib just to decode a URL-encoded string, when using Requests?

Path csiph.com!usenet.pasdenom.info!news.albasani.net!newsfeed.freenet.ag!news2.euro.net!newsfeed.xs4all.nl!newsfeed1.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <dotancohen@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.003
X-Spam-Evidence '*H*': 0.99; '*S*': 0.00; 'json': 0.07; 'python3': 0.07; 'skip:u 30': 0.07; 'sys': 0.07; 'urllib2': 0.07; 'subject:string': 0.09; 'subject:using': 0.09; 'cc:addr:python- list': 0.11; 'python': 0.11; 'language,': 0.12; '__future__': 0.16; '_json': 0.16; 'burak': 0.16; 'json.decoder': 0.16; 'json.encoder': 0.16; 'json.scanner': 0.16; 'mimetypes': 0.16; 'subject: \n ': 0.16; 'subject:URL': 0.16; 'subject:when': 0.16; 'urllib': 0.16; 'wrote:': 0.18; 'thu,': 0.19; 'import': 0.22; 'cc:addr:gmail.com': 0.22; 'cc:addr:python.org': 0.22; 'cc:2**1': 0.23; 'logging': 0.26; 'header:In-Reply-To:1': 0.27; 'message- id:@mail.gmail.com': 0.30; 'requests': 0.31; '13,': 0.31; 'cgi': 0.31; 'skip:u 20': 0.35; 'received:google.com': 0.35; 'subject:?': 0.36; 'thank': 0.38; 'pm,': 0.38; 'does': 0.39; 'heard': 0.39; 'skip:u 10': 0.60; 'you.': 0.62; 'show': 0.63; 'url:co': 0.67; 'believe': 0.68; 'six': 0.68; 'beautiful': 0.68; 'now:': 0.74; 'console,': 0.84; 'does!': 0.84; 'subject:Must': 0.84; '4:44': 0.91; '2013': 0.98
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=epqd6znQOt1F5V+f8wOVw6tcIHtisn1vRd+uSeHJ+H4=; b=T9DLhs0nqznLxzJCMJCWASrKyPuW+UYdx7vXr/yTxwy5VgBzDM+nZTIb1z0MBwtfvs NkZ4BgKux+5+VNhLbYYKnbxOr73InPgBXS59rm7WIh92Gk2IJdlQt7xciBk4vkRrLQyf 3kadKecMVnYTJn8KU2ukBD4vuQes14yEXCdo1AtUV45mi2ZIbkH8Xp83Yo/BmuCnM6R1 DuVTc4n1y6nJJbR7eGupZal9Yfr/UpJticvqebpkDlRek2MGLFLk375wjt0hZNyhJqC6 u4FIIkTlQc+P6QKawj5gmdGw3l5cI4jxIxAa4XS6Go+53jyFP8anfEIyxodgtKWKvdf5 +Oog==
MIME-Version 1.0
X-Received by 10.181.13.106 with SMTP id ex10mr644165wid.16.1371131565740; Thu, 13 Jun 2013 06:52:45 -0700 (PDT)
In-Reply-To <51B9CCC5.8090908@arskom.com.tr>
References <CAKDXFkO6t9dkYTrughGL4DzBfAOypia7w34hkmFAN9xext9TWA@mail.gmail.com> <kpcgvj$m7p$1@ger.gmane.org> <CAKDXFkOYUgb-Sw=MK3SpSNPUAO+ubt248E9KX39aK8T7+=ZcUQ@mail.gmail.com> <51B9CCC5.8090908@arskom.com.tr>
Date Thu, 13 Jun 2013 16:52:45 +0300
Subject Re: Must we include urllib just to decode a URL-encoded string, when using Requests?
From Dotan Cohen <dotancohen@gmail.com>
To Burak Arslan <burak.arslan@arskom.com.tr>
Content-Type text/plain; charset=UTF-8
Cc "python-list." <python-list@python.org>, Robert Kern <robert.kern@gmail.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.3195.1371131567.3114.python-list@python.org> (permalink)
Lines 71
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1371131567 news.xs4all.nl 15890 [2001:888:2000:d::a6]:55730
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:47963

Show key headers only | View raw


On Thu, Jun 13, 2013 at 4:44 PM, Burak Arslan
<burak.arslan@arskom.com.tr> wrote:
> On 06/13/13 16:25, Dotan Cohen wrote:
> paste this to your python console, it'll show you what modules requests
> imports:
>
> import sys
> p = set(sys.modules)
> import requests
> for m in sorted(set(sys.modules) - p):
>   print(m)
>

Thank you. Python is a beautiful language, I cannot believe that the
set(sys.modules)-p line does what it does!

Interestingly, on my system with Python3 neither urllib nor urllib2
are imported, only urllib3 which I had not heard of until now:

__future__
_json
atexit
cgi
chardet
html
http.cookiejar
http.cookies
json
json.decoder
json.encoder
json.scanner
logging
mimetypes
netrc
queue
requests
requests.api
requests.auth
requests.compat
requests.cookies
requests.defaults
requests.exceptions
requests.hooks
requests.models
requests.sessions
requests.status_codes
requests.structures
requests.utils
shlex
six
six.moves
threading
urllib3
urllib3._collections
urllib3.connectionpool
urllib3.exceptions
urllib3.filepost
urllib3.packages
urllib3.packages.mimetools_choose_boundary
urllib3.packages.ssl_match_hostname
urllib3.poolmanager
urllib3.request
urllib3.response
urllib3.util


--
Dotan Cohen

http://gibberish.co.il
http://what-is-what.com

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Re: Must we include urllib just to decode a URL-encoded string, when using Requests? Dotan Cohen <dotancohen@gmail.com> - 2013-06-13 16:52 +0300

csiph-web