Re: [Python-Dev] [RELEASED] Python 3.4.0 release candidate 1
Hi, It would be nice to give also the link to the whole changelog in your emails and on the website: http://docs.python.org/3.4/whatsnew/changelog.html Congrats for your RC1 release :-) It's always hard to make developers stop addings "new minor" changes before the final version :-) Victor 2014-02-11 8:43 GMT+01:00 Larry Hastings : > > On behalf of the Python development team, I'm delighted to announce > the first release candidate of Python 3.4. > > This is a preview release, and its use is not recommended for > production settings. > > Python 3.4 includes a range of improvements of the 3.x series, including > hundreds of small improvements and bug fixes. Major new features and > changes in the 3.4 release series include: > > * PEP 428, a "pathlib" module providing object-oriented filesystem paths > * PEP 435, a standardized "enum" module > * PEP 436, a build enhancement that will help generate introspection >information for builtins > * PEP 442, improved semantics for object finalization > * PEP 443, adding single-dispatch generic functions to the standard library > * PEP 445, a new C API for implementing custom memory allocators > * PEP 446, changing file descriptors to not be inherited by default >in subprocesses > * PEP 450, a new "statistics" module > * PEP 451, standardizing module metadata for Python's module import system > * PEP 453, a bundled installer for the *pip* package manager > * PEP 454, a new "tracemalloc" module for tracing Python memory allocations > * PEP 456, a new hash algorithm for Python strings and binary data > * PEP 3154, a new and improved protocol for pickled objects > * PEP 3156, a new "asyncio" module, a new framework for asynchronous I/O > > Python 3.4 is now in "feature freeze", meaning that no new features will be > added. The final release is projected for mid-March 2014. > > > To download Python 3.4.0rc1 visit: > > http://www.python.org/download/releases/3.4.0/ > > > Please consider trying Python 3.4.0rc1 with your code and reporting any > new issues you notice to: > > http://bugs.python.org/ > > > Enjoy! > > -- > Larry Hastings, Release Manager > larry at hastings.org > (on behalf of the entire python-dev team and 3.4's contributors) > ___ > Python-Dev mailing list > [email protected] > https://mail.python.org/mailman/listinfo/python-dev > Unsubscribe: > https://mail.python.org/mailman/options/python-dev/victor.stinner%40gmail.com ___ Python-Dev mailing list [email protected] https://mail.python.org/mailman/listinfo/python-dev Unsubscribe: https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com
[Python-Dev] [PATCH] Add an authorization header to the initial request.
Many websites (e.g. GitHub API) on the Internet are intentionally not following RFC with regards to the Basic Authorization and require Authorization header in the initial request and they never return 401 error. Therefore it is not possible to authorize with such websites just using urllib2.py HTTPBasicAuthHandler as described in documentation. However, RFC 2617, end of section 2 allows pre-authorization in the initial request: > A client MAY preemptively send the corresponding Authorization > header with requests for resources in that space without > receipt of another challenge from the server. (RFC also suggests preauthorization of proxy requests, but that is not part of this patch, however it could be trivially added) Also, generating HTTP BasicAuth header has been refactored into special method of AbstractBasicAuthHandler. Suggested fix for bug# 19494 This is my first attempt to contribute to Python itself, so please be gentle with me. Yes, I know that I miss unit tests and port to other branches of Python (this is against 2.7), but I would like first some feedback to see what I am missing (aside from the mentioned). Matěj Cepl --- Lib/urllib2.py | 35 +++ 1 file changed, 27 insertions(+), 8 deletions(-) diff --git a/Lib/urllib2.py b/Lib/urllib2.py index aadeb73..a5feb03 100644 --- a/Lib/urllib2.py +++ b/Lib/urllib2.py @@ -848,6 +848,18 @@ class AbstractBasicAuthHandler: def reset_retry_count(self): self.retried = 0 +def generate_auth_header(self, host, req, realm): +user, pw = self.passwd.find_user_password(realm, host) +if pw is not None: +raw = "%s:%s" % (user, pw) +auth = 'Basic %s' % base64.b64encode(raw).strip() +if req.headers.get(self.auth_header, None) == auth: +return None +req.add_unredirected_header(self.auth_header, auth) +return req +else: +return None + def http_error_auth_reqed(self, authreq, host, req, headers): # host may be an authority (without userinfo) or a URL with an # authority @@ -875,14 +887,10 @@ class AbstractBasicAuthHandler: return response def retry_http_basic_auth(self, host, req, realm): -user, pw = self.passwd.find_user_password(realm, host) -if pw is not None: -raw = "%s:%s" % (user, pw) -auth = 'Basic %s' % base64.b64encode(raw).strip() -if req.headers.get(self.auth_header, None) == auth: -return None -req.add_unredirected_header(self.auth_header, auth) -return self.parent.open(req, timeout=req.timeout) +req = self.generate_auth_header(host, req, realm) + +if req is not None: +self.parent.open(req, timeout=req.timeout) else: return None @@ -898,6 +906,17 @@ class HTTPBasicAuthHandler(AbstractBasicAuthHandler, BaseHandler): self.reset_retry_count() return response +def http_request(self, req): +host = req.get_host() + +new_req = self.generate_auth_header(host, req, None) +if new_req is not None: +req = new_req + +return req + +https_request = http_request + class ProxyBasicAuthHandler(AbstractBasicAuthHandler, BaseHandler): -- 1.8.5.2.192.g7794a68 ___ Python-Dev mailing list [email protected] https://mail.python.org/mailman/listinfo/python-dev Unsubscribe: https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com
Re: [Python-Dev] [PATCH] Add an authorization header to the initial request.
On 2/11/2014 6:03 AM, Matěj Cepl wrote: Suggested fix for bug# 19494 This is my first attempt to contribute to Python itself, so please be gentle with me. Yes, I know that I miss unit tests and port to other branches of Python (this is against 2.7), but I would like first some feedback to see what I am missing (aside from the mentioned). Please upload your patch to the issue. If it gets ignored there for a month, join the mentorship list and request a review. -- Terry Jan Reedy ___ Python-Dev mailing list [email protected] https://mail.python.org/mailman/listinfo/python-dev Unsubscribe: https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com
Re: [Python-Dev] [RELEASED] Python 3.4.0 release candidate 1
On Tue, Feb 11, 2014 at 5:45 AM, Terry Reedy wrote: > On 2/11/2014 5:13 AM, Terry Reedy wrote: >> ... >> I installed 64 bit 3.3.4 yesterday with no problem. I reran it today in >> repair mode and again, no problem. >> >> With 64 bit 3.4.0, I get >> "There is a problem with this Windows Installer package. A program >> required for the install to complete could not be run." >> >> No, the generic message does not bother to say *which* program :-(. >> >> 34 bit 3.4.0 installed fine. > > > I wrote too soon. > > Python 3.4.0rc1 (v3.4.0rc1:5e088cea8660, Feb 11 2014, 05:54:25) [MSC import tkinter > Traceback ... > import _tkinter > ImportError: DLL load failed: %1 is not a valid Win32 application. > > So tkinter, Idle, turtle fail and the corresponding tests get skipped. 32 bit and 64 bit both work for me. Windows 7. ___ Python-Dev mailing list [email protected] https://mail.python.org/mailman/listinfo/python-dev Unsubscribe: https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com
Re: [Python-Dev] [PATCH] Add an authorization header to the initial request.
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 2014-02-11, 12:27 GMT, you wrote: >> This is my first attempt to contribute to Python itself, so >> please be gentle with me. Yes, I know that I miss unit tests >> and port to other branches of Python (this is against 2.7), >> but I would like first some feedback to see what I am missing >> (aside from the mentioned). > > Please upload your patch to the issue. If it gets ignored there for a > month, join the mentorship list and request a review. It is there (http://bugs.python.org/file34031/0001-Add-an-authorization-header-to-the-initial-request.patch), but given I am the only on Nose list of the bug, I thought it necessary to make a noise here. Matěj -BEGIN PGP SIGNATURE- Version: GnuPG v2.0.22 (GNU/Linux) iD8DBQFS+h/14J/vJdlkhKwRAoOAAJ9nbR2LI+OPC6B/6LkpFvOnF5B2OwCdFgMg dhTv8f3u9d+Qmmukpmo2b9Y= =lj/m -END PGP SIGNATURE- ___ Python-Dev mailing list [email protected] https://mail.python.org/mailman/listinfo/python-dev Unsubscribe: https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com
Re: [Python-Dev] [PATCH] Add an authorization header to the initial request.
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 02/11/2014 08:04 AM, Matěj Cepl wrote: > On 2014-02-11, 12:27 GMT, you wrote: >>> This is my first attempt to contribute to Python itself, so >>> please be gentle with me. Yes, I know that I miss unit tests >>> and port to other branches of Python (this is against 2.7), but >>> I would like first some feedback to see what I am missing >>> (aside from the mentioned). > >> Please upload your patch to the issue. If it gets ignored there >> for a month, join the mentorship list and request a review. > > It is there > (http://bugs.python.org/file34031/0001-Add-an-authorization-header-to-the-initial-request.patch), > but given I am the only on Nose list of the bug, I thought it > necessary to make a noise here. For people looking for it, that's issue 19494: http://bugs.python.org/issue19494 -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.14 (GNU/Linux) Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBAgAGBQJS+igLAAoJENxauZFcKtNxIioH/RRm1qtQrYDlxzqia1dVegdM dyiD85zVgspmIp1EnszhH2X2QSIAtE3AQgBSmYG7isMZbrGGyiItwFlYLJElgbQg b+rGStCxsVhUEauzPHq6gMpqf8Nmfw+NsS3itZ0M0T41H7G7pEhi4Yep3ruqJ1Rp 21wNVMzck/9Zj8p5YDVncDESotODjNN2HeQDg5drsmROvzMW0nQidoXqfaS+7GXV GTIp4sjW4tJi5771Ob8hR9riEHNU9fQ12hf1z/IwNrsaTHToXa6PAhjGcmLez5Vj Vs66dQYtSki45hP5opNyBaEaaV+9dajs8fiktOeVyGA46UwJ7qyQN3SMNKGW4gg= =jiOU -END PGP SIGNATURE- ___ Python-Dev mailing list [email protected] https://mail.python.org/mailman/listinfo/python-dev Unsubscribe: https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com
[Python-Dev] Is the PIP requirement too strict?
I don't happen to have OpenSSL configured on my OSX dev box right now. This usually leads to some warnings during the build stage and obviously various ssl-based tests don't work, but I can still get other stuff done. But with the latest repo, "make install" refuses to complete -- it ends fatally as follows: if test "xupgrade" != "xno" ; then \ case upgrade in \ upgrade) ensurepip="--upgrade" ;; \ install|*) ensurepip="" ;; \ esac; \ ./python.exe -E -m ensurepip \ $ensurepip --root=/ ; \ fi Traceback (most recent call last): File "/Users/guido/cpython/Lib/runpy.py", line 171, in _run_module_as_main "__main__", mod_spec) File "/Users/guido/cpython/Lib/runpy.py", line 86, in _run_code exec(code, run_globals) File "/Users/guido/cpython/Lib/ensurepip/__main__.py", line 4, in ensurepip._main() File "/Users/guido/cpython/Lib/ensurepip/__init__.py", line 203, in _main default_pip=args.default_pip, File "/Users/guido/cpython/Lib/ensurepip/__init__.py", line 74, in bootstrap _require_ssl_for_pip() File "/Users/guido/cpython/Lib/ensurepip/__init__.py", line 23, in _require_ssl_for_pip raise RuntimeError(_MISSING_SSL_MESSAGE) RuntimeError: pip 1.5.2 requires SSL/TLS make: *** [install] Error 1 Can this failure be suppressed in the Makefile (given that I know what I'm doing)? -- --Guido van Rossum (python.org/~guido) ___ Python-Dev mailing list [email protected] https://mail.python.org/mailman/listinfo/python-dev Unsubscribe: https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com
Re: [Python-Dev] Is the PIP requirement too strict?
On Feb 11, 2014, at 12:30 PM, Guido van Rossum wrote: > I don't happen to have OpenSSL configured on my OSX dev box right now. This > usually leads to some warnings during the build stage and obviously various > ssl-based tests don't work, but I can still get other stuff done. But with > the latest repo, "make install" refuses to complete -- it ends fatally as > follows: > > if test "xupgrade" != "xno" ; then \ > case upgrade in \ > upgrade) ensurepip="--upgrade" ;; \ > install|*) ensurepip="" ;; \ > esac; \ > ./python.exe -E -m ensurepip \ > $ensurepip --root=/ ; \ > fi > Traceback (most recent call last): > File "/Users/guido/cpython/Lib/runpy.py", line 171, in _run_module_as_main > "__main__", mod_spec) > File "/Users/guido/cpython/Lib/runpy.py", line 86, in _run_code > exec(code, run_globals) > File "/Users/guido/cpython/Lib/ensurepip/__main__.py", line 4, in > ensurepip._main() > File "/Users/guido/cpython/Lib/ensurepip/__init__.py", line 203, in _main > default_pip=args.default_pip, > File "/Users/guido/cpython/Lib/ensurepip/__init__.py", line 74, in bootstrap > _require_ssl_for_pip() > File "/Users/guido/cpython/Lib/ensurepip/__init__.py", line 23, in > _require_ssl_for_pip > raise RuntimeError(_MISSING_SSL_MESSAGE) > RuntimeError: pip 1.5.2 requires SSL/TLS > make: *** [install] Error 1 > > Can this failure be suppressed in the Makefile (given that I know what I'm > doing)? > > -- > --Guido van Rossum (python.org/~guido) > ___ > Python-Dev mailing list > [email protected] > https://mail.python.org/mailman/listinfo/python-dev > Unsubscribe: > https://mail.python.org/mailman/options/python-dev/donald%40stufft.io So right now pip doesn’t work without TLS, we’re working on that and our 1.6 release should have that. I *thought* that Nick (I think?) had made it so that you just didn’t get pip if you didn’t have TLS enabled, but apparently not. You can suppress this by doing ``ENSUREPIP=no make install``, but probably this should just print a warning instead of dying when TLS isn’t available. - Donald Stufft PGP: 0x6E3CBCE93372DCFA // 7C6B 7C5D 5E2B 6356 A926 F04F 6E3C BCE9 3372 DCFA signature.asc Description: Message signed with OpenPGP using GPGMail ___ Python-Dev mailing list [email protected] https://mail.python.org/mailman/listinfo/python-dev Unsubscribe: https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com
Re: [Python-Dev] Is the PIP requirement too strict?
Thanks, I discovered ENSUREPIP=no right after posting, but agreed it should print an intelligible error message instead of giving a traceback. On Tue, Feb 11, 2014 at 10:15 AM, Donald Stufft wrote: > On Feb 11, 2014, at 12:30 PM, Guido van Rossum wrote: > > I don't happen to have OpenSSL configured on my OSX dev box right now. > This usually leads to some warnings during the build stage and obviously > various ssl-based tests don't work, but I can still get other stuff done. > But with the latest repo, "make install" refuses to complete -- it ends > fatally as follows: > > if test "xupgrade" != "xno" ; then \ > case upgrade in \ > upgrade) ensurepip="--upgrade" ;; \ > install|*) ensurepip="" ;; \ > esac; \ > ./python.exe -E -m ensurepip \ > $ensurepip --root=/ ; \ > fi > Traceback (most recent call last): > File "/Users/guido/cpython/Lib/runpy.py", line 171, in > _run_module_as_main > "__main__", mod_spec) > File "/Users/guido/cpython/Lib/runpy.py", line 86, in _run_code > exec(code, run_globals) > File "/Users/guido/cpython/Lib/ensurepip/__main__.py", line 4, in > > ensurepip._main() > File "/Users/guido/cpython/Lib/ensurepip/__init__.py", line 203, in _main > default_pip=args.default_pip, > File "/Users/guido/cpython/Lib/ensurepip/__init__.py", line 74, in > bootstrap > _require_ssl_for_pip() > File "/Users/guido/cpython/Lib/ensurepip/__init__.py", line 23, in > _require_ssl_for_pip > raise RuntimeError(_MISSING_SSL_MESSAGE) > RuntimeError: pip 1.5.2 requires SSL/TLS > make: *** [install] Error 1 > > Can this failure be suppressed in the Makefile (given that I know what I'm > doing)? > > -- > --Guido van Rossum (python.org/~guido) > ___ > Python-Dev mailing list > [email protected] > https://mail.python.org/mailman/listinfo/python-dev > Unsubscribe: > https://mail.python.org/mailman/options/python-dev/donald%40stufft.io > > > > So right now pip doesn't work without TLS, we're working on that and our > 1.6 release > should have that. I *thought* that Nick (I think?) had made it so that you > just didn't get pip > if you didn't have TLS enabled, but apparently not. > > You can suppress this by doing ``ENSUREPIP=no make install``, but probably > this should > just print a warning instead of dying when TLS isn't available. > > - > Donald Stufft > PGP: 0x6E3CBCE93372DCFA // 7C6B 7C5D 5E2B 6356 A926 F04F 6E3C BCE9 3372 > DCFA > > -- --Guido van Rossum (python.org/~guido) ___ Python-Dev mailing list [email protected] https://mail.python.org/mailman/listinfo/python-dev Unsubscribe: https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com
[Python-Dev] bugs.python.org/review (DEBUG = True)?
Is there a reason bugs.python.org/review is running in DEBUG mode right now? I was just poking around and came across the debug 'DoesNotExist' error page when accessing: http://bugs.python.org/review/rss/reviews/cjwelborn Then, instead of a 404 I get the 'Page not found' debug page. So, just glancing at the acceptable url patterns I see one that will give you a xsrf token (if you send the appropriate headers, which is easy). I'm not a web expert, so I don't know how dangerous it really is. But the error messages were really helpful (in a bad way?). This turned up an actual error. I'm pretty sure it's an actual error, though I could be wrong. It might be an 'expected error'. When accessing http://bugs.python.org/review/account , I got: KeyError at /review/account: 'AUTH_DOMAIN' /home/roundup/trackers/tracker/rietveld/codereview/views.py in account: domain = os.environ['AUTH_DOMAIN'] Maybe someone is doing some testing and I'm just wasting people's time. I thought it would be better to say something, so if it is a mistake someone can fix it. -- \¯\ /¯/\ \ \/¯¯\/ / / Christopher Welborn (cj) \__/\__/ / cjwelborn at live·com \__/\__/ http://welbornprod.com ___ Python-Dev mailing list [email protected] https://mail.python.org/mailman/listinfo/python-dev Unsubscribe: https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com
Re: [Python-Dev] Is the PIP requirement too strict?
Right, I think this is a genuine bug in the ensurepip CLI mode. http://bugs.python.org/issue19744 was still pending with Tim (to see if it solved the original problem), but we need to more gracefully handle the error at the CLI level as well. ___ Python-Dev mailing list [email protected] https://mail.python.org/mailman/listinfo/python-dev Unsubscribe: https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com
Re: [Python-Dev] Is the PIP requirement too strict?
In article , Guido van Rossum wrote: > I don't happen to have OpenSSL configured on my OSX dev box right now. This > usually leads to some warnings during the build stage and obviously various > ssl-based tests don't work, but I can still get other stuff done. As a side note, you shouldn't have to configure OpenSSL to build any of the current branches of Python on OS X systems. It should build gracefully with the Apple-supplied headers and libssl/libcrypto, modulo possible deprecation warnings in the recent releases of OS X. -- Ned Deily, [email protected] ___ Python-Dev mailing list [email protected] https://mail.python.org/mailman/listinfo/python-dev Unsubscribe: https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com
Re: [Python-Dev] Is the PIP requirement too strict?
To follow up, Ned diagnosed this for me off-list. The cause was my recent upgrade to Mavericks, which causes the Xcode 5 command line tools to be installed differently. In case others have the same issue, the solution was to run: xcode-select --install (and accept the dialog box it pops up). This is a common issue with Mavericks and open-source projects (not just Python); Ned will add something to the README. --Guido On Tue, Feb 11, 2014 at 2:22 PM, Ned Deily wrote: > In article > , > Guido van Rossum wrote: > > I don't happen to have OpenSSL configured on my OSX dev box right now. > This > > usually leads to some warnings during the build stage and obviously > various > > ssl-based tests don't work, but I can still get other stuff done. > > As a side note, you shouldn't have to configure OpenSSL to build any of > the current branches of Python on OS X systems. It should build > gracefully with the Apple-supplied headers and libssl/libcrypto, modulo > possible deprecation warnings in the recent releases of OS X. > > -- > Ned Deily, > [email protected] > > ___ > Python-Dev mailing list > [email protected] > https://mail.python.org/mailman/listinfo/python-dev > Unsubscribe: > https://mail.python.org/mailman/options/python-dev/guido%40python.org > -- --Guido van Rossum (python.org/~guido) ___ Python-Dev mailing list [email protected] https://mail.python.org/mailman/listinfo/python-dev Unsubscribe: https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com
