Re: [Python-Dev] [Python-checkins] cpython: Close #12028: Make threading._get_ident() public, rename it to

2011-05-31 Thread Charles-François Natali
>> +.. function:: get_ident()
>> +
>> +   Return the 'thread identifier' of the current thread.  This is a nonzero
>> +   integer.  Its value has no direct meaning; it is intended as a magic 
>> cookie
>> +   to be used e.g. to index a dictionary of thread-specific data.  Thread
>> +   identifiers may be recycled when a thread exits and another thread is
>> +   created.
>
> That's not quite true - the Thread id isn't relinquished until the
> Thread object itself is destroyed, rather than when the underlying
> thread finishes execution (i.e. the lifecycle of a_thread.ident is the
> same as that of id(a_thread)).
>

I'm not sure I understand, Nick.
Since threads are started detached, their thread ID (e.g. returned by
pthread_self() on pthreads) can be reused as soon as the underlying OS
thread exits (i.e. returns from Modules/_threadmodule.c:t_boostrap) :

On a Linux kernel with NPTL:

$ cat /tmp/test.py
import threading

def print_ident():
print(threading._get_ident())

t1  = threading.Thread(target=print_ident)
t2  = threading.Thread(target=print_ident)

t1.start()
t1.join()

t2.start()
t2.join()

print(id(t1), id(t2))
$ ./python /tmp/test.py
-1211954272
-1211954272
(3085561228L, 3083093028L)


I'm just curious, maybe I missed something?

Thanks,

cf
___
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: Close #12028: Make threading._get_ident() public, rename it to

2011-05-31 Thread Nick Coghlan
2011/5/31 Charles-François Natali :
>>> +.. function:: get_ident()
>>> +
>>> +   Return the 'thread identifier' of the current thread.  This is a nonzero
>>> +   integer.  Its value has no direct meaning; it is intended as a magic 
>>> cookie
>>> +   to be used e.g. to index a dictionary of thread-specific data.  Thread
>>> +   identifiers may be recycled when a thread exits and another thread is
>>> +   created.
>>
>> That's not quite true - the Thread id isn't relinquished until the
>> Thread object itself is destroyed, rather than when the underlying
>> thread finishes execution (i.e. the lifecycle of a_thread.ident is the
>> same as that of id(a_thread)).
>>
>
> I'm not sure I understand, Nick.

I was just wrong, but the wording is still confusing since it has been
copied from _thread.ident. "Thread" means something other than
"threading.Thread" in that module, while in the threading docs, it
typically refers to the actual objects. With the change of module,
there needs to be something to make it clearer that this is
information related to os level threads.

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


Re: [Python-Dev] [Python-checkins] cpython: Close #12028: Make threading._get_ident() public, rename it to

2011-05-31 Thread Victor Stinner
Le mardi 31 mai 2011 10:37:15, Nick Coghlan a écrit :
> I was just wrong, but the wording is still confusing since it has been
> copied from _thread.ident. "Thread" means something other than
> "threading.Thread" in that module, while in the threading docs, it
> typically refers to the actual objects. With the change of module,
> there needs to be something to make it clearer that this is
> information related to os level threads.

Yes, I copy-pasted the doc from Python 2.7, from thread.get_ident(). Feel free 
to edit directly the doc.

Victor
___
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] Release pages malformed on python.org

2011-05-31 Thread Michael Foord

Hello all,

I believe that the release manager is aware of this, but just in case... 
The web pages on python.org for the recent releases are malformatted:


http://www.python.org/download/releases/3.1.4/
http://www.python.org/download/releases/2.7.2/

These are the pages linked to from the news on the front page.

All the best,

Michael Foord

--
http://www.voidspace.org.uk/

May you do good and not evil
May you find forgiveness for yourself and forgive others
May you share freely, never taking more than you give.
-- the sqlite blessing http://www.sqlite.org/different.html

___
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] Release pages malformed on python.org

2011-05-31 Thread Benjamin Peterson
2011/5/31 Michael Foord :
> Hello all,
>
> I believe that the release manager is aware of this, but just in case... The
> web pages on python.org for the recent releases are malformatted:
>
>    http://www.python.org/download/releases/3.1.4/
>    http://www.python.org/download/releases/2.7.2/

Wohaa. Martin, I think this is from your checkin?



-- 
Regards,
Benjamin
___
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] Sniffing passwords from PyPI using insecure connection

