Ned Deily | 1 Aug 2011 01:06
Picon
Favicon
Gravatar

Re: urllib bug in Python 3.2.1?

In article <4E35DC94.2090208 <at> mrabarnett.plus.com>,
 MRAB <python <at> mrabarnett.plus.com> wrote:
> Someone over at StackOverflow has a problem with urlopen in Python 3.2.1:
> 
>  
> http://stackoverflow.com/questions/6892573/problem-with-urlopen/6892843#689284
> 3
> 
> This is the code:
> 
>      from urllib.request import urlopen
>      f = 
> urlopen('http://online.wsj.com/mdc/public/page/2_3020-tips.html?mod=topnav_2_3
> 000')
>      page = f.read()
>      f.close()
> 
> With Python 3.1 and Python 3.2.1 it works OK, but with Python 3.2.1 the
> read returns an empty string (I checked it myself).

http://bugs.python.org/issue12576

--

-- 
 Ned Deily,
 nad <at> acm.org

Nadeem Vawda | 2 Aug 2011 10:17
Picon

Re: [Python-checkins] cpython: Issue #11651: Move options for running tests into a Python script.

Thanks for catching that. Fixed in 0b52b6f1bfab.

Nadeem
Stefan Krah | 2 Aug 2011 10:48

Re: [Python-checkins] cpython (3.2): Skip test_getsetlocale_issue1813() on Fedora due to setlocale() bug.

R. David Murray <rdmurray <at> bitdance.com> wrote:
> On Tue, 02 Aug 2011 01:22:03 +0200, stefan.krah <python-checkins <at> python.org> wrote:
> >   Skip test_getsetlocale_issue1813() on Fedora due to setlocale() bug.
> > See: https://bugzilla.redhat.com/show_bug.cgi?id=726536
> > +     <at> unittest.skipIf(linux_distribution()[0] == 'Fedora', "Fedora setlocale() "
> > +                     "bug: https://bugzilla.redhat.com/show_bug.cgi?id=726536")
> 
> Why 'Fedora'?  This bug affects more than just Fedora:  as I reported on
> the issue, I'm seeing it on Gentoo as well.  (Also, including the issue
> number in the commit message is helpful).
> 
> Note that since the bug report says that "Gentoo has been including this
> fix for two years", the fact that it is failing on my Gentoo system
> would seem to indicate that something about the fix is not right.
> 
> So, I'm not sure this skip is even valid.  I'm not sure we've finished
> diagnosing the bug.

Fedora's glibc has an additional issue with the Turkish 'I' that can
be reproduced by the simple C program in:

  https://bugzilla.redhat.com/show_bug.cgi?id=726536

I disabled the test specifically on Fedora because it a) seems to be the
only Linux buildbot where this test fails and b) this does not seem
like a Python issue to me.

Since you say that the fix for issue #1813 might not be right, do
you think that the fix should work around this glibc issue?

(Continue reading)

Ronald Oussoren | 2 Aug 2011 10:40
Picon

Re: [Python-checkins] cpython (3.2): Skip test_getsetlocale_issue1813() on Fedora due to setlocale() bug.


On 2 Aug, 2011, at 4:22, R. David Murray wrote:

> On Tue, 02 Aug 2011 01:22:03 +0200, stefan.krah <python-checkins <at> python.org> wrote:
>> http://hg.python.org/cpython/rev/68b5f87566fb
>> changeset:   71683:68b5f87566fb
>> branch:      3.2
>> parent:      71679:1f9ca1819d7c
>> user:        Stefan Krah <skrah <at> bytereef.org>
>> date:        Tue Aug 02 01:06:16 2011 +0200
>> summary:
>>  Skip test_getsetlocale_issue1813() on Fedora due to setlocale() bug.
>> See: https://bugzilla.redhat.com/show_bug.cgi?id=726536
>> 
>> files:
>>  Lib/test/test_locale.py |  3 +++
>>  1 files changed, 3 insertions(+), 0 deletions(-)
>> 
>> 
>> diff --git a/Lib/test/test_locale.py b/Lib/test/test_locale.py
>> --- a/Lib/test/test_locale.py
>> +++ b/Lib/test/test_locale.py
>>  <at>  <at>  -1,4 +1,5  <at>  <at> 
>> from test.support import run_unittest, verbose
>> +from platform import linux_distribution
>> import unittest
>> import locale
>> import sys
>>  <at>  <at>  -391,6 +392,8  <at>  <at> 
>>         # crasher from bug #7419
(Continue reading)

Stefan Krah | 2 Aug 2011 12:12

Re: [Python-checkins] cpython (3.2): Skip test_getsetlocale_issue1813() on Fedora due to setlocale() bug.

Stefan Krah <stefan <at> bytereef.org> wrote:
> Fedora's glibc has an additional issue with the Turkish 'I' that can
> be reproduced by the simple C program in:
> 
>   https://bugzilla.redhat.com/show_bug.cgi?id=726536

OK, this runs successfully on Ubuntu Lucid and FreeBSD (if you change
the first tr_TR to tr_TR.UTF-8).

But it fails on Debian lenny, as does test_getsetlocale_issue1813().

