Re: [Python-Dev] [Python-checkins] cpython: Issue #11049: adding some tests to test.support

2011-07-26 Thread Brett Cannon
On Tue, Jul 26, 2011 at 17:41, Nick Coghlan  wrote:

> On Wed, Jul 27, 2011 at 12:10 AM, Éric Araujo  wrote:
> > Le 26/07/2011 15:30, Antoine Pitrou a écrit :
> >> Actually, you want %a for non-ASCII messages to be escaped.
> >
> > Thanks for the reminder, I should use more %a instead of %r.  In the
> > packaging code however, we can’t, given that we want to backport.
> >
> >> (however, there's hardly any reason to worry about it when it comes to
> >> stdlib module names)
> >
> > I lacked context to see that.  If the code in question only ever handles
> > stdlib modules, then okay.
>
> The other reason to use %r is to get the enclosing quotes in the
> displayed message. That reason applies even in cases like this where
> the escaping aspect isn't a concern.
>

And then you make it {!r} so you can use str.format and you complete the
tweak of the string formatting! =) Seriously, though, it wouldn't hurt to
update it to use str.format().
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] [Python-checkins] cpython: Issue #11049: adding some tests to test.support

2011-07-26 Thread Nick Coghlan
On Wed, Jul 27, 2011 at 12:10 AM, Éric Araujo  wrote:
> Le 26/07/2011 15:30, Antoine Pitrou a écrit :
>> Actually, you want %a for non-ASCII messages to be escaped.
>
> Thanks for the reminder, I should use more %a instead of %r.  In the
> packaging code however, we can’t, given that we want to backport.
>
>> (however, there's hardly any reason to worry about it when it comes to
>> stdlib module names)
>
> I lacked context to see that.  If the code in question only ever handles
> stdlib modules, then okay.

The other reason to use %r is to get the enclosing quotes in the
displayed message. That reason applies even in cases like this where
the escaping aspect isn't a concern.

Cheers,
Nick.

-- 
Nick Coghlan   |   ncogh...@gmail.com   |   Brisbane, Australia
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


[Python-Dev] ESHUTDOWN

2011-07-26 Thread Antoine Pitrou

Some more digging indicates that ESHUTDOWN appears in asyncore with the
following commit:

changeset:   10934:c089020a7a1e
branch:  legacy-trunk
user:Guido van Rossum 
date:Tue Jun 08 13:20:05 1999 +
files:   Lib/asynchat.py Lib/asyncore.py
description:
Sam's latest versions


while it appears in errnomodule.c with the following commit:

changeset:   3804:48776bf4bd49
branch:  legacy-trunk
user:Guido van Rossum 
date:Wed Jul 24 00:51:51 1996 +
files:   Modules/Setup.in Modules/errnomodule.c
description:
Added Sam Rushing's errno module


It also seems that WSAESHUTDOWN can be returned under Windows by
send(), rather than EPIPE:

“WSAESHUTDOWN

The socket has been shut down; it is not possible to send on a socket
after shutdown has been invoked with how set to SD_SEND or SD_BOTH.”

Regards

Antoine.


___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Comments of the PEP 3151

2011-07-26 Thread Antoine Pitrou
On Tue, 26 Jul 2011 19:32:56 -0400
Glyph Lefkowitz  wrote:
> 
> On Jul 26, 2011, at 6:49 PM, Antoine Pitrou wrote:
> 
> > On Mon, 25 Jul 2011 15:28:47 +1000
> > Nick Coghlan  wrote:
> >> There may be some error codes that we choose to map to these generic
> >> errors, even if we don't give them their own exception types at this
> >> point (e.g. ECONSHUTDOWN could map directly to ConnectionError).
> > 
> > Ok, I can find neither ECONSHUTDOWN nor ECONNSHUTDOWN on
> > www.opengroup.org, and it's not mentioned in errnomodule.c.  Is it some
> > system-specific error code?
> 
> I assume that ESHUTDOWN is the errno in question?  (This is also already 
> mentioned in the PEP.)

Indeed, I mentioned it in the PEP, as it appears in asyncore.py.
But I can't find it on www.opengroup.org, and no man page on my Linux
system (except the "errno" man page) seems to mention it.

The description from errnomodule.c says "Cannot send after transport
endpoint shutdown", but send() actually returns EPIPE, not ESHUTDOWN,
when the socket has been shutdown:

>>> conn = socket.create_connection(("www.python.org", 80))
>>> conn.shutdown(socket.SHUT_WR)
>>> conn.send(b"xxx")
Traceback (most recent call last):
  File "", line 1, in 
socket.error: [Errno 32] Broken pipe

>From the send() man page:

   EPIPE  The  local  end has been shut down on a connection
   oriented socket.  In this case the process will also receive a
   SIGPIPE unless MSG_NOSIGNAL is set.

Regards

Antoine.
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Comments of the PEP 3151

2011-07-26 Thread Glyph Lefkowitz

On Jul 26, 2011, at 6:49 PM, Antoine Pitrou wrote:

> On Mon, 25 Jul 2011 15:28:47 +1000
> Nick Coghlan  wrote:
>> There may be some error codes that we choose to map to these generic
>> errors, even if we don't give them their own exception types at this
>> point (e.g. ECONSHUTDOWN could map directly to ConnectionError).
> 
> Ok, I can find neither ECONSHUTDOWN nor ECONNSHUTDOWN on
> www.opengroup.org, and it's not mentioned in errnomodule.c.  Is it some
> system-specific error code?

I assume that ESHUTDOWN is the errno in question?  (This is also already 
mentioned in the PEP.)

___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Comments of the PEP 3151

2011-07-26 Thread Antoine Pitrou
On Mon, 25 Jul 2011 15:28:47 +1000
Nick Coghlan  wrote:
> There may be some error codes that we choose to map to these generic
> errors, even if we don't give them their own exception types at this
> point (e.g. ECONSHUTDOWN could map directly to ConnectionError).

Ok, I can find neither ECONSHUTDOWN nor ECONNSHUTDOWN on
www.opengroup.org, and it's not mentioned in errnomodule.c.  Is it some
system-specific error code?

Regards

Antoine.


___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] [Python-checkins] cpython (merge 3.2 -> default): Issue #12102: Merge with 3.2.

2011-07-26 Thread Antoine Pitrou

Hi,

> > But this i tell you - if i would be an italian.. then i.. would..
> > Viva la mamma - per que!!!
> 
> Sob.
> 
> This is **NOT** offensive against just anybody.
> (Except maybe that i don't take *myself* too seriously, because
> doing so is a bit strange on a planet which disappears in some
> billion years, at which time i'll be gone and away.  At latest.)
> But especially *NOT* against italians.
> I *love* Italy!  I'm a german!!

Well I don't think anyone would take it as offensive.

However, obscure jokes without any context don't (IMHO) make your
messages very readable either, and I think they would benefit from
being concise and to the point ;)

Hope that helps.

Regards

Antoine.


___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


[Python-Dev] hard linking executables

2011-07-26 Thread Antoine Pitrou

Ok, apparently the decision to make hard links for executables dates at
least back to:

changeset:   16221:588691f806f4
branch:  legacy-trunk
user:Neil Schemenauer 
date:Wed Jan 24 17:11:43 2001 +
files:   Makefile.pre.in
description:
Flat makefile based on toplevel Makefile.in and makefiles in build
subdirectories.  Those other makefiles will go away eventually.

[...]

+# Install the interpreter (by creating a hard link to python$(VERSION))
+bininstall:altbininstall
+   -if test -f $(BINDIR)/$(PYTHON); \
+   then rm -f $(BINDIR)/$(PYTHON); \
+   else true; \
+   fi
+   (cd $(BINDIR); $(LN) python$(VERSION)$(EXEEXT) python$(EXEEXT))
+


