On 17.03.2016 15:55, Guido van Rossum wrote: > On Thu, Mar 17, 2016 at 5:04 AM, Serhiy Storchaka <storch...@gmail.com> wrote: >>> Should we recommend that everyone use tokenize.detect_encoding()? >> >> Likely. However the interface of tokenize.detect_encoding() is not very >> simple. > > I just found that out yesterday. You have to give it a readline() > function, which is cumbersome if all you have is a (byte) string and > you don't want to split it on lines just yet. And the readline() > function raises SyntaxError when the encoding isn't right. I wish > there were a lower-level helper that just took a line and told you > what the encoding in it was, if any. Then the rest of the logic can be > handled by the caller (including the logic of trying up to two lines).
I've uploaded the code I posted yesterday, modified to address some of the issues it had to github: https://github.com/malemburg/python-snippets/blob/master/detect_source_encoding.py I'm pretty sure the two-lines read can be optimized away and put straight into the regular expression used for matching. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Experts (#1, Mar 18 2016) >>> Python Projects, Coaching and Consulting ... http://www.egenix.com/ >>> Python Database Interfaces ... http://products.egenix.com/ >>> Plone/Zope Database Interfaces ... http://zope.egenix.com/ ________________________________________________________________________ 2016-03-07: Released eGenix pyOpenSSL 0.13.14 ... http://egenix.com/go89 2016-02-19: Released eGenix PyRun 2.1.2 ... http://egenix.com/go88 ::: We implement business ideas - efficiently in both time and costs ::: eGenix.com Software, Skills and Services GmbH Pastor-Loeh-Str.48 D-40764 Langenfeld, Germany. CEO Dipl.-Math. Marc-Andre Lemburg Registered at Amtsgericht Duesseldorf: HRB 46611 http://www.egenix.com/company/contact/ http://www.malemburg.com/ _______________________________________________ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinfo/python-dev Unsubscribe: https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com From openstack-dev-bounces+archive=mail-archive....@lists.openstack.org Sat Mar 19 08:12:23 2016 Return-path: <openstack-dev-bounces+archive=mail-archive....@lists.openstack.org> Envelope-to: arch...@mail-archive.com Delivery-date: Sat, 19 Mar 2016 08:12:23 -0700 Received: from bolt10a.mxthunder.net ([209.105.224.168]) by mail-archive.com with esmtp (Exim 4.76) (envelope-from <openstack-dev-bounces+archive=mail-archive....@lists.openstack.org>) id 1ahIYA-0002fr-Cy for arch...@mail-archive.com; Sat, 19 Mar 2016 08:12:22 -0700 Received: by bolt10a.mxthunder.net (Postfix, from userid 12345) id 3qRVGK3w2Rz19ktG; Fri, 18 Mar 2016 08:56:36 -0700 (PDT) Received: from lists.openstack.org (lists.openstack.org [50.56.173.222]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by bolt10a.mxthunder.net (Postfix) with ESMTPS id 3qRVFs4wjPz19kcC for <arch...@mail-archive.com>; Fri, 18 Mar 2016 08:56:33 -0700 (PDT) Received: from localhost ([127.0.0.1] helo=lists.openstack.org) by lists.openstack.org with esmtp (Exim 4.76) (envelope-from <openstack-dev-boun...@lists.openstack.org>) id 1agwhl-0005a9-59; Fri, 18 Mar 2016 15:52:49 +0000 Received: from g4t3426.houston.hp.com ([15.201.208.54]) by lists.openstack.org with esmtp (Exim 4.76) (envelope-from <graham.ha...@hpe.com>) id 1agwhj-0005YM-O5 for openstack-...@lists.openstack.org; Fri, 18 Mar 2016 15:52:47 +0000 Received: from G4W9121.americas.hpqcorp.net (g4w9121.houston.hp.com [16.210.21.16]) (using TLSv1.2 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by g4t3426.houston.hp.com (Postfix) with ESMTPS id 605A664 for <openstack-...@lists.openstack.org>; Fri, 18 Mar 2016 15:52:47 +0000 (UTC) Received: from G4W9121.americas.hpqcorp.net (16.210.21.16) by G4W9121.americas.hpqcorp.net (16.210.21.16) with Microsoft SMTP Server (TLS) id 15.0.1076.9; Fri, 18 Mar 2016 15:52:38 +0000 Received: from G4W6304.americas.hpqcorp.net (16.210.26.229) by G4W9121.americas.hpqcorp.net (16.210.21.16) with Microsoft SMTP Server (TLS) id 15.0.1076.9 via Frontend Transport; Fri, 18 Mar 2016 15:52:38 +0000 Received: from G9W0750.americas.hpqcorp.net ([169.254.9.246]) by G4W6304.americas.hpqcorp.net ([16.210.26.229]) with mapi id 14.03.0169.001; Fri, 18 Mar 2016 15:52:38 +0000 From: "Hayes, Graham" <graham.ha...@hpe.com> To: "OpenStack Development Mailing List (not for usage questions)" <openstack-...@lists.openstack.org> Thread-Topic: [openstack-dev] [all][infra][ptls] tagging reviews, making tags searchable Thread-Index: AQHRgSbdQRQMpxFOeUKGrubFuR+3RA== Date: Fri, 18 Mar 2016 15:52:37 +0000 Message-ID: <325f898546fbbf4487d24d6d606a277e1b17a...@g9w0750.americas.hpqcorp.net> References: <co2pr17mb0011996cb14f492c0d7525b2a0...@co2pr17mb0011.namprd17.prod.outlook.com> <325f898546fbbf4487d24d6d606a277e1b179...@g9w0750.americas.hpqcorp.net> <co2pr17mb001171632d8debb19f24f76ba0...@co2pr17mb0011.namprd17.prod.outlook.com> Accept-Language: en-IE, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [89.101.195.206] MIME-Version: 1.0 X-Topics: Infrastructure Cross-project coordination Subject: Re: [openstack-dev] [all][infra][ptls] tagging reviews, making tags searchable X-BeenThere: openstack-...@lists.openstack.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: "OpenStack Development Mailing List \(not for usage questions\)" <openstack-...@lists.openstack.org> List-Id: "OpenStack Development Mailing List \(not for usage questions\)" <openstack-dev.lists.openstack.org> List-Unsubscribe: <http://lists.openstack.org/cgi-bin/mailman/options/openstack-dev>, <mailto:openstack-dev-requ...@lists.openstack.org?subject=unsubscribe> List-Archive: <http://lists.openstack.org/pipermail/openstack-dev> List-Post: <mailto:openstack-...@lists.openstack.org> List-Help: <mailto:openstack-dev-requ...@lists.openstack.org?subject=help> List-Subscribe: <http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev>, <mailto:openstack-dev-requ...@lists.openstack.org?subject=subscribe> Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: openstack-dev-bounces+archive=mail-archive....@lists.openstack.org X-MXTHUNDER-Identifier: <325f898546fbbf4487d24d6d606a277e1b17a...@g9w0750.americas.hpqcorp.net> X-MXTHUNDER-IP-Rating: 0, 50.56.173.222, Ugly c=0 p=0 Source New X-MXTHUNDER-Scan-Result: 100 X-MXTHUNDER-Rules: 100-5946975-2903-2922-m 100-5946975-0-8647-f X-MXTHUNDER-Group: Bulk Mail On 18/03/2016 15:00, Amrith Kumar wrote: > Thanks Graham, I was going to use the dashboard creator and this is a good > solution. Will see how I can enable something like this for Trove. I will watch to see how you get on - it might be something I try in Designate. > -amrith > > P.S. Will you be in Austin? Yup! >> -----Original Message----- >> From: Hayes, Graham [mailto:graham.ha...@hpe.com] >> Sent: Friday, March 18, 2016 10:37 AM >> To: OpenStack Development Mailing List (not for usage questions) >> <openstack-...@lists.openstack.org> >> Subject: Re: [openstack-dev] [all][infra][ptls] tagging reviews, making >> tags searchable >> >> On 18/03/2016 14:19, Amrith Kumar wrote: >>> As we were working through reviews for the Mitaka release, the Trove >>> team was trying to track groups of reviews that were needed for a >>> specific milestone, like m-1, or m-3 or in the recent days for rc1. >>> >>> The only way we could find was to have someone (in this instance, me) >>> 'star' the reviews that we wanted and then have people look for >>> reviews with 'starredby:amrith' and status:open. >>> >>> How do other projects do this? Is there a simple way to tag reviews in >>> a searchable way? >>> >>> Thanks, >>> >>> -amrith >>> >> >> Gerrit can support arbitrary "Labels" >> >> if you look at >> >> https://github.com/openstack-infra/project- >> config/blob/d003569acdc68a5065d7043fc3700a9386fbf5cd/gerrit/acls/openstack >> /governance.config#L24-L30 >> >> You can see how the Roll-Call Label is enabled for the governance repo. >> >> This could be set up as "Next-Release" and have it restricted to -cores. >> >> Then a search for: >> >> "project:openstack/trove label:Next-Release=1 status:Open" >> >> would work. >> >> You could also use the gerrit-dash-creator[1] to create a dashboard for >> reviewers. >> >> We do that for designate - I keep >> http://graham.hayes.ie/designate/dashboard up to date with the correct >> link. >> >> Thanks, >> >> Graham >> >> 1 - https://github.com/openstack/gerrit-dash-creator >> >> __________________________________________________________________________ >> OpenStack Development Mailing List (not for usage questions) >> Unsubscribe: openstack-dev-requ...@lists.openstack.org?subject:unsubscribe >> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev > > __________________________________________________________________________ > OpenStack Development Mailing List (not for usage questions) > Unsubscribe: openstack-dev-requ...@lists.openstack.org?subject:unsubscribe > http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev > __________________________________________________________________________ OpenStack Development Mailing List (not for usage questions) Unsubscribe: openstack-dev-requ...@lists.openstack.org?subject:unsubscribe http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev