[issue10217] python-2.7.amd64.msi install fails

2010-11-08 Thread Martin v . Löwis

Martin v. Löwis  added the comment:

IIUC, Manfred's pythonInstallLog.zip is now from a successful installation, so 
it is unfortunately of little help. We really would need a log of a failed 
installation.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10325] PY_LLONG_MAX & co - preprocessor constants or not?

2010-11-08 Thread Hallvard B Furuseth

Hallvard B Furuseth  added the comment:

Mark Dickinson writes:
> Here's a patch (against py3k) incorporating your suggestions.  Would you
> be willing to review?

Looks fine to me.  (Actually the gcc branch makes the same assumptions
as the final branch, but then I expect gcc itself does too.)

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10350] errno is read too late

2010-11-08 Thread Hallvard B Furuseth

New submission from Hallvard B Furuseth :

errno is sometimes read too late after the error:  After another call
may have modified it.  Here's a patch against py3k.  Most of it or a
variant applies to 2.7 too, but I haven't really looked at that.

I've not looked at math code, where I don't even know what sets errno.

There might also be a late errno read at Modules/_ctypes/callproc.c
line 794: "space[0] = errno;".  Does it want the errno from before
_ctypes_get_errobj()?  I'm unsure what's going on there.

Modules/_multiprocessing/semaphore.c doesn't need the patch's extra
variable, it can instead be rearranged with the commented-out patch.

--
components: None
files: late-errno.diff
keywords: patch
messages: 120719
nosy: hfuru
priority: normal
severity: normal
status: open
title: errno is read too late
type: behavior
versions: Python 2.7, Python 3.1, Python 3.2
Added file: http://bugs.python.org/file19539/late-errno.diff

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10325] PY_LLONG_MAX & co - preprocessor constants or not?

2010-11-08 Thread Hallvard B Furuseth

Hallvard B Furuseth  added the comment:

I wrote:
>> BTW, do you know of any modern non-Windows platforms that don't define
>> LLONG_MIN and LLONG_MAX?  It may well be that the "two's complement"
>> fallback hasn't been exercised in recent years.
> 
> Anyting compiled with strict ANSI pre-C99 mode, e.g. gcc -ansi, (...)

which also disables 'long long', so such examples are moot.  duh.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10351] to introduce autocompletion for keys in dictionaries (patch attached)

2010-11-08 Thread Valery Khamenya

New submission from Valery Khamenya :

1. The patch introduces autocompletion for keys in dictionaries (patch attached)

2. The patched rlcompleter as such works OK for unicode dictionary keys as 
well. All tests pass OK. HOWEVER, readline's completion mechanism seem to be 
confused with unicode strings -- see comments to Completer.dict_key_matches(). 
So, perhaps, one day some changes should be applied to readline code too.

3. rlcompleter.py has no tests in trunk -- I spawn a separate issue for it. 
Meanwhile I took test_rlcompleter.py from 2.7 and extended it.

4. The following usual lines in .pythonstartup:
import readline
import rlcompleter
readline.parse_and_bind('tab: complete')
readline.parse_and_bind('Control-Space: complete')

should be extended by this one:
readline.set_completer_delims(re.compile(r'[\'"\\[]').sub('', 
readline.get_completer_delims()))

--
components: Library (Lib)
files: rlcompleter-dict-keys-autocompletion.tar.gz
messages: 120721
nosy: Valery.Khamenya
priority: normal
severity: normal
status: open
title: to introduce autocompletion for keys in dictionaries (patch attached)
type: behavior
versions: Python 2.6, Python 2.7, Python 3.1, Python 3.2, Python 3.3
Added file: 
http://bugs.python.org/file19540/rlcompleter-dict-keys-autocompletion.tar.gz

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10352] rlcompleter.py has no tests in trunk

2010-11-08 Thread Valery Khamenya

New submission from Valery Khamenya :

rlcompleter.py has no test_rlcompleter in trunk, see 
http://svn.python.org/view/python/trunk/Lib/test/
There is one in 2.7 though.

Remark: the issue http://bugs.python.org/issue10351 introduces autocompletion 
patch and comes with new tests. So, one may want to use it as for up-to-date 
test_rlcompleter.py, given the issue #10351 is accepted ;-)

--
components: Library (Lib), Tests
messages: 120722
nosy: Valery.Khamenya
priority: normal
severity: normal
status: open
title: rlcompleter.py has no tests in trunk
versions: Python 2.6

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2001] Pydoc interactive browsing enhancement

2010-11-08 Thread Ron Adam

Ron Adam  added the comment:

> What about http://bugs.python.org/issue2001#msg114326 ?

Thanks for the reminder.


To Nick:

>However, the public (albeit undocumented) nature of the APIs >implementing the 
>old Tk GUI means I'm not comfortable committing the >patch in a form that 
>simply drops them without going through a >deprecation period first.

I think it would be ok sense this is a 'user' interface rather than a 
programming interface, but it won't hurt to ask specifically about this on 
python dev.  I got the impression that pydoc is considered a 'user' tool like 
idle, that just happens to live in lib, so the rules aren't considered to be 
quite as strict as it would be if it was a module meant to be used by other 
modules or programs.


>3. A serve() function to start the web server component should be >added back 
>in

There is a _startserver() function.  The leading  underscore can be removed, or 
it can be renamed to serve.  A serve() function could also just call 
_startserver().


>2. The gui() function should still open the Tkinter GUI,
>and the -g option should be retained with its old functionality. >Invoking 
>this function should trigger DeprecationWarning.
>
>4. The new behaviour of opening the web client can be provided
>as a "browse()" function (that accepts the port number the
>server is listening on as an argument).


After the patch the gui() function starts the server with a server text command 
window, and opens the browser to the correct page.  If you close the browser, 
you can use 'b' at the server prompt to reopen the browser at the address it is 
serving.

It sounds like you want "serve()" to just start the server. and "browse()" to 
just start the browser.  The gui() function does both in one step.

What would be the equivalent new way of doing both in one step, if gui() 
retains the old tk behavior?

Cheers, Ron

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10352] rlcompleter.py has no tests in trunk

2010-11-08 Thread Georg Brandl

Georg Brandl  added the comment:

trunk is no longer active.  The real "trunk" is the py3k branch, which does 
have test_rlcompleter.

--
nosy: +georg.brandl
resolution:  -> invalid
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10329] trace.py and unicode in Python 3

2010-11-08 Thread Walter Dörwald

Walter Dörwald  added the comment:

Using the original encoding of the Python source file might be the politically 
correct thing to do, but it complicates handling of the output of trace.py. For 
each file you have to do the encoding detection dance again. It would be great 
if I could specify which encoding trace.py use (with the files encoding being 
the default).

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10329] trace.py and unicode in Python 3

2010-11-08 Thread STINNER Victor

STINNER Victor  added the comment:

> ... it complicates handling of the output of trace.py. 
> For each file you have to do the encoding detection dance again ...

What? You just have to call one function! tokenize.open() :-) Well, ok, it's 
not commited yet, but it looks like most people agree: #10335.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2304] subprocess under windows fails to quote properly when shell=True

2010-11-08 Thread Weeble

Weeble  added the comment:

Is there any way to write code that's safe with or without this fix? If I have 
code that currently does this:

subprocess.check_call('""c:\some path with spaces" arg1 arg2 "a quoted arg""', 
shell=True)

...will it break when running on a version of Python with this fix? Is there 
any good way to detect whether the running Python has this fix or not?

--
nosy: +weeble

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10353] 2to3 and places argument in unitests assertAlmostEqual

2010-11-08 Thread Peter

New submission from Peter :

Consider the following example unit test using assertAlmostEqual which uses the 
places argument as a positional argument, call this places.py:

import unittest
class Tests(unittest.TestCase):
def test_equal_to_five_decimal_places(self):
"""Check assertAlmostEqual using decimal places"""
self.assertAlmostEqual(0.123456789, 0.123456, 5)
if __name__ == "__main__":
runner = unittest.TextTestRunner(verbosity = 2)
unittest.main(testRunner=runner)



This works fine with Python 2.6.6 (Linux),

$ python2.6 places.py
Check assertAlmostEqual using decimal places ... ok

--
Ran 1 test in 0.000s

OK




Trying 2to3 on it reports no changes needed:

$ 2to3 places.py
RefactoringTool: Skipping implicit fixer: buffer
RefactoringTool: Skipping implicit fixer: idioms
RefactoringTool: Skipping implicit fixer: set_literal
RefactoringTool: Skipping implicit fixer: ws_comma
RefactoringTool: No changes to places.py
RefactoringTool: Files that need to be modified:
RefactoringTool: places.py


Trying the test as is under Python 3.1.2 (Linux) fails:

$ python3.1 places.py
test_equal_to_five_decimal_places (__main__.Tests)
Check assertAlmostEqual using decimal places ... ERROR

==
ERROR: test_equal_to_five_decimal_places (__main__.Tests)
Check assertAlmostEqual using decimal places
--
Traceback (most recent call last):
  File "places.py", line 5, in test_equal_to_five_decimal_places
self.assertAlmostEqual(0.123456789, 0.123456, 5)
TypeError: assertAlmostEqual() takes exactly 3 positional arguments (4 given)

--
Ran 1 test in 0.001s

FAILED (errors=1)


The test can be fixed to run on Python 3.1 (any Python 2.6) by supplying the 
places argument by name:


import unittest
class Tests(unittest.TestCase):
def test_equal_to_five_decimal_places(self):
"""Check assertAlmostEqual using decimal places"""
self.assertAlmostEqual(0.123456789, 0.123456, places=5)
if __name__ == "__main__":
runner = unittest.TextTestRunner(verbosity = 2)
unittest.main(testRunner=runner)


Note http://docs.python.org/library/unittest.html does not explicitly discuss 
passing places by name vs position. On the other hand, 
http://docs.python.org/py3k/library/unittest.html explicitly shows the by name 
form only.

I think the 2to3 script needs to be extended to use the places argument by name.

--
components: 2to3 (2.x to 3.0 conversion tool)
messages: 120728
nosy: maubp
priority: normal
severity: normal
status: open
title: 2to3 and places argument in unitests assertAlmostEqual
type: behavior
versions: Python 2.6, Python 2.7, Python 3.1, Python 3.2, Python 3.3

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10354] tempfile.template is broken

2010-11-08 Thread Giampaolo Rodola'

New submission from Giampaolo Rodola' :

>>> import tempfile
>>> tempfile.template = 'XXX'
>>> tempfile.mkdtemp()
'/tmp/tmpPf5lML'
>>>

Functions that use template use it as an argument default, so changing it 
afterwards has no effect.

--
components: Library (Lib)
messages: 120729
nosy: giampaolo.rodola
priority: normal
severity: normal
status: open
title: tempfile.template is broken
versions: Python 2.7, Python 3.1, Python 3.2

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10354] tempfile.template is broken

2010-11-08 Thread Giampaolo Rodola'

Giampaolo Rodola'  added the comment:

Patch in attachment.

--
keywords: +patch
Added file: http://bugs.python.org/file19541/tempfile.patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2001] Pydoc interactive browsing enhancement

2010-11-08 Thread Nick Coghlan

Nick Coghlan  added the comment:

Yeah, I'll ask for feedback on python-dev regarding the API breakage.

If we decide not to break the existing API, I'd suggest the following:

- keep both the old serve() and the old gui() (with DeprecationWarning added to 
both) (I'd forgotten your point in the previous python-dev thread that gui() 
would need changes to work with the new server, which isn't worth the hassle)

- use _startserver(port=0) and _browse(port, *, start=False) for the new 
components (with the -b option invoking _browse with start=True)

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10354] tempfile.template is broken

2010-11-08 Thread Eric Smith

Eric Smith  added the comment:

The patch looks good to me, but it needs a test.

--
nosy: +eric.smith
stage:  -> unit test needed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10228] Refleak run of test_dbm fails when several dbm modules are available

2010-11-08 Thread Michael Foord

Changes by Michael Foord :


--
nosy:  -michael.foord

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10327] Abnormal SSL timeouts when using socket timeouts - once again

2010-11-08 Thread Pascal Chambon

Pascal Chambon  added the comment:

Allright, it actually looks more like a pathological latency behaviour of my 
target platforms than a ssl bug... 
I was mislead by the heavy history of socket.settimeout(), sorry. >_<

--
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10354] tempfile.template is broken

2010-11-08 Thread Giampaolo Rodola'

Giampaolo Rodola'  added the comment:

Patch including tests is in attachment.
I think I've just found two further bugs though:


>>> tempfile.TemporaryFile().name
''
>>> tempfile.TemporaryFile(prefix='xxx').name
''
>>> tempfile.SpooledTemporaryFile().name
Traceback (most recent call last):
  File "", line 1, in 
  File "/home/giampaolo/svn/python-2.7/Lib/tempfile.py", line 574, in name
return self._file.name
AttributeError: 'cStringIO.StringO' object has no attribute 'name'

I'm going to open two separate tickets.

--
Added file: http://bugs.python.org/file19542/tempfile.patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10354] tempfile.template is broken

2010-11-08 Thread Giampaolo Rodola'

Giampaolo Rodola'  added the comment:

Adding georg.brandl to nosy list as per misc/maintainers.rst.

--
nosy: +georg.brandl

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10355] SpooledTemporaryFile's name property is broken

2010-11-08 Thread Giampaolo Rodola'

New submission from Giampaolo Rodola' :

>>> import tempfile
>>> tempfile.SpooledTemporaryFile().name
Traceback (most recent call last):
  File "", line 1, in 
  File "/home/giampaolo/svn/python-2.7/Lib/tempfile.py", line 574, in name
return self._file.name
AttributeError: 'cStringIO.StringO' object has no attribute 'name'