Regards

Antoine.


___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] [Python-checkins] cpython (merge 3.2 -> default): Issue #12102: Merge with 3.2.

2011-07-26 Thread Steffen Daode Nurpmeso
I was contacted off-list due to anxiety about cleanliness of
python-dev in respect to the following lines:

> But this i tell you - if i would be an italian.. then i.. would..
> Viva la mamma - per que!!!

Sob.

This is **NOT** offensive against just anybody.
(Except maybe that i don't take *myself* too seriously, because
doing so is a bit strange on a planet which disappears in some
billion years, at which time i'll be gone and away.  At latest.)
But especially *NOT* against italians.
I *love* Italy!  I'm a german!!

I'm actually talking about
http://www.youtube.com/watch?v=czjGpFyS-5w here, though i feel
more like http://www.youtube.com/watch?v=lblz8g5mQRk now.
(Aah, Branduardi.  He's a good one.)

Hm.  Maybe "that" Italy is gone now though, i haven't been
there for some years ...  But that is something completely
different.  (Dunno - is it still possible to do sightseeing?
We here in Germany do have some ancient Rome stuff in good
condition, just in case it would be needed?
Hey - you know where you can find it ...)

Yes, yes, i *love* France, too!
My lovely woman and i came together during a short trip to France,
20 years ago.  [Maybe we will spend our old days there, if we can
afford it (and i'm able to learn the language).  But *i* also can
imagine some italian island south-of-Rome for that purpose.]

But first i was there due to a city partnership, in 1985, football
(aeh - this one you play with your feet) tournament.  Small town.
Played the german national anthem.  Played the french national
anthem.  Sorry, maybe i misunderstood "Marchons, marchons".  The
french boys grinned anyway.  I was a german goalkeeper, then.

And my guest-family (little farmer) grilled their major ()
rooster for me (and a second boy they hosted).  I mean -
i wouldn't have grilled a lion (heraldic animal) if they came to
Hessen in turn!  Isn't that a bit strange??  Luckily i already
knew the meaning of "Je ne regrette rien".  (Aah - Edith Piaf!!)
But the farmers wife stated "NO RIEN!!  NO RIEN!!!" in turn!

Can you imagine that?
Such an aggressive rooster!!!
Even dead.  Even *completely* eaten up!

I can tell you.  The worst thing was that i couldn't go to toilet
for those three days, because - it was *soo* shitty!

Sob.

Just in case i won't get blacklisted: next time i'm contacted
off-list i'll tell the story when our football (with the feet,
with your feet!) team went to Poland due to city partnership in
the year after tchernobyl.  And guess who talked :) to the mayor
of the city?  Hah!!

[Nose blow.]

Oh, and before i forget it: my boys (Football - feet!) were mostly
Turks, one Moroccan, one Italian (!), Andreas from Poland
(fantastic defender on the left side!) and less than 50% germans.
And we were a really good *playing* youth team.  No, not always
the winning team.

Horsy horse says Nighty night.

--Steffen
Ciao, sdaoden(*)(gmail.com)
ASCII ribbon campaign   ( ) More nuclear fission plants
  against HTML e-mailXcan serve more coloured
and proprietary attachments / \ and sounding animations
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] [Python-checkins] cpython (2.7): Issue #8746: Correct faulty configure checks so that os.chflags() and

2011-07-26 Thread Ned Deily
In article <4e2ed1a3.3050...@netwok.org>,
 Eric Araujo  wrote:
> > changeset:   71030:abfe28e7e5cd
> > branch:  2.7
> > user:Ned Deily 
> 
> > diff --git a/Lib/test/test_posix.py b/Lib/test/test_posix.py
> > --- a/Lib/test/test_posix.py
> > +++ b/Lib/test/test_posix.py
> > @@ -11,10 +11,12 @@
> >  import os
> >  import pwd
> >  import shutil
> > +import stat
> >  import sys
> >  import unittest
> >  import warnings
> >  
> > +_DUMMY_SYMLINK = '%s/dummy-symlink' % os.getenv('TMPDIR', '/tmp')
> 
> Why not let the tempfile module do this for you?

