Re: [Python-Dev] On decorators implementation

2005-08-22 Thread Paolino
Paolino wrote:
> I noticed (via using them) that decorations are applied to methods
> before  they become methods.
> 
> This choice flattens down the implementation to no differentiating
> methods from functions.
> 
> 
> 
> 1)
> I have to apply euristics on the wrapped function type when I use the
> function as an index key.
> 
>  if type(observed) is types.MethodType:
>observed=observed.im_func
> 
> things like this are inside my decorators.
> 
> 2)
> The behavior of decorations are not definable.
> I imagine that a method implementation of them inside the type metaclass
> could be better specified by people.
> This probably ends up in metamethods or something I can't grasp
> 
A downside of decorating at function level is that it's virtually 
impossible to check from the decorator that the first call parameter 
(aka self) is an instance of the method class.This check must be done 
inside the decorated.
This can really happen in normal use as decorators are useful to 
register the decorated as a 'callback'.Who ever fires it can do it with 
   no respect on the class belonging of the function/method, and the 
error raised will not be coherent with 'calling method on a incompatible 
instance'.

Maybe it's possible to let the decorator know the method class even if 
the class is still undefined.(Just like recursive functions?)
This would allow decorators to call super with the right class also.
@callSuper decoration is something I really miss.

Thanks
Paolino
___
Python-Dev mailing list
[EMAIL PROTECTED]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Collecting SSH keys

2005-08-22 Thread Stephen J. Turnbull
> "Martin" == Martin v Löwis <[EMAIL PROTECTED]> writes:

Martin> I don't know how this scales in OpenSSH having an
Martin> authorized_keys file with hundred or more keys.

On cvs.xemacs.org (aka SunSITE.dk) ssh+cvs access with cvs access
control being handled by a Perl script scales to approximately 85
users.  I don't handle key management directly, but I believe several
users use multiple keys (I don't personally).  I've never heard any
complaints from the guys who actually do key management; they just
keep authorized_keys in alphabetical order by comment (= user's real
name).  Nor do I notice any authorization overhead vs. a simple ssh
login when accessing the cvs server.[1]  Evidently the "what keys do
you  have?" negotiation with the agent takes very little time (in
terms of what a human can notice).

If you want time(1) timings or something like that, I'd be happy to
get an exact count of the number of keys and do them (but it will have
to wait until I get back from travel August 28).


Footnotes: 
[1]  For testing whether keys are properly installed, the sequence
"ssh [EMAIL PROTECTED]", then asking the server for "version" and
sending EOF (^D), is what we use.  So there is no overhead from a
local CVS or anything like that, although of course you do have to
start the remote cvs server process (via the COMMAND= in the
.ssh/config file).  How that compares to starting a shell I'm not sure.

-- 
School of Systems and Information Engineering http://turnbull.sk.tsukuba.ac.jp
University of TsukubaTennodai 1-1-1 Tsukuba 305-8573 JAPAN
   Ask not how you can "do" free software business;
  ask what your business can "do for" free software.
___
Python-Dev mailing list
[email protected]
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] python/dist/src setup.py, 1.219, 1.220

2005-08-22 Thread Raymond Hettinger
> A new hashlib module to replace the md5 and sha modules.  It adds
> support for additional secure hashes such as SHA-256 and SHA-512.  The
> hashlib module uses OpenSSL for fast platform optimized
> implementations of algorithms when available.  The old md5 and sha
> modules still exist as wrappers around hashlib to preserve backwards
> compatibility.

I'm getting compilation errors:

C:\py25\Modules\sha512module.c(146) : error C2059: syntax error : 'bad
suffix on number'
C:\py25\Modules\sha512module.c(146) : error C2146: syntax error :
missing ')' before identifier 'L'
C:\py25\Modules\sha512module.c(146) : error C2059: syntax error : 'bad
suffix on number'
C:\py25\Modules\sha512module.c(146) : error C2059: syntax error : 'bad
suffix on number'
C:\py25\Modules\sha512module.c(146) : error C2059: syntax error : 'bad
suffix on number'
C:\py25\Modules\sha512module.c(146) : error C2059: syntax error : 'bad
suffix on number'
C:\py25\Modules\sha512module.c(146) : error C2059: syntax error : 'bad
suffix on number'
C:\py25\Modules\sha512module.c(146) : fatal error C1013: compiler limit
: too many open parentheses