I suspect many buildbots are green because they don't have tr_TR and
tr_TR.iso8859-9 installed.

Synopsis for the people who don't want to wade through the bug reports:

If this is a valid C program ...

#include <stdio.h>
#include <locale.h>
int
main(void)
{
    char *s;
    printf("%s\n", setlocale(LC_CTYPE, "tr_TR"));
    printf("%s\n", setlocale(LC_CTYPE, NULL));
    s = setlocale(LC_CTYPE, "tr_TR.ISO8859-9");
    printf("%s\n", s ? s : "null");
    return 0;
}
(Continue reading)

Scott Dial | 2 Aug 2011 12:20
Favicon

Re: [Python-checkins] cpython (3.2): Skip test_getsetlocale_issue1813() on Fedora due to setlocale() bug.

On 8/2/2011 4:48 AM, Stefan Krah wrote:
> R. David Murray <rdmurray <at> bitdance.com> wrote:
>> If there are any helpful tests I can run on Gentoo, please let me know.
> 
> Yes, you could run the small test program. If you get the same results
> as on Fedora, then I wonder why the Gentoo buildbots are green.
> 
> Do they have tr_TR and tr_TR.iso88599 installed? 

Highly doubtful. It is a normal part of the Gentoo install process to
select the locales that you want for the system. Even the example list
of locales doesn't include any Turkish locales, so one would've had to
gone to specific effort to add that one.

--

-- 
Scott Dial
scott <at> scottdial.com
R. David Murray | 2 Aug 2011 13:31
Gravatar

Re: [Python-checkins] cpython (3.2): Skip test_getsetlocale_issue1813() on Fedora due to setlocale() bug.

On Tue, 02 Aug 2011 12:12:37 +0200, Stefan Krah <stefan <at> bytereef.org> wrote:
> Stefan Krah <stefan <at> bytereef.org> wrote:
> > Fedora's glibc has an additional issue with the Turkish 'I' that can
> > be reproduced by the simple C program in:
> > 
> >   https://bugzilla.redhat.com/show_bug.cgi?id=726536
> 
> OK, this runs successfully on Ubuntu Lucid and FreeBSD (if you change
> the first tr_TR to tr_TR.UTF-8).
> 
> But it fails on Debian lenny, as does test_getsetlocale_issue1813().
> 
> I suspect many buildbots are green because they don't have tr_TR and
> tr_TR.iso8859-9 installed.

This is true for my Gentoo buildbots.  Once we've figured out the
best way to handle this, I'll fix that (install the other locales) for
my two.

> Synopsis for the people who don't want to wade through the bug reports:
> 
> If this is a valid C program ...
> 
> #include <stdio.h>
> #include <locale.h>
> int
> main(void)
> {
>     char *s;
>     printf("%s\n", setlocale(LC_CTYPE, "tr_TR"));
(Continue reading)

Antoine Pitrou | 2 Aug 2011 14:16

Re: cpython (3.2): Fix closes Issue12676 - Invalid identifier used in TypeError message in

On Tue, 02 Aug 2011 12:33:55 +0200
senthil.kumaran <python-checkins <at> python.org> wrote:
>                  raise TypeError("data should be a bytes-like object\
> -                        or an iterable, got %r " % type(it))
> +                        or an iterable, got %r " % type(data))

There are still a lot of spaces in your message. You should use string
literal concatenation instead:

                raise TypeError(
                        "data should be a bytes-like object "
                        "or an iterable, got %r"
                        % type(data))

Chris Withers | 2 Aug 2011 19:48
Picon

Re: email-6.0.0.a1

On 19/07/2011 22:21, R. David Murray wrote:
> The basic additional API is that a 'source' attribute contains the
> text the generator read from the input source, and a 'value' attribute
> that contains the value with all the Content-Transfer-Encoding stuff
> undone so that you have a real unicode string.  By changing a policy
> setting, you can have that value as the string value of the header.
> You can also assign a string with non-ASCII characters to a header, and
> the right thing will happen.  (Well, eventually it will happen...right
> now it only works correctly for unstructured headers).  Further, Date
> headers have a datetime attribute (and accept being set to a datetime),
> and address headers have attributes for accessing the individual addresses
> in the header.  Other structured headers will eventually grow additional
> attributes as well.

This all sounds pretty awesome, congrats :-)

Has the header wrapping bug that was all part of the big headers mess 
been resolved now?

cheers,

Chris

--

-- 
Simplistix - Content Management, Batch Processing & Python Consulting
             - http://www.simplistix.co.uk
Antoine Pitrou | 3 Aug 2011 00:42

Re: cpython: NEWS note for bbeda42ea6a8

On Wed, 03 Aug 2011 00:30:41 +0200
benjamin.peterson <python-checkins <at> python.org> wrote:
> 
> diff --git a/Misc/NEWS b/Misc/NEWS
> --- a/Misc/NEWS
> +++ b/Misc/NEWS
>  <at>  <at>  -10,6 +10,8  <at>  <at> 
>  Core and Builtins
>  -----------------
>  
> +- Add ThreadError to threading.__all__.
> +

This should surely be in the library section.

Regards

Antoine.


Gmane