I didn't feel it was worthwhile modifying the OP's submitted working 
patch.  But, since you've pointed it out, I've modified the test to use 
tempfile and randomize the symlink file name as well.

-- 
 Ned Deily,
 n...@acm.org

___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] [Python-checkins] cpython: Issue #11784: Improve multiprocessing.Process.join() documentation. Patch by

2011-07-26 Thread Charles-François Natali
> There’s a dedicated file to thank doc contributors: Doc/ACKS.rst

I didn't know about this file, thanks.
In my "defense", there's this comment at the top of Misc/ACKS:
"""
This list is not complete and not in any useful order, but I would
like to thank everybody who contributed in any way, with code, hints,
bug reports, ideas, moral support, endorsement, or even complaints
Without you, I would've stopped working on Python long ago!

--Guido
"""

What's the rationale for having a dedicated file?
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] [PEPs] Rebooting PEP 394 (aka Support the /usr/bin/python2 symlink upstream)

2011-07-26 Thread Ned Deily
In article <4e2ee813.1080...@netwok.org>,
 Éric Araujo  wrote:

> Le 26/07/2011 18:05, Antoine Pitrou a écrit :
> > Le mardi 26 juillet 2011 à 10:56 -0500, Kerrick Staley a écrit :
> >> I'm indifferent either way. python3 is a hard link to python3.2, so I
> >> thought we'd make everything that way for consistency.
> > Is it? Yikes, I didn't know about that. 
> Yikes for me too.  I’ve had a quick look at the Makefile (look for
> $(LN)) and found that all scripts use symbolic links, but the python3 to
> python3.y link is hard.  I wonder why this is.

I pointed that out earlier in the thread:

"But if you look at the Python 3 "bininstall" target (Makefile.pre.in 
starting around line 870 or so), you'll see that, for Python 3, symlinks 
are made for all the versioned files except "python3".  I'm not sure 
that there is a particular reason why a distinction was made;  IIRC, the 
other versioned links were added later in the cycle.  The other Python 3 
versioned links could probably be changed to hard links as well.  In the 
end, I don't think it makes a lot of difference.  But it would be better 
if Python 2 and Python 3 were consistent here."

I don't think it makes all that much difference one way or the other.  
But it would be better for them all to be one kind or the other.

-- 
 Ned Deily,
 n...@acm.org

___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] [PEPs] Rebooting PEP 394 (aka Support the /usr/bin/python2 symlink upstream)

2011-07-26 Thread Éric Araujo
Le 26/07/2011 18:05, Antoine Pitrou a écrit :
> Le mardi 26 juillet 2011 à 10:56 -0500, Kerrick Staley a écrit :
>> I'm indifferent either way. python3 is a hard link to python3.2, so I
>> thought we'd make everything that way for consistency.
>
> Is it? Yikes, I didn't know about that.

Yikes for me too.  I’ve had a quick look at the Makefile (look for
$(LN)) and found that all scripts use symbolic links, but the python3 to
python3.y link is hard.  I wonder why this is.

FTR, downstream packagers may change this.  Example on Debian:

/usr/bin/python3: symbolic link to `python3.2'
/usr/bin/python3.2:   symbolic link to `python3.2mu'

Cheers
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] [PEPs] Rebooting PEP 394 (aka Support the /usr/bin/python2 symlink upstream)

2011-07-26 Thread Antoine Pitrou
Le mardi 26 juillet 2011 à 10:56 -0500, Kerrick Staley a écrit :
> I'm indifferent either way. python3 is a hard link to python3.2, so I
> thought we'd make everything that way for consistency.

Is it? Yikes, I didn't know about that.

Regards

Antoine.


___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] [Python-checkins] cpython (merge 3.2 -> default): Issue #12102: Merge with 3.2.