Also, there should be updating entries to Misc/NEWS,
PC/VC6/pythoncore.dsp, and PC/config.c.


Raymond

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


Re: [Python-Dev] Admin access using svn+ssh

2005-08-22 Thread Martin v. Löwis
Barry Warsaw wrote:
>>You could do that (or use the root account); I can't: I don't have
>>a ssh account on dinsdale. An even if I had, I couldn't write to
>>pythondev's authorized_keys2.
> 
> 
> That's easily rectified! :)  We should give you an account and sudo
> access.  Should I just use your keys from creosote?

Please do!

>>Ok: to whom should I forward the ssh keys then which I'm currently
>>collecting?
> 
> 
> Probably here, unless once you have the above, you still want to do it
> yourself.

I would be worried that you are a single point of failure here:
for sf.net/projects/python, multiple people can add new users, and
I think we should continue that tradition.

I would be happy with *different* people being able to manage
that, but the group should be larger than two, IMO.

Regards,
Martin
___
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Collecting SSH keys

2005-08-22 Thread Martin v. Löwis
Stephen J. Turnbull wrote:
> On cvs.xemacs.org (aka SunSITE.dk) ssh+cvs access with cvs access
> control being handled by a Perl script scales to approximately 85
> users.  I don't handle key management directly, but I believe several
> users use multiple keys (I don't personally).  I've never heard any
> complaints from the guys who actually do key management; they just
> keep authorized_keys in alphabetical order by comment (= user's real
> name).  Nor do I notice any authorization overhead vs. a simple ssh
> login when accessing the cvs server.[1]  Evidently the "what keys do
> you  have?" negotiation with the agent takes very little time (in
> terms of what a human can notice).

That's encouraging; I'm willing to proceed with that approach then.
As for key management: I just designed an infrastructure where
~pythondev/keys is a directory containing files named, say
"Martin v. Loewis" (with spaces, ASCII only); the contents of
the files are just the public keys. I run then make_authorized_keys,
which regenerates the authorized_keys2 file, adding all the
command= lines. This avoids editing authorized_keys2 in a text
editor.

Regards,
Martin
___
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Admin access using svn+ssh

2005-08-22 Thread skip

Martin,

I'm completely confused about what, if anything, I need to send to you.  I
can already access the python.org website repository via svn.  Will I
automatically get access to the new Python source repository or do I need to
send you pub key(s)?  Are dinsdale.python.org and svn.python.org the same
machine with different IP addresses?  If they are different machines, why
would we want to host svn repositories on multiple machines?

Skip
___
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Admin access using svn+ssh

2005-08-22 Thread Aahz
On Mon, Aug 22, 2005, "Martin v. L?wis" wrote:
> Aahz wrote:
>>Barry:
>>>Martin:

Host pythondev
  Hostname dinsdale.python.org
  User pythondev
  IdentityFile ~/.ssh/pythondev

>>>I'm confused again; are you saying that we should have a host named
>>>pythondev.python.org?  I'm not sure that's necessary.
>> 
>> No, pythondev is simply an SSH alias for dinsdale -- the server knows
>> nothing about it.  I don't quite understand the "User pythondev" line,
>> though -- I think that's a mistake.
> 
> That's intentional. "ssh pythondev" now becomes equivalent to
> 
> ssh -l pythondev -i ~/.ssh/pythondev dinsdale.python.org
> 
> IOW, the User option is equivalent to specifying the -l option.

Yes, I know -- but it looks like a mistake to me.  Are you saying that
all shell access will be done through a single account?  Isn't that a
huge security risk?  My understanding was that it was SVN access that
would be going through a single account, not shell access.
-- 
Aahz ([EMAIL PROTECTED])   <*> http://www.pythoncraft.com/

The way to build large Python applications is to componentize and
loosely-couple the hell out of everything.
___
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Admin access using svn+ssh

2005-08-22 Thread Barry Warsaw
On Mon, 2005-08-22 at 11:18, [EMAIL PROTECTED] wrote:

> I'm completely confused about what, if anything, I need to send to you.  I
> can already access the python.org website repository via svn.  Will I
> automatically get access to the new Python source repository or do I need to
> send you pub key(s)?  

I think technically, the answer to that is "yes", you will automatically
get access to the source repo.  The question I have is whether you
/should/ access the source repo that way, or use the shared pythondev
account.  Two unknowns for me are 1) will there be permission problems
that either prevent you from doing this, or once you've committed a
change, will screw pythondev-access?; 2) when we finally get email
notifications worked in, will it still look like your commit is coming
from the right place.  I think the answer to #2 is yes, but I'm not sure
about #1.

> Are dinsdale.python.org and svn.python.org the same
> machine with different IP addresses?  If they are different machines, why

They are the same machine, with different IP addresses.  Anonymous
webdav will require two Apache processes, since different user/groups
are needed and to support different certs for svn.python.org and
(eventually) www.python.org.

-Barry



signature.asc
Description: This is a digitally signed message part
___
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Admin access using svn+ssh

2005-08-22 Thread skip

>> Will I automatically get access to the new Python source repository
>> or do I need to send you pub key(s)?

Barry> I think technically, the answer to that is "yes", you will
Barry> automatically get access to the source repo.

Okay...

Barry> The question I have is whether you /should/ access the source
Barry> repo that way, or use the shared pythondev account.  

More confusion here.  If I use some sort of shared access how will the
system ascribe changes I make to me and not, for example, Martin?

I think until this experiment is over and we have really and truly migrated
to svn I will simply let other people fuss with things.

Skip
___
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Admin access using svn+ssh

2005-08-22 Thread James Y Knight
On Aug 22, 2005, at 11:32 AM, Barry Warsaw wrote:

> They are the same machine, with different IP addresses.  Anonymous
> webdav will require two Apache processes, since different user/groups
> are needed and to support different certs for svn.python.org and
> (eventually) www.python.org.
>

It seems a waste to use SVN's webdav support just for anon access.  
The svnserve method works well for anon access. The only reason to  
use svn webdav IMO is if you want to use that for authenticated  
access. But since you're talking about using svn+ssh for that..

James
___
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Admin access using svn+ssh

2005-08-22 Thread Martin v. Löwis
[EMAIL PROTECTED] wrote:
> I'm completely confused about what, if anything, I need to send to you.  I
> can already access the python.org website repository via svn.

Yes, but you do so using username/password, right? pythondev will be
using svn+ssh.

> Will I
> automatically get access to the new Python source repository or do I need to
> send you pub key(s)?

You need to send me pubkeys. Actually, I just copied the ones from
creosote (see below). You should now be able to checkout

svn+ssh://[EMAIL PROTECTED]/python/trunk

> Are dinsdale.python.org and svn.python.org the same
> machine with different IP addresses?

Correct.

> If they are different machines, why
> would we want to host svn repositories on multiple machines?

We don't. However, we use different access methods. Actually, we
*might* use different access methods. If this turns out to be
too confusing to users, we are probably back to username/password.

Regards,
Martin

P.S. The keys I installed are

ssh-dss
B3NzaC1kc3MAAACBAJAPN3ngdjih7H1wqkmbkaJDpfoW3fRrk9phtuuO+js43qU06BiqInbGZ/zjVZRrM7yzRbo2PGu1+ox8H/vkMlSk6IxmgMtNrrQ9SEoTRo7eyg5ku+JiC44h3RWT2IuiIALB8axHQSBsF6Oe4O9z/lgsLMO08M2l1TzRnjSjyOEZFQDGffqFFm+IoSH6cRfxnY+BiXxZ5QAAAIATuQmlscDd/QNSlk4Oy7ZMUdHplx76zQtyUHXvhRVkIu6QrduhnnCkGIFjSHQsnJOoroF4tVaJYY7oka17Ambd0LiWcSlNK+IHMdbvZ91wbVpeo9x/HBCJtCMxDX8PxG3TADuqiZjeC8nOpCdJ+cK7emQv+G4WIw3gC3IuPRINWIA5+OO9ApbKrcClwHXZ9DqtDJBe2fSox1mnei3VAajbOU/o3+j+G+5iLerOqLTCoOyIs7umvuUulIAXvhDzCzusw3mfBtt3UODQn0L3R47OFHzOiCEbihStxd36lVgCJgRBAW7UKf+2k3BzxJ5DVpp4+AZ7fS4FUVkZ8DYAog/68g==
[EMAIL PROTECTED]
ssh-rsa
B3NzaC1yc2EBIwAAAIEAq83rRGWRR4SdvvBUMJ/gDmMG7U7LdiC50kqUTbw+Kogum5JT7kexi1XYKgyKJ8FbRwMx1Xj9zjQERgDhYtFCJg72kSkD2muN3DkyU7vIoZQM/aNpspPNNDWRqj8pzHPzhWDUfL+tjZl78JD51mTOlGHaZUGdKnPeUOQF2XTadis=
[EMAIL PROTECTED]
___
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Admin access using svn+ssh