--
messages: 120736
nosy: georg.brandl, giampaolo.rodola
priority: normal
severity: normal
status: open
title: SpooledTemporaryFile's name property is broken
versions: Python 2.7, Python 3.1, Python 3.2

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10354] tempfile.template is broken

2010-11-08 Thread Giampaolo Rodola'

Giampaolo Rodola'  added the comment:

Created issue 10355 for SpooledTemporaryFile bug while TemporaryFile having no 
name seems to be rightful.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10356] decimal.py: hash of -1

2010-11-08 Thread Stefan Krah

New submission from Stefan Krah :

When the __hash__ method is called directly, the hash of -1
is -1:

>>> from decimal import *
>>> Decimal(-1).__hash__()
-1
>>> hash(Decimal(-1))
-2


I've a patch, which also sneaks in a ValueError.

--
components: Library (Lib)
files: decimal_hash.patch
keywords: needs review, patch
messages: 120738
nosy: mark.dickinson, skrah
priority: normal
severity: normal
stage: patch review
status: open
title: decimal.py: hash of -1
type: behavior
versions: Python 3.2
Added file: http://bugs.python.org/file19543/decimal_hash.patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10357] ** and "mapping" are poorly defined in python docs

2010-11-08 Thread Fergal Daly

New submission from Fergal Daly :

According to the index, the only place that mentions ** in argument lists is

http://docs.python.org/tutorial/controlflow.html#index-1099

and gives no indication of what an object must support to allow **.

When you attempt to ** an object the real attribute exception is suppressed and 
you get a message

"argument after ** must be a mapping"

"mapping" is quite loosely defined. There are 3 definitions, the glossary entry 
seems the most complete

http://docs.python.org/library/stdtypes.html#index-625
http://docs.python.org/reference/datamodel.html#index-842
http://docs.python.org/glossary.html#term-mapping

But even the glossary entry doesn't tell you what you need for **.

Only by reading the C source code did I discover that to be usable in **, an 
object must implement .keys() and .__getitem__().

The docs either should add .keys() to the definition of mapping or the code 
should use some other term or simply allow the original exception to reach the 
user.

--
assignee: d...@python
components: Documentation
messages: 120739
nosy: Fergal.Daly, d...@python
priority: normal
severity: normal
status: open
title: ** and "mapping" are poorly defined in python docs
versions: Python 2.7

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10357] ** and "mapping" are poorly defined in python docs

2010-11-08 Thread Giampaolo Rodola'

Changes by Giampaolo Rodola' :


--
nosy: +giampaolo.rodola

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10350] errno is read too late

2010-11-08 Thread Giampaolo Rodola'

Changes by Giampaolo Rodola' :


--
nosy: +giampaolo.rodola

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue5712] tkinter - askopenfilenames returns string instead of tuple in windows 2.6.1 release

2010-11-08 Thread Peter Hall

Peter Hall  added the comment:

There seems some similarity between this issue and issue #10316 which occurs on 
Linux.

--
nosy: +pfhall

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10358] Doc styles for print should only use dark colors

2010-11-08 Thread Fred L. Drake, Jr.

New submission from Fred L. Drake, Jr. :

The HTML version of the documentation should include style settings for 
printing that use fairly dark colors, so that printed copies of pages are more 
readable.

Using a printer that reduces colors to grays causes the light colors in code 
examples (or inlined references to classes and the like) to nearly drop out, 
making the result very painful to read.

--
assignee: d...@python
components: Documentation
keywords: easy
messages: 120741
nosy: d...@python, fdrake
priority: normal
severity: normal
stage: needs patch
status: open
title: Doc styles for print should only use dark colors
type: feature request

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10359] ISO C cleanup

2010-11-08 Thread Hallvard B Furuseth

New submission from Hallvard B Furuseth :

Here are some ISO C conformance patches, and
a minor cleanup I encountered along the way.

Lib/distutils/tests/test_config_cmd.py // comment --> /* comment */.
Lib/distutils/tests/test_build_ext.py,
Objects/weakrefobject.c,
Modules/_pickle.c,
Modules/_testcapimodule.c,
Python/import.c  .  .  .  .  .  .  .   Remove some invalid ',' and ';'s.
Python/Python-ast.c,
Modules/arraymodule.c  .  .  .  .  .   Non-constant array initializer.
Modules/_csv.c   .  .  .  .  .  .  .   Slight cleanup.
Modules/_ctypes/libffi/src/x86/ffi.c   Empty translation unit.

TODO when bored, if anyone cares for more pedantic ISO patches:
- printf(%p, non-void* pointer): The pointer should be cast to void*.
- More // comments -> /**/, but mostly in system-specific code so I
  can't test any patches I make.

--
components: None
files: iso-c.zip
messages: 120742
nosy: hfuru
priority: normal
severity: normal
status: open
title: ISO C cleanup
type: compile error
versions: Python 2.7, Python 3.1, Python 3.2
Added file: http://bugs.python.org/file19544/iso-c.zip

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10360] _weakrefset.WeakSet.__contains__ should not propagate TypeErrors

2010-11-08 Thread Tres Seaver

New submission from Tres Seaver :

Because application code which tests for the presence of
an object in a WeakSet may not be able to ensure that the
object is weak-referenceable, the set should just return
False for any object passed to '__contains__' which causes
'ref' to raise a TypeError.

Patch forthcoming.

--
messages: 120743
nosy: tseaver
priority: normal
severity: normal
status: open
title: _weakrefset.WeakSet.__contains__ should not propagate TypeErrors
versions: Python 2.7

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10360] _weakrefset.WeakSet.__contains__ should not propagate TypeErrors

2010-11-08 Thread Tres Seaver

Changes by Tres Seaver :


--
components: +Library (Lib)
keywords: +patch
Added file: http://bugs.python.org/file19545/issue10360.patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10325] PY_LLONG_MAX & co - preprocessor constants or not?

2010-11-08 Thread Hallvard B Furuseth

Hallvard B Furuseth  added the comment:

Hallvard B Furuseth writes:
> Looks fine to me.

Hold on.. #elif defined SIZEOF_LONG_LONG would be a bit safer than #else.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10353] 2to3 and places argument in unitests assertAlmostEqual

2010-11-08 Thread R. David Murray

Changes by R. David Murray :


--
nosy: +benjamin.peterson

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10353] 2to3 and places argument in unitests assertAlmostEqual

2010-11-08 Thread R. David Murray

R. David Murray  added the comment:

The change of places to a keyword-only argument in 3.x was reverted last week 
in py3k trunk.

--
nosy: +michael.foord, r.david.murray
resolution:  -> out of date
stage:  -> committed/rejected
status: open -> closed
versions:  -Python 2.6, Python 2.7, Python 3.3

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10354] tempfile.template is broken

2010-11-08 Thread R. David Murray

R. David Murray  added the comment:

Shouldn't the global template variable just be deleted in python3?  It is no 
longer documented except for what is probably an overlooked mention in the 
introduction.

