From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1MpQcq-000392-4H for garchives@archives.gentoo.org; Sun, 20 Sep 2009 17:55:05 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 68998E07CE; Sun, 20 Sep 2009 17:55:02 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 433EAE07CE for ; Sun, 20 Sep 2009 17:55:02 +0000 (UTC) Received: from afta-gentoo.localnet (ip-85-198-235-97.broker.com.pl [85.198.235.97]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTP id 90DB867D80 for ; Sun, 20 Sep 2009 17:55:01 +0000 (UTC) From: Arfrever Frehtes Taifersar Arahesis To: Gentoo Development Subject: Re: [gentoo-dev] Stabilization of Python 3.1 Date: Sun, 20 Sep 2009 19:57:05 +0200 User-Agent: KMail/1.12.1 (Linux/2.6.30-tuxonice-r5-AFTA; KDE/4.3.1; x86_64; ; ) References: <200909191848.33225.Arfrever@gentoo.org> <200909201725.00070.Arfrever@gentoo.org> <8b4c83ad0909201030s1ef74e70l1148f443360ebb51@mail.gmail.com> In-Reply-To: <8b4c83ad0909201030s1ef74e70l1148f443360ebb51@mail.gmail.com> Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-dev@lists.gentoo.org Reply-to: gentoo-dev@lists.gentoo.org MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart3024376.KzQfcIrBUr"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit Message-Id: <200909201957.05957.Arfrever@gentoo.org> X-Archives-Salt: 604214ef-282e-4028-8b57-3408cf3758f0 X-Archives-Hash: 2af3db14e5d2071929fdfef514e2cb4e --nextPart3024376.KzQfcIrBUr Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 2009-09-20 19:30:54 Nirbheek Chauhan napisa=C5=82(a): > On Sun, Sep 20, 2009 at 8:54 PM, Arfrever Frehtes Taifersar Arahesis > wrote: > > 2009-09-20 16:53:37 Jes=C3=BAs Guerrero napisa=C5=82(a): > >> # eselect python set 2 > >> # emerge -s foo > >> File "/usr/bin/emerge", line 41 > >> except PermissionDenied, e: > >> ^ > >> SyntaxError: invalid syntax > >> > >> > >> Ummm, yes, it works *beautifully*, you see. Nothing else to add. > > > > I have fixed it today :) . > > http://sources.gentoo.org/viewcvs.py/portage?rev=3D14289&view=3Drev >=20 > This is silly. portage itself was broken with python-3.1 and you want > to stabilize it? You should distinguish between Python version used by Portage and Python version used by packages which can be installed by Portage. > Actually, how did you make portage work with both 2.x and 3.x at the > same time? Portage doesn't yet work with Python 3, but it hopefully change soon. > I would be very interested to know this since afaik no useful program > can work with both python-3 and python-2 with the same code. It isn't hard to write code which works with both Python 2.6 and 3.*. Example: $ cat get_protocol.py #!/usr/bin/env python # It allows to use print() function in 2.6. from __future__ import print_function import sys try: # Python 3 from urllib.parse import urlparse as urllib_parse_urlparse except ImportError: # Python 2 from urlparse import urlparse as urllib_parse_urlparse if len(sys.argv) !=3D 2: sys.stderr.write("This script requires 1 argument: URL\n") def get_protocol(url): return urllib_parse_urlparse(url)[0] print("Protocol:", get_protocol(sys.argv[1])) $ ./get_protocol.py http://www.example.com Protocol: http =2D-=20 Arfrever Frehtes Taifersar Arahesis --nextPart3024376.KzQfcIrBUr Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.13 (GNU/Linux) iEYEABECAAYFAkq2bPEACgkQIEGVSeBq/j7oOwCcD/Z451l79Hyk0rwX67wV+gSj t5gAnAjDaF4s3FcG2PT4Ulbd6choamCV =Vh9h -----END PGP SIGNATURE----- --nextPart3024376.KzQfcIrBUr--