2005-08-22 Thread Martin v. Löwis
Aahz wrote:
> Yes, I know -- but it looks like a mistake to me.  Are you saying that
> all shell access will be done through a single account?  Isn't that a
> huge security risk?  My understanding was that it was SVN access that
> would be going through a single account, not shell access.

Only few selected people would have shell access; I don't see that
as a huge risk. Anyway, Barry didn't like it either, so we removed
shell access to the pythondev account; user keys now need to be
added by the pydotorg admins.

Regards,
Martin
___
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Admin access using svn+ssh

2005-08-22 Thread Martin v. Löwis
Barry Warsaw wrote:
> I think technically, the answer to that is "yes", you will automatically
> get access to the source repo.

At the moment, the answer actually is "no". For the projects repository,
there is no group write permission - you must be pythondev in order to
write.

> The question I have is whether you
> /should/ access the source repo that way, or use the shared pythondev
> account.  Two unknowns for me are 1) will there be permission problems
> that either prevent you from doing this, or once you've committed a
> change, will screw pythondev-access?;

Yes to the former. The webserver has only read access to the (projects)
repository.

> 2) when we finally get email
> notifications worked in, will it still look like your commit is coming
> from the right place.

Not sure what "the right place" would be: [EMAIL PROTECTED]
I think the email could look any way we want it to look.

> They are the same machine, with different IP addresses.  Anonymous
> webdav will require two Apache processes, since different user/groups
> are needed

Not necessarily. The repository could be world-readable, in which case
"nobody" could access it.

> and to support different certs for svn.python.org and
> (eventually) www.python.org.

Ah. I think anonymous read access should be on port 80.

Regards,
Martin


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


Re: [Python-Dev] Admin access using svn+ssh

2005-08-22 Thread Martin v. Löwis
[EMAIL PROTECTED] wrote:
> More confusion here.  If I use some sort of shared access how will the
> system ascribe changes I make to me and not, for example, Martin?

In pythondev's authorized_keys2, we have a line

command="/usr/bin/svnserve --root=/data/repos/projects -t
--tunnel-user 'Skip Montanaro'",no-port-forwarding,no-X11-forwarding,
no-agent-forwarding,no-pty ssh-dss 

So the *only* command you are allowed to invoke is svnserve (actually,
sshd will invoke that no matter what the ssh client requests). This
will tell subversion that changes should be logges as 'Skip Montanaro'.

> I think until this experiment is over and we have really and truly migrated
> to svn I will simply let other people fuss with things.

Well, you are not required to understand it, but you should try to use
it. Just check out svn+ssh://[EMAIL PROTECTED]/python/trunk/Misc,
and see whether this works.

Regards,
Martin
___
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Admin access using svn+ssh

2005-08-22 Thread Martin v. Löwis
James Y Knight wrote:
> It seems a waste to use SVN's webdav support just for anon access.  
> The svnserve method works well for anon access. The only reason to  
> use svn webdav IMO is if you want to use that for authenticated  
> access. But since you're talking about using svn+ssh for that..

It has the advantage that we can easily point people to files
with a web browser; they don't need an svn client.

Regards,
Martin
___
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Admin access using svn+ssh

2005-08-22 Thread Barry Warsaw
On Mon, 2005-08-22 at 12:16, "Martin v. Löwis" wrote:
> Barry Warsaw wrote:
> > I think technically, the answer to that is "yes", you will automatically
> > get access to the source repo.
> 
> At the moment, the answer actually is "no". For the projects repository,
> there is no group write permission - you must be pythondev in order to
> write.