--
nosy: +r.david.murray

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10359] ISO C cleanup

2010-11-08 Thread Éric Araujo

Éric Araujo  added the comment:

If it’s not too much trouble for you, please post diffs as text files rather 
than binary.  You can also use “svn diff” to produce one file with all 
differences.

--
nosy: +eric.araujo

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10359] ISO C cleanup

2010-11-08 Thread Éric Araujo

Éric Araujo  added the comment:

By the way, do these changes actually fix errors or are they just cleanups and 
pedantic (not a slight) fixes?  If the latter, I think they won’t go into 
stable branches.  I don’t do C though, so I won’t be the one to judge.  Thanks 
for the patches!

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10359] ISO C cleanup

2010-11-08 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
nosy: +amaury.forgeotdarc

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10348] multiprocessing: use SysV semaphores on FreeBSD

2010-11-08 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
nosy: +asksol

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue9873] urllib.parse: Allow bytes in some APIs that use string literals internally

2010-11-08 Thread Éric Araujo

Éric Araujo  added the comment:

Related issue in msg120647.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10336] test_xmlrpc fails if gzip is not supported by client

2010-11-08 Thread Éric Araujo

Éric Araujo  added the comment:

No problem :)

I’ve had a look at the test and don’t understand the problem.  What’s the 
client you’re referring to?  I thought that in the tests, client-side and 
server-side were both under control.  Is the problem related to *python* being 
built without gzip support?

--
nosy: +orsenthil

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10355] SpooledTemporaryFile's name property is broken

2010-11-08 Thread Éric Araujo

Changes by Éric Araujo :


--
nosy: +eric.araujo

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10354] tempfile.template is broken

2010-11-08 Thread Éric Araujo

Changes by Éric Araujo :


--
nosy: +eric.araujo

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10353] 2to3 and places argument in unitests assertAlmostEqual

2010-11-08 Thread Éric Araujo

Éric Araujo  added the comment:

Is 3.1 incompatible with 2.7 and 3.2?  If so, is it best to have 3.2 compatible 
with 3.1 or to have 3.1 buggy?

--
nosy: +eric.araujo

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10353] 2to3 and places argument in unitests assertAlmostEqual

2010-11-08 Thread Michael Foord

Michael Foord  added the comment:

It's fixed in release31-maint as well.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10351] Add autocompletion for keys in dictionaries

2010-11-08 Thread Éric Araujo

Éric Araujo  added the comment:

Thank you for the report and patch.  This is a new feature, thus targetting the 
py3k branch (future 3.2).  If your patch is not against this branch, can you 
refresh it?  Also, please attach it as text file(s), and generally follow 
guidelines outlined at http://www.python.org/dev/patches/  Thanks again!

--
nosy: +eric.araujo
stage:  -> patch review
title: to introduce autocompletion for keys in dictionaries (patch attached) -> 
Add autocompletion for keys in dictionaries
type: behavior -> feature request
versions:  -Python 2.6, Python 2.7, Python 3.1, Python 3.3

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10225] Fix doctest runable examples in python manual

2010-11-08 Thread Łukasz Langa

Changes by Łukasz Langa :


--
nosy: +lukasz.langa

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue8919] python should read ~/.pythonrc.py by default

2010-11-08 Thread Éric Araujo

Éric Araujo  added the comment:

> the .pythonrc.py file is not deprecated. only the user module is deprecated.

Which amounts to the same IMO.

> the problem i have with the PYTHONSTARTUP variable is that i find it
> is an unecessary intermediate step to set up an initialization file.

Okay, I see your point, even though I’m not convinced :)  I suggest you write 
to the python-ideas mailing list to gather feedback about this.

--
versions: +Python 3.2

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10335] tokenize.open_python(): open a Python file with the right encoding

2010-11-08 Thread Alexander Belopolsky

Alexander Belopolsky  added the comment:

On Sun, Nov 7, 2010 at 4:24 AM, STINNER Victor  wrote:
..
> Ok, the new patch (tokenize_open-2.patch) uses tokenize.open() name and adds a
> test for BOM without coding cookie (test utf-8-sig encoding).

Here are my comments on the new patch:

1. A nit-pick: tokenize.py is already inconsistent in this respect,
but I believe it is conventional not to start a docsting with an empty
line:

+def open(filename):
+"""Open a Python script in read mode with the right encoding.

instead of

+def open(filename):
+"""
+Open a Python script in read mode with the right encoding.

Also, I would prefer a more neutral description that will not imply
that the method is only useful for Python source code.  For example:

"""Detect encoding and open a file in read mode with the right encoding.

(optionally a more detailed explanation or a reference to detect_encoding.)
"""

2. Another nit-pick: detect_encoding() returns a list of 0-2 lines in
the second item, not a single line, so it is better to write

+encoding, lines = detect_encoding(buffer.readline)

or even

+encoding, _ = detect_encoding(buffer.readline)

instead of

+encoding, line = detect_encoding(buffer.readline)

3. In test_open(self), I think you should use self.assertEqual()
instead of a plain assert.

4. Last nit-pick (feel free to ignore as prejudice to %-formatting :-):

instead of

+print("# coding: %s" % encoding, file=fp)

you can write

+print("# coding: " + encoding, file=fp)

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10335] tokenize.open(): open a Python file with the right encoding

2010-11-08 Thread Alexander Belopolsky

Alexander Belopolsky  added the comment:

Changing the title to make the latest choice of function name more visible.

--
stage:  -> patch review
title: tokenize.open_python(): open a Python file with the right encoding -> 
tokenize.open(): open a Python file with the right encoding
type:  -> feature request

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10335] tokenize.open(): open a file with encoding detected from a coding cookie

2010-11-08 Thread Éric Araujo

Éric Araujo  added the comment:

1. Agreed on both.  Extraneous blank lines seem to be favored by people who 
need to work around bugs in their editor.

2. Yes, “_” is recommended for a discarded object.

3. Agreed.

4. Even better: print('# coding:', encoding, file=fp).  No intermediary string!

--
title: tokenize.open(): open a Python file with the right encoding -> 
tokenize.open(): open a file with encoding detected from a coding cookie

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10356] decimal.py: hash of -1

2010-11-08 Thread Mark Dickinson

Mark Dickinson  added the comment:

Are there situations where this is a problem?

I don't think that there's any requirement that the __hash__ method for a 
user-defined Python type not return -1.  (It's also allowed to return values 
outside the range of hash values;  these get automatically rehashed to values 
within the range.)

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10355] SpooledTemporaryFile's name property is broken

2010-11-08 Thread R. David Murray

R. David Murray  added the comment:

What makes you think SpooledTemporaryFile *has* a name attribute? :)

Seriously, though, I presume this bug report is asking for either a better 
error message or for .name to raise an attribute error on a 
SpooledTemporaryFile?

--
nosy: +r.david.murray
stage:  -> needs patch
type:  -> behavior

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10357] ** and "mapping" are poorly defined in python docs