2011-07-26 Thread Ross Lagerwall
> We don’t add NEWS entries for each and every doc fix, otherwise it would
> be very huge :)  We rather document large changes to the documentation,
> like adding links to the source files, using “python3” instead of
> “python” in all examples, etc.  In addition, Library is the wrong
> section, it should be Documentation.
> 
> I’m doing commits this afternoon, so I’ll take the occasion to remove
> this entry.
> 

Thanks for the heads up. I'll keep it in mind for next time.

Cheers
Ross

___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] [PEPs] Rebooting PEP 394 (aka Support the /usr/bin/python2 symlink upstream)

2011-07-26 Thread Kerrick Staley
I'm indifferent either way. python3 is a hard link to python3.2, so I
thought we'd make everything that way for consistency. Higher-level
links (python/idle/pydoc/python-config) have to be soft links so that
if, e.g., python points to python3, and python3 is then pointed to
another location, python also gets changed.

-Kerrick Staley
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] [Python-checkins] cpython (merge 3.2 -> default): Issue #12102: Merge with 3.2.

2011-07-26 Thread Éric Araujo
Hi,

> Murmur... but it hits me little: where is the difference in
> between Doc/ACKS.txt and Misc/ACKS?

Doc/ACKS.txt is used for doc contributions, Misc/ACKS for other
contributions (but sometimes doc too!).  Doc/A is also displayed on
docs.python.org whereas Misc/A is only readable in tarballs.

We talked about merging them a little time ago; I have to check my
archives, I don’t remember what issues there were.

Regards
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] [Python-checkins] cpython (merge 3.2 -> default): Issue #12102: Merge with 3.2.

2011-07-26 Thread Steffen Daode Nurpmeso
@ Éric Araujo  wrote (2011-07-26 15:17+0200):
> > [.]
> >   Doc/library/mmap.rst |  6 ++
> > [.]
> > +  with mmap. Patch by Steffen Daode Nurpmeso.
> 
> I’m doing commits this afternoon, so I’ll take the occasion to remove
> this entry.

Murmur... but it hits me little: where is the difference in
between Doc/ACKS.txt and Misc/ACKS?
I'm mentioned in the latter (on multiple branches), but not at all
in the former.

Sob.

But this i tell you - if i would be an italian.. then i.. would..

SOB!!

Viva la mamma - per que!!!

--Steffen
Ciao, sdaoden(*)(gmail.com)
ASCII ribbon campaign   ( ) More nuclear fission plants
  against HTML e-mailXcan serve more coloured
and proprietary attachments / \ and sounding animations
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] [Python-checkins] cpython (2.7): Issue #8746: Correct faulty configure checks so that os.chflags() and

2011-07-26 Thread Éric Araujo
Hi,

> changeset:   71030:abfe28e7e5cd
> branch:  2.7
> user:Ned Deily 

> diff --git a/Lib/test/test_posix.py b/Lib/test/test_posix.py
> --- a/Lib/test/test_posix.py
> +++ b/Lib/test/test_posix.py
> @@ -11,10 +11,12 @@
>  import os
>  import pwd
>  import shutil
> +import stat
>  import sys
>  import unittest
>  import warnings
>  
> +_DUMMY_SYMLINK = '%s/dummy-symlink' % os.getenv('TMPDIR', '/tmp')

Why not let the tempfile module do this for you?

Regards
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] [Python-checkins] cpython: Issue #11049: adding some tests to test.support

2011-07-26 Thread Éric Araujo
Le 26/07/2011 15:30, Antoine Pitrou a écrit :
> Actually, you want %a for non-ASCII messages to be escaped.

Thanks for the reminder, I should use more %a instead of %r.  In the
packaging code however, we can’t, given that we want to backport.

> (however, there's hardly any reason to worry about it when it comes to
> stdlib module names)

I lacked context to see that.  If the code in question only ever handles
stdlib modules, then okay.