Good!  I think that's a feature. :)  I have a vague discomfort with
allowing both types of access.  I.e. I'd rather all source committers
use the same mechanism.

> > 2) when we finally get email
> > notifications worked in, will it still look like your commit is coming
> > from the right place.
> 
> Not sure what "the right place" would be: [EMAIL PROTECTED]
> I think the email could look any way we want it to look.

I think it should be @python.org where  is the
firstname.lastname (with some exceptions) scheme that we've agreed on. 
I actually /don't/ want all commits to look like they're coming from
[EMAIL PROTECTED]

> > and to support different certs for svn.python.org and
> > (eventually) www.python.org.
> 
> Ah. I think anonymous read access should be on port 80.

Maybe we want to put websvn (or whatever it's called these days) on port
80 of svn.python.org?

-Barry



signature.asc
Description: This is a digitally signed message part
___
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Admin access using svn+ssh

2005-08-22 Thread Phillip J. Eby
At 06:23 PM 8/22/2005 +0200, Martin v. Löwis wrote:
>James Y Knight wrote:
> > It seems a waste to use SVN's webdav support just for anon access.
> > The svnserve method works well for anon access. The only reason to
> > use svn webdav IMO is if you want to use that for authenticated
> > access. But since you're talking about using svn+ssh for that..
>
>It has the advantage that we can easily point people to files
>with a web browser; they don't need an svn client.

You can do that with viewcvs, too.  Viewcvs can also create tarballs for 
easy downloading, and has a lot of browsing and viewing options that the 
SVN webdav mode doesn't.

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


Re: [Python-Dev] Admin access using svn+ssh

2005-08-22 Thread skip

>> I think until this experiment is over and we have really and truly
>> migrated to svn I will simply let other people fuss with things.

Martin> Well, you are not required to understand it, but you should try
Martin> to use it. 

Good point.

Martin> Just check out
Martin> svn+ssh://[EMAIL PROTECTED]/python/trunk/Misc, and see
Martin> whether this works.

It worked.  I made a trivial change to Misc/NEWS and checked it in.  I then
ran "svn blame NEWS" to see what it showed.  This took approximately
forever.  Can I assume this is one thing svn is always going to be pretty
slow at?  I use cvs annotate frequently.  Is there a faster alternative in
svn to identify who did what?

I notice that you use my real name (including spaces).  I doubt we have any
code that munches on annotated listings, but it seems that for the sake of
script writers' sanity it would be better to elide spaces or replace them
with underscores so the annotated user is a single "word":

 40555 Skip Montanaro 
 28675  montanaro Python News
 40555 Skip Montanaro 
 28675  montanaro
 37655 anthonybaxter (editors: check NEWS.help for information about 
editing NEWS using ReST.)
 37654  montanaro
 37838 rhettinger What's New in Python 2.5 alpha 1?
 37838 rhettinger =
 37838 rhettinger
 38611 anthonybaxter *Release date: XX-XXX-2006*
 38611 anthonybaxter
 37838 rhettinger Core and builtins
 37838 rhettinger -
 37838 rhettinger
 ...

That way column 2 would always be the contributor.

Skip
___
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] On decorators implementation

2005-08-22 Thread Guido van Rossum
> Maybe it's possible to let the decorator know the method class even if
> the class is still undefined.(Just like recursive functions?)
> This would allow decorators to call super with the right class also.
> @callSuper decoration is something I really miss.

You're thinking about it all wrong.

Remember that decorators can also be used to declare that something is
a static method or class method etc.

Try to learn Python, not to write some other language using Python syntax.