2010-11-08 Thread R. David Murray

R. David Murray  added the comment:

I think the Glossary entry needs to be updated to point to the authoritative 
source for 'mapping' methods:

http://docs.python.org/library/collections.html#abcs-abstract-base-classes

(and yes, I realize that info is not located in a particularly intuitive 
location!)

I wonder, however, if the code should be updated to use a dictionary iterator 
rather than 'keys'.

--
nosy: +r.david.murray, rhettinger
stage:  -> needs patch
type:  -> behavior

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10356] decimal.py: hash of -1

2010-11-08 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc  added the comment:

It's not about the hash value, but about consistency: help(Decimal.__hash__) 
says "x.__hash__() <==> hash(x)", but this is not true for x=Decimal(-1).

--
nosy: +amaury.forgeotdarc

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10355] SpooledTemporaryFile's name property is broken

2010-11-08 Thread Giampaolo Rodola'

Giampaolo Rodola'  added the comment:

Yes, sorry, I should have been less concise. =)

> Seriously, though, I presume this bug report is asking for either a 
> better error message or for .name to raise an attribute error on a 
> SpooledTemporaryFile?

I'm not sure what's better. I must be honest and say that I opened this report 
more to signal this behavior rather than provide a solution, though.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10355] SpooledTemporaryFile's name property is broken

2010-11-08 Thread Éric Araujo

Éric Araujo  added the comment:

>From the doc of tempfile.NamedTemporaryFile: “This function operates exactly 
>as TemporaryFile() does, except that the file is guaranteed to have a visible 
>name in the file system (on Unix, the directory entry is not unlinked). That 
>name can be retrieved from the name member of the file object. Whether the 
>name can be used to open the file a second time, while the named temporary 
>file is still open, varies across platforms (it can be so used on Unix; it 
>cannot on Windows NT or later).”

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10224] Build 3.x documentation using python3.x

2010-11-08 Thread Alexander Belopolsky

Alexander Belopolsky  added the comment:

As discussed on #python-dev, building  3.x documentation using python3.x will 
require Sphinx 1.1 which will not be released in time for 3.2.

I am adding #10225 as a dependency because I feel that fixing actual errors in 
ReST doctests is more important than upgrading documentation tool chain.  
Hopefully this will bring more eyes to that issue.

This said, I believe it is important for python-dev to "eat their own dogfood" 
and make 3.2 self-hosting.  In other words, if we want to convince users that 
3.x is ready, we should not require 2.x in the build process.

Fortunately, Doc/tools is not shipped with python releases, so the transition 
can be made at any time regardless of python release schedule.

--
dependencies: +Fix doctest runable examples in python manual
stage:  -> needs patch
type:  -> feature request

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1195] Problems on Linux with Ctrl-D and Ctrl-C during raw_input

2010-11-08 Thread Éric Araujo

Changes by Éric Araujo :


--
nosy: +pitrou

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10224] Build 3.x documentation using python3.x

2010-11-08 Thread Georg Brandl

Georg Brandl  added the comment:

I agree that 3.2 should eventually be independent of a 2.x Python.  Since the 
"port to 3.x" part of Sphinx 1.1 is basically done, I might just do an early 
alpha release and use that for Doc/tools before 3.2 final.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10360] _weakrefset.WeakSet.__contains__ should not propagate TypeErrors

2010-11-08 Thread Michael Foord

Changes by Michael Foord :


--
nosy: +michael.foord

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10355] SpooledTemporaryFile's name property is broken

2010-11-08 Thread R. David Murray

R. David Murray  added the comment:

Éric: right, but we're talking about *Spooled*Temprorary file, which doesn't 
say anything about a name, and in fact says that the data is kept in memory 
(which implies it has no name).

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1236] subprocess is not thread-safe

2010-11-08 Thread Chris Gerhard

Changes by Chris Gerhard :


--
nosy: +Chris.Gerhard

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10357] ** and "mapping" are poorly defined in python docs

2010-11-08 Thread Raymond Hettinger

Changes by Raymond Hettinger :


--
assignee: d...@python -> rhettinger

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10360] _weakrefset.WeakSet.__contains__ should not propagate TypeErrors

2010-11-08 Thread Georg Brandl

Georg Brandl  added the comment:

A result from IRC is that to be consistent with normal sets, only TypeErrors 
coming from ref() should be caught, but not those TypeErrors from the actual 
membership test (i.e. the hash functioon of the value).

--
assignee:  -> rhettinger
nosy: +georg.brandl, rhettinger

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10356] decimal.py: hash of -1

2010-11-08 Thread Raymond Hettinger

Raymond Hettinger  added the comment:

Good catch Stefan.  This is a regression from Py2.6.  The behavior for decimal 
should match that for int.

IDLE 2.6.2  
>>> hash(-1)
-2
>>> (-1).__hash__()
-2
>>> from decimal import *
>>> hash(Decimal(-1))
-2
>>> Decimal(-1).__hash__()
-2

--
nosy: +rhettinger

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue5819] Add PYTHONPREFIXES environment variable

2010-11-08 Thread Éric Araujo

Changes by Éric Araujo :


--
nosy: +barry, eric.araujo
versions: +Python 3.2 -Python 3.1

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10360] _weakrefset.WeakSet.__contains__ should not propagate TypeErrors

2010-11-08 Thread Tres Seaver

Changes by Tres Seaver :


Removed file: http://bugs.python.org/file19545/issue10360.patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10360] _weakrefset.WeakSet.__contains__ should not propagate TypeErrors

2010-11-08 Thread Tres Seaver

Tres Seaver  added the comment:

A new version of the patch, which only traps TypeErrors raises
by ref(item).  The test now ensures that hashing errors are
propagated, for compatibility with standard sets.

--
Added file: http://bugs.python.org/file19546/issue10360-redux.patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10360] _weakrefset.WeakSet.__contains__ should not propagate TypeErrors

2010-11-08 Thread Tres Seaver

Changes by Tres Seaver :


Removed file: http://bugs.python.org/file19546/issue10360-redux.patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10360] _weakrefset.WeakSet.__contains__ should not propagate TypeErrors

2010-11-08 Thread Tres Seaver

Tres Seaver  added the comment:

"One more time, with feeling."

Sorry for the noise, the last patch was not against the 2.7 trunk.

--
Added file: http://bugs.python.org/file19547/issue10360-redux.patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10360] _weakrefset.WeakSet.__contains__ should not propagate TypeErrors

2010-11-08 Thread Tres Seaver

Tres Seaver  added the comment:

FTR, the patch applies cleanly to the py3k branch, too. (Michael
pointed out that the original code was copied directly from there).

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10360] _weakrefset.WeakSet.__contains__ should not propagate TypeErrors

2010-11-08 Thread Tres Seaver

Changes by Tres Seaver :


--
versions: +Python 3.1

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10355] SpooledTemporaryFile's name property is broken

2010-11-08 Thread Éric Araujo

Éric Araujo  added the comment:

Wow, brain fail.  What I actually wanted to say:  SpooledTemporaryFile 
“operates exactly as TemporaryFile() does”, which is not guaranteed to have a 
name.  The definition of file-like object (linked from tempfile docs) says 
nothing about a name either.  Therefore, I think the presence of this attribute 
is a bug.

Adding Collin to nosy, as the committer of SpooledTemporaryFile.

--
nosy: +collinwinter

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10360] _weakrefset.WeakSet.__contains__ should not propagate TypeErrors

2010-11-08 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

What is the behaviour of WeakKeyDictionary here? I don't really agree that 
TypeError should be silenced.

--
nosy: +pitrou
versions: +Python 3.2

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10355] SpooledTemporaryFile's name property is broken

2010-11-08 Thread Giampaolo Rodola'

Giampaolo Rodola'  added the comment:

Also "encoding" and "mode" properties fail in the same manner.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10361] Fix issue 9995 - distutils forces developers to store password in cleartext (issue2874041)

2010-11-08 Thread Éric Araujo

New submission from Éric Araujo :

Looks globally good to me.

http://codereview.appspot.com/2874041/diff/2001/cmd.py
File cmd.py (right):

http://codereview.appspot.com/2874041/diff/2001/cmd.py#newcode55
cmd.py:55: :param distutils.dist.Distribution dist: distribution to work
with
Please don’t include unrelated changes in your patch.

Also, Python does not use :param: in docstrings.

http://codereview.appspot.com/2874041/diff/2001/command/upload.py
File command/upload.py (right):

http://codereview.appspot.com/2874041/diff/2001/command/upload.py#newcode53
command/upload.py:53: if not self.username and
self.distribution.username:
I’d prefer a clearer comparison, please use “is [not] None” and parens.

http://codereview.appspot.com/2874041/

--
messages: 120776
nosy: eric.araujo, techtonik
priority: normal
severity: normal
status: open
title: Fix issue 9995 - distutils forces developers to store password in 
cleartext (issue2874041)

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue9995] "setup.py register sdist upload" requires pass to be saved

2010-11-08 Thread Éric Araujo

Éric Araujo  added the comment:

Thanks for the patch.  Review on Rietveld.

What are “other Python distributions”?

--
components: +Distutils2
versions: +3rd party, Python 3.1, Python 3.2 -Python 2.6

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10321] Add support for Message objects and binary data to smtplib.sendmail

2010-11-08 Thread R. David Murray

R. David Murray  added the comment:

Committed in r86327.

--
resolution:  -> accepted
stage: patch review -> committed/rejected
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10360] _weakrefset.WeakSet.__contains__ should not propagate TypeErrors

2010-11-08 Thread Tres Seaver

Tres Seaver  added the comment:

WeakKeyDictionary's __contains__:

def __contains__(self, key):
try:
wr = ref(key)
except TypeError:
return 0
return wr in self.data

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10361] Fix issue 9995 - distutils forces developers to store password in cleartext (issue2874041)

2010-11-08 Thread Éric Araujo

Éric Araujo  added the comment:

Yay for obscure email interfaces.  Sorry for the noise.

--
resolution:  -> invalid
stage:  -> committed/rejected
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10362] AttributeError: addinfourl instance has no attribute 'tell'

2010-11-08 Thread ProgVal

New submission from ProgVal :

Hello,

I had this traceback:

Traceback (most recent call last):
...
  File "/home/progval/workspace/Supybot/Supybot-plugins/Packages/plugin.py", 
line 123, in extractData
file = tarfile.open(fileobj=file_)
  File "/usr/lib/python2.6/tarfile.py", line 1651, in open
saved_pos = fileobj.tell()
AttributeError: addinfourl instance has no attribute 'tell'

The repr(file_) is : > (the file has been downloaded with urllib).

I use Python 2.6.6 (from Debian Sid repo)

Best regards,
ProgVal

--
messages: 120781
nosy: Valentin.Lorentz
priority: normal
severity: normal
status: open
title: AttributeError: addinfourl instance has no attribute 'tell'

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10363] Embedded python, handle (memory) leak

2010-11-08 Thread Martin Dunschen

New submission from Martin Dunschen :

I found a number of 'handle leaks' in the core code to embed python into a 
C/C++ application on windows. 
To reproduce: 
The simplest possible embedded application only calls:

#include 
void entry()
{
Py_Initialize();
Py_Finalize();
}

I found (but this does not seem important to the problem) that when the above 
code is compiled into a Windows DLL, and from another simple app this DLL is 
loaded, the entry function is called and then the DLL is unloaded, the number 
of handles held by the application is increasing (by 3). Calling the steps 
"LoadLibrary, entry, FreeLibrary" in a loop will increase the number of held 
handles by 3 every time.

I can propose fixes for these 3 leaks, please find attached in the zip file 
patches for the files I have fixed.

But there are some issues remaining:
PyEval_InitThreads
allocates 'interpreter_lock', but there is nothing in the API that allows you 
to free this lock again. Should there maybe a function, in the API

void PyEval_FinishThreads(void)
{
if (!interpreter_lock)
return;
PyThread_free_lock(interpreter_lock);
}

That would get rid of another handle leak if a DLL embedding python would use 
PyEval_InitThreads.

In a specific DLL I am debugging just now I observe 2 more handle leaks (The 4 
I report here, and 2 more I have not yet found).

I hope my report is comprehensive and can be reproduced. I am happy to be of 
assistance if there are any questions.

Martin

--
components: Interpreter Core
messages: 120782
nosy: martind
priority: normal
severity: normal
status: open
title: Embedded python, handle (memory) leak
type: resource usage
versions: Python 2.5, Python 2.6, Python 2.7

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10362] AttributeError: addinfourl instance has no attribute 'tell'

2010-11-08 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc  added the comment:

With a socket file you cannot rely on autodetection of the format. I suggest to 
try
   tarfile.open(fileobj=file_, mode='r:')
or 
   tarfile.open(fileobj=file_, mode='r:gz')

--
nosy: +amaury.forgeotdarc

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10362] AttributeError: addinfourl instance has no attribute 'tell'

2010-11-08 Thread ProgVal

ProgVal  added the comment:

Thanks for your answer.

Sorry, no change...

--
components: +Library (Lib)
versions: +Python 2.6

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10364] Color coding fails after running program.

2010-11-08 Thread Typo

New submission from Typo :

Whenever I run a program in Python 3.1.2 (windows), the color coding 
disappears. print() is no longer purple, def is no longer orange, etc. It all 
turns black, and there doesn't seem to be a way to repair this. I've installed 
and uninstalled Python 3.1.2 several times and it's done nothing. Loading 
previous programs also causes this. Only if I am making a new program is the 
coding separated by color. Can anyone help?

--
components: None
messages: 120785
nosy: Typo
priority: normal
severity: normal
status: open
title: Color coding fails after running program.
type: performance
versions: Python 3.1

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10362] AttributeError: addinfourl instance has no attribute 'tell'