2011-05-31 Thread anatoly techtonik
Hi,

I'd like to escalate http://bugs.python.org/issue12226 : 'use secured
channel for uploading packages to pypi' to be shipped with next Python
2.6+
This will prevent pydotorg password sniffing when submitting packages
through public networks (such as hotels).

--
anatoly t.
___
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] Release pages malformed on python.org

2011-05-31 Thread Martin v. Löwis
Am 31.05.2011 16:01, schrieb Benjamin Peterson:
> 2011/5/31 Michael Foord :
>> Hello all,
>>
>> I believe that the release manager is aware of this, but just in case... The
>> web pages on python.org for the recent releases are malformatted:
>>
>>http://www.python.org/download/releases/3.1.4/
>>http://www.python.org/download/releases/2.7.2/
> 
> Wohaa. Martin, I think this is from your checkin?

Indeed... I have now fixed it.

Regards,
Martin

___
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] Sniffing passwords from PyPI using insecure connection

2011-05-31 Thread Terry Reedy

On 5/31/2011 1:04 PM, anatoly techtonik wrote:

Hi,

I'd like to escalate http://bugs.python.org/issue12226 : 'use secured
channel for uploading packages to pypi' to be shipped with next Python
2.6+
This will prevent pydotorg password sniffing when submitting packages
through public networks (such as hotels).


The requested one character change is
-DEFAULT_REPOSITORY = 'http://pypi.python.org/pypi'
+DEFAULT_REPOSITORY = 'https://pypi.python.org/pypi'

If Tarek (or perhaps Eric) agree that it is appropriate and otherwise 
innocuous, then Martin and Barry can decide whether to include in 2.5/2.6.


Terry Jan Reedy

___
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] Some additions to .hgignore

2011-05-31 Thread Sandro Tosi
Hi all,
following http://docs.python.org/devguide/coverage.html doc you'll end
up with several "new" files/dirs in your checkout:

- .coverage, used by coveragepy to save its info
- coverage/ , the symlink to coveragepy/coverage
- htmlcov/ , the dir where the coverage HTML pages are written

I think they should be added to .hgignore so that hg st won't show them.

I'm writing here since I don't think an issue is needed for such
matter, if that's not the case, I apologize.

Regards,
-- 
Sandro Tosi (aka morph, morpheus, matrixhasu)
My website: http://matrixhasu.altervista.org/
Me at Debian: http://wiki.debian.org/SandroTosi
___
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] Sniffing passwords from PyPI using insecure connection

2011-05-31 Thread Martin v. Löwis
> The requested one character change is
> -DEFAULT_REPOSITORY = 'http://pypi.python.org/pypi'
> +DEFAULT_REPOSITORY = 'https://pypi.python.org/pypi'
> 
> If Tarek (or perhaps Eric) agree that it is appropriate and otherwise
> innocuous, then Martin and Barry can decide whether to include in 2.5/2.6.

I don't plan any further 2.5 releases, so unless a critical security
issue pops up, 2.5.6 will have been the last release.

Regards,
Martin
___
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] Sniffing passwords from PyPI using insecure connection

2011-05-31 Thread Terry Reedy

On 6/1/2011 1:37 AM, "Martin v. Löwis" wrote:

The requested one character change is
-DEFAULT_REPOSITORY = 'http://pypi.python.org/pypi'
+DEFAULT_REPOSITORY = 'https://pypi.python.org/pypi'

If Tarek (or perhaps Eric) agree that it is appropriate and otherwise
innocuous, then Martin and Barry can decide whether to include in 2.5/2.6.


I don't plan any further 2.5 releases, so unless a critical security
issue pops up, 2.5.6 will have been the last release.


OK. I removed 2.5 from all open issues, closing a few. You could remove 
2.5 from the displayed version list so that people cannot add it back or 
to new issues.


--
Terry Jan Reedy


___
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] Extending os.chown() to accept user/group names

2011-05-31 Thread Martin v. Löwis
> Le mercredi 25 mai 2011 à 18:46 +0200, Charles-François Natali a écrit :
>> While we're at it, adding a "recursive" argument to this shutil.chown
>> could also be useful.
> 
> I don't like the idea of a recursive flag.

I think shutil.chown should aim to mimic chown(1). At least GNU chown
has a -R flag (not sure about POSIX chown), and it's useful in practice.

Regards,
Martin
___
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