-- 
--Guido van Rossum (home page: http://www.python.org/~guido/)
___
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


[Python-Dev] Weekly Python Patch/Bug Summary

2005-08-22 Thread Kurt B. Kaiser
Patch / Bug Summary
___

Patches :  352 open ( +0) /  2898 closed ( +2) /  3250 total ( +2)
Bugs:  926 open (+13) /  5177 closed (+15) /  6103 total (+28)
RFE :  190 open ( -1) /   179 closed ( +1) /   369 total ( +0)

New / Reopened Patches
__

fix smtplib when local host isn't resolvable in dns  (2005-08-12)
   http://python.org/sf/1257988  opened by  Arkadiusz Miskiewicz

tarfile: fix for bug #1257255  (2005-08-17)
   http://python.org/sf/1262036  opened by  Lars Gustäbel

Patches Closed
__

sha256 module  (2004-04-14)
   http://python.org/sf/935454  closed by  greg

sha and md5 modules should use OpenSSL when possible  (2005-02-12)
   http://python.org/sf/1121611  closed by  greg

New / Reopened Bugs
___

Significant memory leak with PyImport_ReloadModule  (2005-08-11)
   http://python.org/sf/1256669  opened by  Ben Held

slice object uses -1 as exclusive end-bound  (2005-08-11)
   http://python.org/sf/1256786  opened by  Bryan G. Olson

tarfile local name is local, should be abspath  (2005-08-12)
   http://python.org/sf/1257255  opened by  Martin Blais

Encodings iso8859_1 and latin_1 are redundant  (2005-08-12)
   http://python.org/sf/1257525  opened by  liturgist

Solaris 8 declares gethostname().  (2005-08-12)
   http://python.org/sf/1257687  opened by  Hans Deragon

error message incorrectly claims Visual C++ is required  (2005-08-12)
   http://python.org/sf/1257728  opened by  Zooko O'Whielacronx

Make set.remove() behave more like Set.remove()  (2005-08-12)
CLOSED http://python.org/sf/1257731  opened by  Raymond Hettinger

tkapp read-only attributes  (2005-08-12)
   http://python.org/sf/1257772  opened by  peeb

gen_send_ex: Assertion `f->f_back !  (2005-08-12)
CLOSED http://python.org/sf/1257960  opened by  Neil Schemenauer

http auth documentation/implementation conflict  (2005-08-13)
   http://python.org/sf/1258485  opened by  Matthias Klose

"it's" vs. "its" typo in Language Reference  (2005-08-14)
CLOSED http://python.org/sf/1258922  opened by  Wolfgang Petzold

Makefile ignores $CPPFLAGS  (2005-08-14)
   http://python.org/sf/1258986  opened by  Dirk Pirschel

Tix CheckList 'radio' option cannot be changed  (2005-08-14)
   http://python.org/sf/1259434  opened by  Raymond Maple

subprocess: more general (non-buffering) communication  (2005-08-15)
   http://python.org/sf/1260171  opened by  Ian Bicking

__new__ is class method  (2005-08-16)
   http://python.org/sf/1261229  opened by  Mike Orr

import dynamic library bug?  (2005-08-16)
   http://python.org/sf/1261390  opened by  broadwin

Tutorial doesn't cover * and ** function calls  (2005-08-16)
   http://python.org/sf/1261659  opened by  Brett Cannon

precompiled code and nameError.  (2005-08-17)
   http://python.org/sf/1261714  opened by  Vladimir Menshakov

minidom.py alternate newl support is broken  (2005-08-17)
   http://python.org/sf/1262320  opened by  John Whitley

fcntl.ioctl have a bit problem.  (2005-08-18)
   http://python.org/sf/1262856  opened by  Raise L. Sail

typo on "SimpleXMLRPCServer Objects"  (2005-08-18)
CLOSED http://python.org/sf/1263086  opened by  Chad Whitacre

type() and isinstance() do not call __getattribute__  (2005-08-19)
   http://python.org/sf/1263635  opened by  Per Vognsen

IDLE on Mac  (2005-08-18)
   http://python.org/sf/1263656  opened by  Bruce Sherwood

PyArg_ParseTupleAndKeywords doesn't handle I format correctl  (2005-08-19)
CLOSED http://python.org/sf/1264168  opened by  John Finlay

PEP 8 uses wrong raise syntax  (2005-08-20)
CLOSED http://python.org/sf/1264666  opened by  Steven Bethard

sequence slicing documentation incomplete  (2005-08-20)
   http://python.org/sf/1265100  opened by  Steven Bethard

lexists() is not exported from os.path  (2005-08-22)
CLOSED http://python.org/sf/1266283  opened by  Martin Blais

Mistakes in decimal.Context.subtract documentation  (2005-08-22)
   http://python.org/sf/1266296  opened by  Jim Sizelove

Bugs Closed
___

smtplib and email.py  (2005-08-03)
   http://python.org/sf/1251528  closed by  rhettinger

float('-inf')  (2005-08-09)
   http://python.org/sf/1255395  closed by  tjreedy

Make set.remove() behave more like Set.remove()  (2005-08-12)
   http://python.org/sf/1257731  closed by  rhettinger

gen_send_ex: Assertion `f->f_back !  (2005-08-12)
   http://python.org/sf/1257960  closed by  pje

IOError after normal write  (2005-08-04)
   http://python.org/sf/1252149  closed by  tim_one

IOError after normal write  (2005-08-04)
   http://python.org/sf/1252149  deleted by  patrick_gerken

"it's" vs. "its" typo in Language Reference  (2005-08-14)
   http://python.org/sf/1258922  closed by  birkenfeld

hotshot.stats.load  (2004-02-19)
   http://python.org/sf/900092  closed by  bwarsaw

typo on "SimpleXMLRPCServer Objects"  (2005-08-18)
   http://py

[Python-Dev] Revised PEP 349: Allow str() to return unicode strings

2005-08-22 Thread Neil Schemenauer
[Please mail followups to [EMAIL PROTECTED]

The PEP has been rewritten based on a suggestion by Guido to change
str() rather than adding a new built-in function.  Based on my
testing, I believe the idea is feasible.  It would be helpful if
people could test the patched Python with their own applications and
report any incompatibilities.


PEP: 349
Title: Allow str() to return unicode strings
Version: $Revision: 1.3 $
Last-Modified: $Date: 2005/08/22 21:12:08 $
Author: Neil Schemenauer <[EMAIL PROTECTED]>
Status: Draft
Type: Standards Track
Content-Type: text/plain
Created: 02-Aug-2005
Post-History: 06-Aug-2005
Python-Version: 2.5


Abstract

This PEP proposes to change the str() built-in function so that it
can return unicode strings.  This change would make it easier to
write code that works with either string type and would also make
some existing code handle unicode strings.  The C function
PyObject_Str() would remain unchanged and the function
PyString_New() would be added instead.


Rationale

Python has had a Unicode string type for some time now but use of
it is not yet widespread.  There is a large amount of Python code
that assumes that string data is represented as str instances.
The long term plan for Python is to phase out the str type and use
unicode for all string data.  Clearly, a smooth migration path
must be provided.

We need to upgrade existing libraries, written for str instances,
to be made capable of operating in an all-unicode string world.
We can't change to an all-unicode world until all essential
libraries are made capable for it.  Upgrading the libraries in one
shot does not seem feasible.  A more realistic strategy is to
individually make the libraries capable of operating on unicode
strings while preserving their current all-str environment
behaviour.

First, we need to be able to write code that can accept unicode
instances without attempting to coerce them to str instances.  Let
us label such code as Unicode-safe.  Unicode-safe libraries can be
used in an all-unicode world.

Second, we need to be able to write code that, when provided only
str instances, will not create unicode results.  Let us label such
code as str-stable.  Libraries that are str-stable can be used by
libraries and applications that are not yet Unicode-safe.

Sometimes it is simple to write code that is both str-stable and
Unicode-safe.  For example, the following function just works:

def appendx(s):
return s + 'x'

That's not too surprising since the unicode type is designed to
make the task easier.  The principle is that when str and unicode
instances meet, the result is a unicode instance.  One notable
difficulty arises when code requires a string representation of an
object; an operation traditionally accomplished by using the str()
built-in function.

Using the current str() function makes the code not Unicode-safe.
Replacing a str() call with a unicode() call makes the code not
str-stable.  Changing str() so that it could return unicode
instances would solve this problem.  As a further benefit, some code
that is currently not Unicode-safe because it uses str() would
become Unicode-safe.


Specification

A Python implementation of the str() built-in follows:

def str(s):
"""Return a nice string representation of the object.  The
return value is a str or unicode instance.
"""
if type(s) is str or type(s) is unicode:
return s
r = s.__str__()
if not isinstance(r, (str, unicode)):
raise TypeError('__str__ returned non-string')
return r

The following function would be added to the C API and would be the
equivalent to the str() built-in (ideally it be called PyObject_Str,
but changing that function could cause a massive number of
compatibility problems):

PyObject *PyString_New(PyObject *);

A reference implementation is available on Sourceforge [1] as a
patch.


Backwards Compatibility

Some code may require that str() returns a str instance.  In the
standard library, only one such case has been found so far.  The
function email.header_decode() requires a str instance and the
email.Header.decode_header() function tries to ensure this by
calling str() on its argument.  The code was fixed by changing
the line "header = str(header)" to:

if isinstance(header, unicode):
header = header.encode('ascii')

Whether this is truly a bug is questionable since decode_header()
really operates on byte strings, not character strings.  Code that
passes it a unicode instance could itself be considered buggy.


Alternative Solutions

A new built-in function could be added instead of chan

Re: [Python-Dev] Admin access using svn+ssh

2005-08-22 Thread Martin v. Löwis
Phillip J. Eby wrote:
> You can do that with viewcvs, too.  Viewcvs can also create tarballs for
> easy downloading, and has a lot of browsing and viewing options that the
> SVN webdav mode doesn't.

True. I had some issues with viewcvs, though: you cannot provide access
control easily, as you cannot force it to slash-separated mode; it also
couldn't fetch the history across renames. These may have been fixed
meanwhile, of course.

Regards,
Martin
___
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Admin access using svn+ssh

2005-08-22 Thread Martin v. Löwis
[EMAIL PROTECTED] wrote:
> It worked.  I made a trivial change to Misc/NEWS and checked it in.  I then
> ran "svn blame NEWS" to see what it showed.  This took approximately
> forever.  Can I assume this is one thing svn is always going to be pretty
> slow at? 

Yes. Somebody commented that this is quadratic in svn with the number of
revisions, whereas it is linear in CVS. Please try it on some other
file; Misc/NEWS is probably the worst case in the Python repository.

I don't know whether there is any better way; we should perhaps ask
on the svn users list.

> I notice that you use my real name (including spaces).  I doubt we have any
> code that munches on annotated listings, but it seems that for the sake of
> script writers' sanity it would be better to elide spaces or replace them
> with underscores so the annotated user is a single "word":

That would be easy to do. For consistency, should we use
. (with the usual
exceptions 'aahz', 'guido.van.rossum', 'martin.v.loewis')?

As for parsing these things: they also show up in 'svn log'.

Regards,
Martin
___
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Admin access using svn+ssh

2005-08-22 Thread David Bolen
"Martin v. Löwis" <[EMAIL PROTECTED]> writes:

> [EMAIL PROTECTED] wrote:
> > It worked.  I made a trivial change to Misc/NEWS and checked it in.  I then
> > ran "svn blame NEWS" to see what it showed.  This took approximately
> > forever.  Can I assume this is one thing svn is always going to be pretty
> > slow at? 
> 
> Yes. Somebody commented that this is quadratic in svn with the number of
> revisions, whereas it is linear in CVS. Please try it on some other
> file; Misc/NEWS is probably the worst case in the Python repository.
> 
> I don't know whether there is any better way; we should perhaps ask
> on the svn users list.

One improvement, if you're looking for a fairly recent change is to
bound the blame command with a revision range (I find a date up to
HEAD as easiest).  You'll miss annotations on lines which were last
touched prior to the selected range, but it can definitely speed
things up.

On a file like News, even if you're generous (say take the last year)
it would probably be noticeably faster than letting svn go back to
revision 1.

-- David

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


Re: [Python-Dev] On decorators implementation

2005-08-22 Thread Greg Ewing
Paolino wrote:

> Maybe it's possible to let the decorator know the method class even if 
> the class is still undefined.(Just like recursive functions?)

No, it's not possible. The situation is not the same. With
recursive functions, both functions are defined before
either of them is called. But decorators in a class body
are executed before the surrounding class even exists.

-- 
Greg Ewing, Computer Science Dept, +--+
University of Canterbury,  | A citizen of NewZealandCorp, a   |
Christchurch, New Zealand  | wholly-owned subsidiary of USA Inc.  |
[EMAIL PROTECTED]  +--+
___
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com