2010-11-08 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc  added the comment:

I'm sure the traceback changed then?
mode='r:' uses a different code path.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10362] AttributeError: addinfourl instance has no attribute 'tell'

2010-11-08 Thread ProgVal

ProgVal  added the comment:

Here is the new traceback:
Traceback (most recent call last):
...
  File "/home/progval/workspace/Supybot/Supybot-plugins/Packages/plugin.py", 
line 123, in extractData
file = tarfile.open(fileobj=file_, mode='r:')
  File "/usr/lib/python2.6/tarfile.py", line 1671, in open
return func(name, filemode, fileobj, **kwargs)
  File "/usr/lib/python2.6/tarfile.py", line 1698, in taropen
return cls(name, mode, fileobj, **kwargs)
  File "/usr/lib/python2.6/tarfile.py", line 1563, in __init__
self.offset = self.fileobj.tell()
AttributeError: addinfourl instance has no attribute 'tell'

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10361] Fix issue 9995 - distutils forces developers to store password in cleartext (issue2874041)

2010-11-08 Thread anatoly techtonik

anatoly techtonik  added the comment:

Reviewers: merwok,

Message:
I don't know when where will be time to redo the patch, but it would be
nice to get some answers in meanwhile.

http://codereview.appspot.com/2874041/diff/2001/cmd.py
File cmd.py (right):

http://codereview.appspot.com/2874041/diff/2001/cmd.py#newcode55
cmd.py:55: :param distutils.dist.Distribution dist: distribution to work
with
On 2010/11/08 17:17:11, merwok wrote:
> Please don’t include unrelated changes in your patch.

> Also, Python does not use :param: in docstrings.

Including this in another patch is too much work to ever happen. What
Python uses?

http://codereview.appspot.com/2874041/diff/2001/command/upload.py
File command/upload.py (right):

http://codereview.appspot.com/2874041/diff/2001/command/upload.py#newcode53
command/upload.py:53: if not self.username and
self.distribution.username:
On 2010/11/08 17:17:11, merwok wrote:
> I’d prefer a clearer comparison, please use “is [not] None” and
parens.
Are you sure you want an empty username in config file to override name
set from 'register' command?

Please review this at http://codereview.appspot.com/2874041/

Affected files:
   M cmd.py
   M command/register.py
   M command/upload.py
   M dist.py
   M tests/test_register.py

Index: tests/test_register.py
===
--- tests/test_register.py  (revision 86138)
+++ tests/test_register.py  (working copy)
@@ -152,6 +152,26 @@
  # therefore used afterwards by other commands
  self.assertEquals(cmd.distribution.password, 'password')

+def test_password_set_with_no_config(self):
+# check credentials are saved in dist if user chooses not to save  
them
+# in config file. they are used afterwards by other commands
+cmd = self._get_cmd()
+
+# patching raw_input and getpass.getpass. We are faking:
+# use your existing login (choice 1.)
+# Username : 'tarek'
+# Password : 'password'
+# Save your login (y/N)? : 'y'
+inputs = RawInputs('1', 'tarek', 'n')
+register_module.raw_input = inputs.__call__
+try:
+cmd.run()
+finally:
+del register_module.raw_input
+
+self.assertEquals(cmd.distribution.username, 'tarek')
+self.assertEquals(cmd.distribution.password, 'password')
+
  def test_registering(self):
  # this test runs choice 2
  cmd = self._get_cmd()
Index: command/register.py
===
--- command/register.py (revision 86138)
+++ command/register.py (working copy)
@@ -172,11 +172,11 @@

  # possibly save the login
  if code == 200:
-if self.has_config:
-# sharing the password in the distribution instance
-# so the upload command can reuse it
-self.distribution.password = password
-else:
+# sharing credentials in the distribution instance
+# so the upload command can reuse it
+self.distribution.username = username
+self.distribution.password = password
+if not self.has_config:
  self.announce(('I can store your PyPI login so future '
 'submissions will be faster.'),  
log.INFO)
  self.announce('(the login will be stored in %s)' % \
Index: command/upload.py
===
--- command/upload.py   (revision 86138)
+++ command/upload.py   (working copy)
@@ -48,8 +48,10 @@
  self.repository = config['repository']
  self.realm = config['realm']

-# getting the password from the distribution
+# getting credentials from the distribution
  # if previously set by the register command
+if not self.username and self.distribution.username:
+self.username = self.distribution.username
  if not self.password and self.distribution.password:
  self.password = self.distribution.password

Index: dist.py
===
--- dist.py (revision 86138)
+++ dist.py (working copy)
@@ -206,6 +206,7 @@
  self.extra_path = None
  self.scripts = None
  self.data_files = None
+self.username = ''
  self.password = ''

  # And now initialize bookkeeping stuff that can't be supplied by
Index: cmd.py
===
--- cmd.py  (revision 86138)
+++ cmd.py  (working copy)
@@ -51,6 +51,8 @@
  invokes the 'initialize_options()' method, which is the real
  initializer and depends on the actual command being
  instantiated.
+
+:param distutils.dist.Distribution dist: di

[issue10364] Color coding fails after running program.

2010-11-08 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

This is an editor rather than Python problem. Are you using the IDLE editor or 
something else. Which version of Windows?

Orange and purple are IDLE's default for keywords and built-in names. But 
running 3.1.2 under XP, I have no problem as you describe, either after running 
or loading.

--
nosy: +terry.reedy
type: performance -> 

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue9995] "setup.py register sdist upload" requires pass to be saved

2010-11-08 Thread anatoly techtonik

anatoly techtonik  added the comment:

This fix is needed for 2.6 releases also to be able to upload packages from 
Linux.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10361] Fix issue 9995 - distutils forces developers to store password in cleartext (issue2874041)

2010-11-08 Thread Éric Araujo

Éric Araujo  added the comment:

Further replies.  There’s still one comment in test_register you haven’t
addressed yet.

Tarek, I’d like to have your decision about one line in the upload
command.  (Don’t read the diff in this mail, it’s incomplete, go to
Rietveld.)  Thanks in advance.

http://codereview.appspot.com/2874041/diff/2001/cmd.py
File cmd.py (right):

http://codereview.appspot.com/2874041/diff/2001/cmd.py#newcode55
cmd.py:55: :param distutils.dist.Distribution dist: distribution to work
with
> Including this in another patch is too much work to ever happen.
We’ll have to revert it before committing then.

Something like “*dist* is an instance of blah”.

http://codereview.appspot.com/2874041/diff/2001/command/upload.py
File command/upload.py (right):

http://codereview.appspot.com/2874041/diff/2001/command/upload.py#newcode53
command/upload.py:53: if not self.username and
self.distribution.username:
This is a crazy case.  PyPI won’t allow it to pass, so I’m okay with it.
  Tarek, what do you think?

http://codereview.appspot.com/2874041/diff/2001/tests/test_register.py
File tests/test_register.py (right):