Cheers
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] [Python-checkins] cpython: Issue #11784: Improve multiprocessing.Process.join() documentation. Patch by

2011-07-26 Thread Éric Araujo
> changeset:   71499:8d67fd820627
> parent:  71497:4898b14dcd69
> user:Charles-François Natali 
> date:Mon Jul 25 18:35:49 2011 +0200
> summary:
>   Issue #11784: Improve multiprocessing.Process.join() documentation. Patch by
> Patrick Sabin.
> 
> files:
>   Doc/library/multiprocessing.rst |  7 +++
>   Misc/ACKS   |  1 +

There’s a dedicated file to thank doc contributors: Doc/ACKS.rst

Regards
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] [Python-checkins] cpython: Issue #11049: adding some tests to test.support

2011-07-26 Thread Antoine Pitrou
On Tue, 26 Jul 2011 15:20:55 +0200
Éric Araujo  wrote:
> > 
> > diff --git a/Lib/test/support.py b/Lib/test/support.py
> > --- a/Lib/test/support.py
> > +++ b/Lib/test/support.py
> > @@ -170,7 +170,7 @@
> >  attribute = getattr(obj, name)
> >  except AttributeError:
> >  raise unittest.SkipTest("module %s has no attribute %s" % (
> > -obj.__name__, name))
> > +repr(obj), name))
> 
> I would use %r instead of %s for both fields here.  Non-ASCII characters
> and unseen whitespace are at least two reasons to overuse %r in
> debug/error messages instead of %s.

Actually, you want %a for non-ASCII messages to be escaped.
(however, there's hardly any reason to worry about it when it comes to
stdlib module names)

Regards

Antoine.


___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] [Python-checkins] cpython: Issue #11049: adding some tests to test.support

2011-07-26 Thread Éric Araujo
Hi,

> changeset:   71465:be558ad15789
> user:Eli Bendersky 
> summary:
>   Issue #11049: adding some tests to test.support
> Based on original patch by Giampaolo Rodola with contributions from R. David 
> Murray
> 
> files:
>   Lib/test/support.py  |   21 +-
>   Lib/test/test_support.py |  178 +++
>   2 files changed, 189 insertions(+), 10 deletions(-)
> 
> diff --git a/Lib/test/support.py b/Lib/test/support.py
> --- a/Lib/test/support.py
> +++ b/Lib/test/support.py
> @@ -170,7 +170,7 @@
>  attribute = getattr(obj, name)
>  except AttributeError:
>  raise unittest.SkipTest("module %s has no attribute %s" % (
> -obj.__name__, name))
> +repr(obj), name))

I would use %r instead of %s for both fields here.  Non-ASCII characters
and unseen whitespace are at least two reasons to overuse %r in
debug/error messages instead of %s.

Regards
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] [Python-checkins] cpython (merge 3.2 -> default): Issue #12102: Merge with 3.2.

2011-07-26 Thread Éric Araujo
Hi,

> changeset:   71497:4898b14dcd69
> user:Ross Lagerwall 
> summary:
>   Issue #12102: Merge with 3.2.
> 
> files:
>   Doc/ACKS.txt |  1 +
>   Doc/library/mmap.rst |  6 ++
>   Misc/NEWS|  3 +++

> diff --git a/Misc/NEWS b/Misc/NEWS
> --- a/Misc/NEWS
> +++ b/Misc/NEWS
> @@ -237,6 +237,9 @@
>  Library
>  ---
>  
> +- Issue #12102: Document that buffered files must be flushed before being 
> used
> +  with mmap. Patch by Steffen Daode Nurpmeso.

We don’t add NEWS entries for each and every doc fix, otherwise it would
be very huge :)  We rather document large changes to the documentation,
like adding links to the source files, using “python3” instead of
“python” in all examples, etc.  In addition, Library is the wrong
section, it should be Documentation.

I’m doing commits this afternoon, so I’ll take the occasion to remove
this entry.

Cheers
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com