http://codereview.appspot.com/2874041/diff/2001/tests/test_register.py#newcode165
tests/test_register.py:165: inputs = RawInputs('1', 'tarek', 'n')
It looks like you’re replying to “username” and “save your login” but
not “password”.

http://codereview.appspot.com/2874041/

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10364] Color coding fails after running program.

2010-11-08 Thread Typo

Typo  added the comment:

I am using Windows Vista. The problem is not within Idle but within the screen 
where you create and save coding to use in Idle.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10365] IDLE Crashes on File Open Dialog when code window closed before other file opened

2010-11-08 Thread William Barr

New submission from William Barr :

Steps for reproduction:
1.  Open IDLE (Python 3.1.2)
2.  Open a .py file
3.  With the code window (not the shell window) in focus, Ctrl + O to bring up 
the open file dialog.  Do not select a file or press open.  
4.  Close the code window.  
5.  Select a file and try to open it.
6.  The IDLE process will terminate.  

This test was performed on Windows 7 Professional 32-bit as well as Windows XP 
Professional 32-bit.  

Python 3.1.2 (r312:79149, Mar 21 2010, 00:41:52) [MSC v.1500 32 bit (Intel)] on 
win32

--
components: IDLE, Windows
messages: 120793
nosy: william.barr
priority: normal
severity: normal
status: open
title: IDLE Crashes on File Open Dialog when code window closed before other 
file opened
type: crash
versions: Python 3.1

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10327] Abnormal SSL timeouts when using socket timeouts - once again

2010-11-08 Thread R. David Murray

Changes by R. David Murray :


--
resolution:  -> invalid
stage:  -> committed/rejected

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10365] IDLE Crashes on File Open Dialog when code window closed before other file opened

2010-11-08 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc  added the comment:

Reproduced in a console window:
C:\>c:\python31\python.exe -m idlelib.idle
Exception in Tkinter callback
Traceback (most recent call last):
  File "c:\python31\lib\tkinter\__init__.py", line 1399, in __call__
return self.func(*args)
  File "c:\python31\lib\idlelib\IOBinding.py", line 177, in open
self.editwin.flist.open(filename)
AttributeError: 'NoneType' object has no attribute 'flist'

--
nosy: +amaury.forgeotdarc

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10366] Remove unneeded '(object)' from 3.x class examples

2010-11-08 Thread Terry J. Reedy

New submission from Terry J. Reedy :

In 3.x, "(object)" is now superfluous in class statements. Reference manual 
7.7. Class definitions has simply
class Foo: pass

In library manual 2. Built-in Functions, class examples for classmethod and 
staticmethod are the same. Class examples for dir, property, and type still 
have '(object)' in their class examples. Section 5.11.4. Methods example omits 
it. I cannot think of anywhere else there should be such examples.

I think we should be consistent and remove the remaining occurrences of 
'(object)' in the function examples. They can only confuse newcomers.

This part is easy.

I also think the doc for 'class' should say that the default inheritance is 
from the base class *object* (I presume this should be true in all 
implementations) and that 
class Foo(object): pass
is the same as the above (unless the name 'object' has been rebound!).

--
assignee: d...@python
components: Documentation
keywords: easy
messages: 120795
nosy: d...@python, terry.reedy
priority: normal
severity: normal
stage: needs patch
status: open
title: Remove unneeded '(object)' from 3.x class examples
versions: Python 3.1, Python 3.2

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue5819] Add PYTHONPREFIXES environment variable

2010-11-08 Thread Barry A. Warsaw

Barry A. Warsaw  added the comment:

I'll look at this in more detail, but I can at least answer one question right 
now:

"The bona-fide known bug: the Debian package mantainer for Python decided to 
change "site-packages" to "dist-packages" in 2.6, for reasons I still don't 
quite understand."

This was done as an accommodation to upstream Python developers.  A from-source 
build of Python installs into /usr/local by default, with a site-packages 
situated there.  But the Debian interpretation of the FHS states that 
site-installed (i.e. not through the package manager) add-ons to Python should 
also live in /usr/local, and /usr/local/lib/pythonX.Y/site-packages was chosen 
as the most obvious place for that.

Unfortunately, this meant that if you installed Python from source using the 
defaults, it was possible to clobber either your system Python or your 
from-source installed Python by installing third party packages to an 
unintentionally shared directory.  This was a real problem.

Now, the Debian answer (probably rightly so) was that Python's from-source 
defaults should install into /opt not /usr/local, but this broke a decade's (at 
least) convention from upstream.  The compromise was to keep Debian's 
/usr/local interpretation of the FHS, but to choose a directory that would not 
conflict with a from-source installation of Python.  Thus dist-packages was 
chosen.  To keep the system Python consistent, Python packages installed via 
apt are installed to /usr/lib/pythonX.Y/dist-packages too.

I've had discussions with developers on both sides.  It's not an ideal solution 
to anyone, but I thought it was the best compromise available at that time, and 
still do.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10364] Color coding fails after running program.

2010-11-08 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

If it is an editor window that you launch from IDLE, with a red script Tk in 
the upper left corner, with 'About IDLE' on the help menu, then it is an IDLE 
editor window and part of IDLE -- and appropriate for bug reports here ;-).

This could be something specific to Vista; I do not know how well interactive 
things are tested there.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10366] Remove unneeded '(object)' from 3.x class examples

2010-11-08 Thread Éric Araujo

Éric Araujo  added the comment:

Other unneeded uses of object, courtesy of grep:

library/sqlite3.rst:713:   class Point(object):
library/multiprocessing.rst:1335:   class MathsClass(object):
library/functions.rst:281:  >>> class Foo(object):
library/functions.rst:897:  class C(object):
library/functions.rst:916:  class Parrot(object):
library/functions.rst:933:  class C(object):
library/functions.rst:1237:  >>> class X(object):
library/argparse.rst:1315:   >>> class C(object):
library/ctypes.rst:372:   >>> class Bottles(object):
library/itertools.rst:326:  class groupby(object):
howto/descriptor.rst:156:class RevealAccess(object):
howto/descriptor.rst:173:>>> class MyClass(object):
howto/descriptor.rst:205:class C(object):
howto/descriptor.rst:214:class Property(object):
howto/descriptor.rst:250:class Cell(object):
howto/descriptor.rst:278:class Function(object):
howto/descriptor.rst:286:>>> class D(object):
howto/descriptor.rst:358:>>> class E(object):
howto/descriptor.rst:371:class StaticMethod(object):
howto/descriptor.rst:384:>>> class E(object):
howto/descriptor.rst:419:class ClassMethod(object):
howto/sorting.rst:228:class K(object):
reference/datamodel.rst:1990:   >>> class C(object):
includes/sqlite3/adapter_point_2.py:3:class Point(object):
includes/sqlite3/converter_point.py:3:class Point(object):
includes/sqlite3/adapter_point_1.py:3:class Point(object):
includes/mp_newtype.py:15:class Foo(object):

--
nosy: +eric.araujo

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



  1   2   >