[issue9253] argparse: optional subparsers

2013-04-09 Thread paul j3

paul j3 added the comment:

I think this problem arises from a change made in 
http://bugs.python.org/issue10424

Changeset to default (i.e. development) is
http://hg.python.org/cpython/rev/cab204a79e09

Near the end of _parse_known_args it removes a:

if positionals:
   self.error(_('too few arguments'))

with a scan for required options that have not been seen. 

Ordinary positionals are required.  But a SubParsersAction is not required.  So 
we no longer get a warning.

http://bugs.python.org/issue12776 changed this block of code as well.  Notice 
the 2.7 and 3.2 branches have this 'too few arguments' error, but the default 
does not.

The default value for Action.required is False.  In _get_positional_kwargs(), a 
positional's required is set based on nargs (e.g. '+' is required, '*' not).  
But add_subparsers() does not use this, so its 'required' ends up False.

This fudge seems to do the trick:

   parser = ArgumentParser(prog='test')
   subparsers = parser.add_subparsers()
   subparsers.required = True
   subparsers.dest = 'command'
   subparser = subparsers.add_parser("foo", help="run foo")
   parser.parse_args()

producing an error message:

   usage: test [-h] {foo} ...
   test: error: the following arguments are required: command

subparsers.dest is set so the error message can give this positional a name.

I'll try to write a patch to do something similar in argparse itself.

--
nosy: +paul.j3

___
Python tracker 

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



[issue12181] SIGBUS error on OpenBSD (sparc64)

2013-04-09 Thread Federico Schwindt

Federico Schwindt added the comment:

>> Please note that the tests are still broken and need to be addressed (bignum 
>> and sys.maxsize passed to ident and data respectively).
>
> If you could fill a separate issue for that, it would be great.

I will but once this is committed. It'd make things easier.

> BTW, there are other OpenBSD-specific issues on the report, and we
> don't have that many contributors (AFAICT noone): so if you can have a
> look at them, that would be great (especially since our OpenBSD
> buildbots have all been down for some time now).

On this report or you mean in general? I don't mind looking if time permits.

Why are the OpenBSD buildbots down? Can we do anything about it?
Having a buildbot slave up will definitely help here.

--

___
Python tracker 

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



[issue17670] expandtabs() weirdness

2013-04-09 Thread Alfredo Solano Martínez

Alfredo Solano Martínez added the comment:

It does, thank you. Maybe hat example could be added to the docuentation?

--

___
Python tracker 

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



[issue17666] Extra gzip headers breaks _read_gzip_header

2013-04-09 Thread Peter

Peter added the comment:

Reopening: The same regression issue affects Python 3.2.4 as well, so if the 
fix could be committed to that branch as well that would be great.

Long term, I infer that there are no GZIP files in the test suite which use the 
GZIP header to store metadata (otherwise this bug would have been caught 
earlier). Should that be raised as a separate issue? I can prepare a very small 
test file if you like and attach it here.

--
status: closed -> open
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



[issue12181] SIGBUS error on OpenBSD (sparc64)

2013-04-09 Thread Charles-François Natali

Charles-François Natali added the comment:

>> If you could fill a separate issue for that, it would be great.
>
> I will but once this is committed. It'd make things easier.

No problem.

>> BTW, there are other OpenBSD-specific issues on the report, and we
>> don't have that many contributors (AFAICT noone): so if you can have a
>> look at them, that would be great (especially since our OpenBSD
>> buildbots have all been down for some time now).
>
> On this report or you mean in general?

typo: s/on the report/on the tracker.

> I don't mind looking if time permits.

That would be great (I try to fix NetBSD/OpenBSD issues myself, but since I 
don't have any installed machines with those OSes it's obviously much more 
complicated).

> Why are the OpenBSD buildbots down? Can we do anything about it?
> Having a buildbot slave up will definitely help here.

All the OpenBSD buildbots we have are provided by SnakeByte, and they're all 
offline: http://buildbot.python.org/all/builders
Maybe Trent has more info.

--
nosy: +trent

___
Python tracker 

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



[issue17673] add `copy_from` argument to temporaryfile

2013-04-09 Thread Antoine Pitrou

New submission from Antoine Pitrou:

It is sometimes useful to create a temporary file as a copy of an existing file 
(especially e.g. in tests, when you want to mutate the temp file but not the 
original). I would suggest adding a `copy_from` argument to TemporaryFile and 
NamedTemporaryFile, which is either the path to an existing file or a file-like 
object. Then the contents of that source file are copied to the tempfile before 
it is yielded.

--
components: Library (Lib)
messages: 186392
nosy: ncoghlan, pitrou
priority: normal
severity: normal
status: open
title: add `copy_from` argument to temporaryfile
type: enhancement
versions: Python 3.4

___
Python tracker 

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



[issue12181] SIGBUS error on OpenBSD (sparc64)

2013-04-09 Thread Federico Schwindt

Federico Schwindt added the comment:

This patch was made against 2.7.4. I've checked 3.3.1 and it obviously doesn't 
work as PyInt* are gone.

I'll update the patch later today so it can be used everywhere.

--

___
Python tracker 

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



[issue17666] Extra gzip headers breaks _read_gzip_header

2013-04-09 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Adding Georg for 3.2.

--
nosy: +georg.brandl, pitrou

___
Python tracker 

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



[issue17666] Extra gzip headers breaks _read_gzip_header

2013-04-09 Thread Christian Heimes

Changes by Christian Heimes :


--
nosy: +christian.heimes
resolution: fixed -> 
stage: committed/rejected -> commit review

___
Python tracker 

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



[issue17656] Python 2.7.4 breaks ZipFile extraction of zip files with unicode member paths

2013-04-09 Thread Christian Heimes

Changes by Christian Heimes :


--
nosy: +christian.heimes

___
Python tracker 

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



[issue17648] test_urllib2 convert doctests to unittest

2013-04-09 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 5c9b36969abc by Senthil Kumaran in branch '3.3':
#17648 - convert test_urllib2.py doctests to unittests
http://hg.python.org/cpython/rev/5c9b36969abc

--

___
Python tracker 

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



[issue17648] test_urllib2 convert doctests to unittest

2013-04-09 Thread Senthil Kumaran

Senthil Kumaran added the comment:

Changed in active branches (3.3 and default).

--
status: open -> closed

___
Python tracker 

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



[issue17648] test_urllib2 convert doctests to unittest

2013-04-09 Thread Senthil Kumaran

Changes by Senthil Kumaran :


--
versions: +Python 3.3

___
Python tracker 

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



[issue17674] All examples for concurrent.futures fail with "BrokenProcessPool"

2013-04-09 Thread gjwebber

New submission from gjwebber:

Running on Windows XP 32-bit.
Uninstalled Python 2.7, installed Python 3.3.

I asked a question on stack overflow, detailing the problem and supplying 
example code and Traceback here:
http://stackoverflow.com/questions/15900366/all-example-concurrent-futures-code-is-failing-with-brokenprocesspool

More info on request if required.

--
components: Library (Lib), Windows
messages: 186397
nosy: gjwebber
priority: normal
severity: normal
status: open
title: All examples for concurrent.futures fail with "BrokenProcessPool"
type: crash
versions: Python 3.3

___
Python tracker 

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



[issue17674] All examples for concurrent.futures fail with "BrokenProcessPool"

2013-04-09 Thread gjwebber

gjwebber added the comment:

Forgot to mention, the posted code works for another SO user on Debian and OS X.

--

___
Python tracker 

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



[issue17672] ssl unclean shutdown

2013-04-09 Thread Antoine Pitrou

Antoine Pitrou added the comment:

I don't think your patch is right:

- calling unwrap() already shuts down the SSL layer; this is the right way to 
do it and is documented as such: "Performs the SSL shutdown handshake, which 
removes the TLS layer from the underlying socket, and returns the underlying 
socket object"

- shutdown() right now isn't blocking; if you add a call to SSL shutdown, it 
can either block or fail with EAGAIN or similar, which is something people 
won't expect

- close() should simply close the file descriptor, like on a regular socket (if 
you call socket.close(), it won't shutdown the TCP connection, especially if 
there's another file descriptor referencing the same connection)

As for Modules/_ssl.c, the case where SSL_shutdown() returns 0 is already 
handled:

if (err == 0) {
/* Don't loop endlessly; instead preserve legacy
   behaviour of trying SSL_shutdown() only twice.
   This looks necessary for OpenSSL < 0.9.8m */
if (++zeros > 1)
break;
/* Shutdown was sent, now try receiving */
self->shutdown_seen_zero = 1;
continue;
}

... so I don't think anything more is necessary.

So I think things are fine right now and your patch shouldn't be applied.

--
nosy: +pitrou
stage:  -> patch review
versions:  -Python 2.6, Python 3.1, Python 3.2, Python 3.5

___
Python tracker 

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



[issue17675] show addresses in socket.__repr__

2013-04-09 Thread Giampaolo Rodola'

New submission from Giampaolo Rodola':

This is useful, for example, when running tests as "python3 -Wa" and you bump 
into:

ResourceWarning: unclosed 

With this we'd get:



If desirable, I will add some tests.

--
components: Library (Lib)
files: socket-repr.patch
keywords: patch
messages: 186400
nosy: giampaolo.rodola
priority: normal
severity: normal
status: open
title: show addresses in socket.__repr__
versions: Python 3.4
Added file: http://bugs.python.org/file29751/socket-repr.patch

___
Python tracker 

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



[issue17675] show addresses in socket.__repr__

2013-04-09 Thread Giampaolo Rodola'

Changes by Giampaolo Rodola' :


--
nosy: +pitrou

___
Python tracker 

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



[issue17674] All examples for concurrent.futures fail with "BrokenProcessPool"

2013-04-09 Thread Antoine Pitrou

Antoine Pitrou added the comment:

This is not the example code. The example code uses a main() function which is 
guarded by a "if" block:

if __name__ == '__main__':
main()

See http://docs.python.org/2/library/multiprocessing.html#windows for 
explanations.

Also, perhaps the concurrent.futures docs could point to that paragraph.

--
assignee:  -> docs@python
components: +Documentation -Library (Lib), Windows
nosy: +docs@python, pitrou
type: crash -> behavior
versions: +Python 3.4

___
Python tracker 

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



[issue17676] spwd uses -1 for empty attributes

2013-04-09 Thread Alex Waite

New submission from Alex Waite:

spwd uses -1 rather than '' for empty attributes. This is different from the 
behaviour in the pwd module, and makes it more difficult to generate a new, 
valid shadow entry.

In my opinion, simply doing a ':'.join(str(val) for val in rec) should result 
in a valid entry. With pwd this is currently possible. Not so with spwd.

pwd:
import pwd
rec = pwd.getpwnam('alex')
print ':'.join(str(val) for val in rec)

spwd:
import spwd
rec = spwd.getspnam('alex')
shdw = ''
for idx, val in enumerate(recs_shdw):
if idx != 0:
shdw += ':'

if val != -1:
shdw += str(val)

print shdw

--
messages: 186402
nosy: Alexqw
priority: normal
severity: normal
status: open
title: spwd uses -1 for empty attributes
type: behavior
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



[issue16427] Faster hash implementation

2013-04-09 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Well, the quality of the hash function is clearly reduced:

>>> hash("abcdefgh") & 0xff
206
>>> hash("abcdefgi") & 0xff
206
>>> hash("abcdefgj") & 0xff
206
>>> hash("abxx") & 0xff
206
>>> hash("aa11") & 0xff
206
>>> hash("aa12") & 0xff
206


Now to know if that may produce slowdowns in some situations... (dicts and sets 
have a sophisticated probing algorithm which takes into account the whole hash 
value, not the masked one).

--

___
Python tracker 

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



[issue17677] Invitation to connect on LinkedIn

2013-04-09 Thread Bruce Frederiksen

New submission from Bruce Frederiksen:

LinkedIn


Python,

I'd like to add you to my professional network on LinkedIn.

- Bruce

Bruce Frederiksen
Information Technology and Services Professional
Tampa/St. Petersburg, Florida Area

Confirm that you know Bruce Frederiksen:
https://www.linkedin.com/e/-3qcne3-hfb45911-6b/isd/12316860876/7QjJbS4a/?hs=false&tok=0GlQRpsV-Mh5I1

--
You are receiving Invitation to Connect emails. Click to unsubscribe:
http://www.linkedin.com/e/-3qcne3-hfb45911-6b/z2oU7dKDzpt2G7xQz2FC2SclHmnUGzmsk0c/goo/report%40bugs%2Epython%2Eorg/20061/I4080988955_1/?hs=false&tok=3s-0HjjjGMh5I1

(c) 2012 LinkedIn Corporation. 2029 Stierlin Ct, Mountain View, CA 94043, USA.

--
messages: 186404
nosy: dangyogi
priority: normal
severity: normal
status: open
title: Invitation to connect on LinkedIn

___
Python tracker 

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



[issue17678] DeprecationWarning fix on cookiejar module since Python 3.3

2013-04-09 Thread Wei-Cheng Pan

Changes by Wei-Cheng Pan :


--
components: Library (Lib)
files: cookiejar_fix_deprecated_method_calls.patch
keywords: patch
nosy: Wei-Cheng.Pan
priority: normal
severity: normal
status: open
title: DeprecationWarning fix on cookiejar module since Python 3.3
versions: Python 3.3
Added file: 
http://bugs.python.org/file29752/cookiejar_fix_deprecated_method_calls.patch

___
Python tracker 

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



[issue17677] Invitation to connect on LinkedIn

2013-04-09 Thread Charles-François Natali

Changes by Charles-François Natali :


--
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



[issue16427] Faster hash implementation

2013-04-09 Thread STINNER Victor

STINNER Victor added the comment:

> (dicts and sets have a sophisticated probing algorithm which takes into 
> account the whole hash value, not the masked one).

Correct, so your specific example should not be a problem since the
whole hash value is different for the 6 hash values.

> Now to know if that may produce slowdowns in some situations...

pybench and perf.py can be used to measure performances of the patch.
The speedup may not be detected, but a slowdown would be detected at
least.

2013/4/9 Antoine Pitrou :
>
> Antoine Pitrou added the comment:
>
> Well, the quality of the hash function is clearly reduced:
>
 hash("abcdefgh") & 0xff
> 206
 hash("abcdefgi") & 0xff
> 206
 hash("abcdefgj") & 0xff
> 206
 hash("abxx") & 0xff
> 206
 hash("aa11") & 0xff
> 206
 hash("aa12") & 0xff
> 206
>
>
> Now to know if that may produce slowdowns in some situations... (dicts and 
> sets have a sophisticated probing algorithm which takes into account the 
> whole hash value, not the masked one).
>
> --
>
> ___
> Python tracker 
> 
> ___

--

___
Python tracker 

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



[issue16427] Faster hash implementation

2013-04-09 Thread Charles-François Natali

Charles-François Natali added the comment:

Note that the patch uses type punning through a union: while GCC allows this, 
it's not allowed by ANSI (although since we're using a char [], it's somewhat a 
grey area). An aggresive compiler could optimiza the read/write away.

--
nosy: +neologix

___
Python tracker 

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



[issue17678] DeprecationWarning fix on cookiejar module since Python 3.3

2013-04-09 Thread Wei-Cheng Pan

New submission from Wei-Cheng Pan:

Please ignore previous typo patch.

This is the correct version

--
Added file: 
http://bugs.python.org/file29753/cookiejar_fix_deprecated_method_calls.patch

___
Python tracker 

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



[issue17678] DeprecationWarning fix on cookiejar module since Python 3.3

2013-04-09 Thread Wei-Cheng Pan

Changes by Wei-Cheng Pan :


Removed file: 
http://bugs.python.org/file29752/cookiejar_fix_deprecated_method_calls.patch

___
Python tracker 

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



[issue17679] sysconfig generation uses some env variables multiple times

2013-04-09 Thread Bohuslav "Slavek" Kabrda

New submission from Bohuslav "Slavek" Kabrda:

When compiling Python 3.3.1, I noticed that some variables like LDFLAGS or 
CFLAGS in sysconfig have some flags multiple times. (Which BTW breaks 
distutils.tests.{test_sysconfig_compiler_vars,test_sysconfig_module}) This is 
caused by interpretation of Makefile in sysconfig._parse_makefile(), which 
seems to evaluate the variables in Makefile - but some variables in Makefile 
are formed by expanding env variables multiple times, e.g.:
PY_LDFLAGS=$(CONFIGURE_LDFLAGS) $(LDFLAGS)
CONFIGURE_LDFLAGS=@LDFLAGS@
so when doing the build from scratch with configure & make, PY_LDFLAGS gets the 
content of LDFLAGS twice  (as far as I remember autotools...), CFLAGS gets 
expanded like 5 times at least.
I think that this is not the correct behaviour, but not sure, maybe I'm doing 
something wrong.

Thanks.

--
components: Build
messages: 186408
nosy: bkabrda
priority: normal
severity: normal
status: open
title: sysconfig generation uses some env variables multiple times
type: behavior
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



[issue17674] All examples for concurrent.futures fail with "BrokenProcessPool"

2013-04-09 Thread gjwebber

gjwebber added the comment:

As mentioned in the previously linked post, I copy-pasted the example code 
shown here:
http://docs.python.org/dev/library/concurrent.futures.html#processpoolexecutor-example

Which resulted in exactly the same error as the 'more simple' example I 
provided.

There is no mention of anything Windows specific on the documentation page, or 
any hints as to why this may not be working.

--

___
Python tracker 

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



[issue17680] self is lost if methods are callable objects

2013-04-09 Thread Roman Rader

New submission from Roman Rader:

Some strange behavior is observed while method in object substitutes with 
callable object.

For example:
-
class Meth(object):
def __call__(*args, **kwargs):
print (args, kwargs)

class X(object):
def some_method(*args, **kwargs):
print (args, kwargs)

x = X()
x.some_method(1)
X.some_method = Meth()
x.some_method(1)

-
Output
(<__main__.X object at 0xb72d408c>, 1) {}
(<__main__.Meth object at 0xb72d40cc>, 1) {}
-

So, second call lost caller object ("self").
I suppose second output should be
(<__main__.Meth object ...>, <__main__.X object ...>, 1) {}


Tested in Python 2.7 and Python 3.3.

--
components: Interpreter Core
messages: 186410
nosy: Roman.Rader
priority: normal
severity: normal
status: open
title: self is lost if methods are callable objects
versions: 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



[issue17674] All examples for concurrent.futures fail with "BrokenProcessPool"

2013-04-09 Thread gjwebber

gjwebber added the comment:

Just ran the example code linked here again for my own sanity:
http://docs.python.org/dev/library/concurrent.futures.html#processpoolexecutor-example

Exactly the same thing happened. Here is the Traceback:
Traceback (most recent call last):
  File "", line 420, in run_nodebug
  File "", line 28, in 
  File "", line 24, in main
  File "C:\Python33\lib\concurrent\futures\_base.py", line 546, in 
result_iterator
yield future.result()
  File "C:\Python33\lib\concurrent\futures\_base.py", line 399, in result
return self.__get_result()
  File "C:\Python33\lib\concurrent\futures\_base.py", line 351, in __get_result
raise self._exception
concurrent.futures.process.BrokenProcessPool: A process in the process pool was 
terminated abruptly while the future was running or pending.

--

___
Python tracker 

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



[issue17680] self is lost if methods are callable objects

2013-04-09 Thread Christian Heimes

Christian Heimes added the comment:

Your callable object has to implement the descriptor protocol. Otherwise the 
object isn't wrapped in a method object. 
http://docs.python.org/2/howto/descriptor.html

Please ask on the Python user list if you still need more information.

--
nosy: +christian.heimes
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



[issue17678] DeprecationWarning fix on cookiejar module since Python 3.3

2013-04-09 Thread Roundup Robot

Roundup Robot added the comment:

New changeset b3d5621511db by Senthil Kumaran in branch '3.3':
#17678: Fix DeprecationWarning in the http/cookiejar.py by changing the usage
http://hg.python.org/cpython/rev/b3d5621511db

New changeset 79387f3bcc92 by Senthil Kumaran in branch 'default':
#17678: Remove the use of a deprecated method http/cookiejar.py. Changing the
http://hg.python.org/cpython/rev/79387f3bcc92

--
nosy: +python-dev

___
Python tracker 

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



[issue17678] DeprecationWarning fix on cookiejar module since Python 3.3

2013-04-09 Thread Senthil Kumaran

Senthil Kumaran added the comment:

Thanks for the patch. Realized that is_third_party method does not have test 
coverage. Hence this was not detected by our test runs. Increasing the coverage 
may be a TODO.

--
assignee:  -> orsenthil
nosy: +orsenthil
resolution:  -> fixed
stage:  -> committed/rejected
status: open -> closed
type:  -> behavior

___
Python tracker 

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



[issue17672] ssl unclean shutdown

2013-04-09 Thread Hiroaki Kawai

Hiroaki Kawai added the comment:

Please run the test so that you'll see the problem.

2013/4/9 Antoine Pitrou 

>
> Antoine Pitrou added the comment:
>
> I don't think your patch is right:
>
> - calling unwrap() already shuts down the SSL layer; this is the right way
> to do it and is documented as such: "Performs the SSL shutdown handshake,
> which removes the TLS layer from the underlying socket, and returns the
> underlying socket object"
>
> - shutdown() right now isn't blocking; if you add a call to SSL shutdown,
> it can either block or fail with EAGAIN or similar, which is something
> people won't expect
>
> - close() should simply close the file descriptor, like on a regular
> socket (if you call socket.close(), it won't shutdown the TCP connection,
> especially if there's another file descriptor referencing the same
> connection)
>
> As for Modules/_ssl.c, the case where SSL_shutdown() returns 0 is already
> handled:
>
> if (err == 0) {
> /* Don't loop endlessly; instead preserve legacy
>behaviour of trying SSL_shutdown() only twice.
>This looks necessary for OpenSSL < 0.9.8m */
> if (++zeros > 1)
> break;
> /* Shutdown was sent, now try receiving */
> self->shutdown_seen_zero = 1;
> continue;
> }
>
> ... so I don't think anything more is necessary.
>
> So I think things are fine right now and your patch shouldn't be applied.
>
> --
> nosy: +pitrou
> stage:  -> patch review
> versions:  -Python 2.6, Python 3.1, Python 3.2, Python 3.5
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

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



[issue17666] Extra gzip headers breaks _read_gzip_header

2013-04-09 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

The committed patch contains a simple test for gzip file with an extra field. 
When we add the feature to create gzip files with an extra field, this test can 
be extended.

--

___
Python tracker 

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



[issue17672] ssl unclean shutdown

2013-04-09 Thread Charles-François Natali

Charles-François Natali added the comment:

> sometimes RST was sent over the network instead of FIN

Your client sends data, but the server never reads it: when a TCP socket is 
closed while there's still data in the input socket buffer, a RST is sent 
instead of a FIN. That's normal behaviour.

--
nosy: +neologix

___
Python tracker 

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



[issue17672] ssl unclean shutdown

2013-04-09 Thread Hiroaki Kawai

Hiroaki Kawai added the comment:

Client gets an exception in reading the socket, not in writing. Please run
the test code and see what happens.

2013/4/9 Charles-François Natali 

>
> Charles-François Natali added the comment:
>
> > sometimes RST was sent over the network instead of FIN
>
> Your client sends data, but the server never reads it: when a TCP socket
> is closed while there's still data in the input socket buffer, a RST is
> sent instead of a FIN. That's normal behaviour.
>
> --
> nosy: +neologix
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

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



[issue17674] All examples for concurrent.futures fail with "BrokenProcessPool"

2013-04-09 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Ok, can someone else confirm the issue on Windows?

--
nosy: +brian.curtin, sbt, tim.golden

___
Python tracker 

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



[issue17672] ssl unclean shutdown

2013-04-09 Thread Charles-François Natali

Charles-François Natali added the comment:

> Client gets an exception in reading the socket, not in writing. Please run
> the test code and see what happens.

Of course it gets ECONNRESET on subsequent recv(), that's how TCP works.

Just make your handler read from the socket and it won't happen anymore.

--

___
Python tracker 

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



[issue17674] All examples for concurrent.futures fail with "BrokenProcessPool"

2013-04-09 Thread Brian Curtin

Brian Curtin added the comment:

The example code works for me on 3.3.0 on Windows 8. I'd have to find a VM to 
try out XP like gjwebber - will look later.

--

___
Python tracker 

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



[issue17681] Work with an extra field of gzip files

2013-04-09 Thread Serhiy Storchaka

New submission from Serhiy Storchaka:

Gzip files can contains an extra field and some applications use this for 
extending gzip format. The current GzipFile implementation ignores this field 
on input and doesn't allow to create a new file with an extra field.

I propose to save an extra field data on reading as a GzipFile attribute and 
add new parameter for GzipFile constructor for creating new file with an extra 
field.

--
components: Library (Lib)
messages: 186423
nosy: serhiy.storchaka
priority: normal
severity: normal
stage: needs patch
status: open
title: Work with an extra field of gzip files
type: enhancement
versions: Python 3.4

___
Python tracker 

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



[issue16427] Faster hash implementation

2013-04-09 Thread STINNER Victor

STINNER Victor added the comment:

> Note that the patch uses type punning through a union

What is the standard and portable way to cast an array of bytes to size_t?

2013/4/9 Charles-François Natali :
>
> Charles-François Natali added the comment:
>
> Note that the patch uses type punning through a union: while GCC allows this, 
> it's not allowed by ANSI (although since we're using a char [], it's somewhat 
> a grey area). An aggresive compiler could optimiza the read/write away.
>
> --
> nosy: +neologix
>
> ___
> Python tracker 
> 
> ___

--

___
Python tracker 

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



[issue17672] ssl unclean shutdown

2013-04-09 Thread Antoine Pitrou

Antoine Pitrou added the comment:

> Client gets an exception in reading the socket, not in writing.

Yes, it does, and the exception bears the error code SSL_ERROR_EOF (8), which 
is expected here.

The question is: why would you expect reading *not* to raise an exception while 
the remote end of the connection has been closed? TCPStreamHandler will only 
keep the connection alive as long as the handle() method is running, the 
connection is disposed of afterwards.

--

___
Python tracker 

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



[issue17672] ssl unclean shutdown

2013-04-09 Thread Hiroaki Kawai

Hiroaki Kawai added the comment:

As an interface of ssl socket, server does not have to read, just write
some data.
The client side should be able to read the bytes that ther server sent. The
problem is that client will sometimes raise an unexpected SSLError in
reading the ssl socket because server side does not shutdown the ssl
session cleanly.

2013/4/9 Charles-François Natali 

>
> Charles-François Natali added the comment:
>
> > Client gets an exception in reading the socket, not in writing. Please
> run
> > the test code and see what happens.
>
> Of course it gets ECONNRESET on subsequent recv(), that's how TCP works.
>
> Just make your handler read from the socket and it won't happen anymore.
>
> --
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

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



[issue17672] ssl unclean shutdown

2013-04-09 Thread Charles-François Natali

Charles-François Natali added the comment:

> As an interface of ssl socket, server does not have to read, just write
> some data.
> The client side should be able to read the bytes that ther server sent. The
> problem is that client will sometimes raise an unexpected SSLError in
> reading the ssl socket because server side does not shutdown the ssl
> session cleanly.

Once again, that's not how TCP works.
If your server doesn't read data that the client sent it, a RST will
be sent when the server closes its end.

Please do read the TCP spec, or use google:
http://cs.baylor.edu/~donahoo/practical/CSockets/TCPRST.pdf

I suggest closing this issue...

--

___
Python tracker 

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



[issue17672] ssl unclean shutdown

2013-04-09 Thread Antoine Pitrou

Antoine Pitrou added the comment:

> As an interface of ssl socket, server does not have to read, just
> write
> some data.
> The client side should be able to read the bytes that ther server
> sent.

Please re-read your own code. The server does:

+def handle(self):
+self.wfile.write("123")

and the client does:

+s.recv(3)

So, yes, the client is able to read the 3 bytes that the server sent.
It's only when you are trying to read an additional byte that an
exception is raised, because the TCP connection has been closed
by the server.

--

___
Python tracker 

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



[issue17672] ssl unclean shutdown

2013-04-09 Thread Hiroaki Kawai

Hiroaki Kawai added the comment:

The error looks like : SSLError(8, '_ssl.c:1363: EOF occurred in violation
of protocol')
But why we see "in violation of protocol" here?

2013/4/10 Antoine Pitrou 

>
> Antoine Pitrou added the comment:
>
> > Client gets an exception in reading the socket, not in writing.
>
> Yes, it does, and the exception bears the error code SSL_ERROR_EOF (8),
> which is expected here.
>
> The question is: why would you expect reading *not* to raise an exception
> while the remote end of the connection has been closed? TCPStreamHandler
> will only keep the connection alive as long as the handle() method is
> running, the connection is disposed of afterwards.
>
> --
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

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



[issue17536] update browser list with additional browser names

2013-04-09 Thread Matthias Klose

Matthias Klose added the comment:

in http://mail.python.org/pipermail/python-dev/2013-April/125205.html Guido 
made the suggestion:

"""
But perhaps we could change the focus for 2.7 development a bit:
instead of fixing bugs (or bickering about whether something is a bug
fix or a new feature) we could limit changes to ensuring that it works
on newer platforms.
"""

so I'll wait some more days ...

--

___
Python tracker 

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



[issue17682] _io is missing in Setup.dist in 2.7.x

2013-04-09 Thread Matthias Klose

New submission from Matthias Klose:

_io is missing in Setup.dist in 2.7.x. just adding it, copied the file list 
from the setup.py, leaving it commented out.

--
components: Build
messages: 186430
nosy: doko
priority: normal
severity: normal
status: open
title: _io is missing in Setup.dist in 2.7.x
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



[issue17536] update browser list with additional browser names

2013-04-09 Thread Matthias Klose

Matthias Klose added the comment:

consider that chrome is your only browser installed, then the module should 
work as well.

--

___
Python tracker 

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



[issue17536] update browser list with additional browser names

2013-04-09 Thread Senthil Kumaran

Senthil Kumaran added the comment:

Doko: I am not strongly against the 2.7 patch. Given the last point you made 
providing the context from BDFL and also some of Eric's points, going ahead 
with your 2.7 patch seems OK to me. So +1

--

___
Python tracker 

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



[issue17682] _io is missing in Setup.dist in 2.7.x

2013-04-09 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 075bbf701d0b by doko in branch '2.7':
- Issue #17682: Add the _io module to Modules/Setup.dist (commented out).
http://hg.python.org/cpython/rev/075bbf701d0b

--
nosy: +python-dev

___
Python tracker 

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



[issue17682] _io is missing in Setup.dist in 2.7.x

2013-04-09 Thread Matthias Klose

Changes by Matthias Klose :


--
resolution:  -> fixed
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



[issue17672] ssl unclean shutdown

2013-04-09 Thread Hiroaki Kawai

Hiroaki Kawai added the comment:

Ah, sorry I understood now.

--

___
Python tracker 

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



[issue17672] ssl unclean shutdown

2013-04-09 Thread Antoine Pitrou

Antoine Pitrou added the comment:

> The error looks like : SSLError(8, '_ssl.c:1363: EOF occurred in
> violation
> of protocol')
> But why we see "in violation of protocol" here?

Because the SSL layer wasn't shutdown cleanly: the TCP connection was
closed while the SSL layer was still active. You have three solutions
around this:

- you can call unwrap() for a clean SSL shutdown (the server has to call
unwrap() too).

- you can use suppress_ragged_eofs=True with wrap_socket()

- you can simply avoid reading past the server's data, which will
solve the problem altogether

--

___
Python tracker 

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



[issue17511] Idle find function closes after each find operation

2013-04-09 Thread Sarah

Sarah added the comment:

I agree that discussion is a good idea. 

Personally, though, I don't want to make the user hit ^F once to set the key 
and use ^G to find it again. It works well and, for a more advanced user, is 
great, but it adds to what a user must learn to get up and running in Python 
and doesn't conform to general conventions. I started using Python 6 months 
ago, and it took me a while to realize how 'find' worked in IDLE.

For a beginner's IDE, I'd really like to see all of the features accessible 
through the GUI, and have those features conform to currently accepted 
standards.

I'm certainly not saying there isn't a better way to do this. I'd love to have 
a conversation on what that might be. 

NOTE: This patch makes 'find' function's functionality consistent with the 
'find' function in the 'Replace' menu. If we find a better way to implement the 
find function, we should extend that functionality to the 'Replace' menu.

--

___
Python tracker 

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



[issue17672] ssl unclean shutdown

2013-04-09 Thread Hiroaki Kawai

Hiroaki Kawai added the comment:

I think creating an ssl socket from existing socket from an instance
generated by library routine, and replace that socket with ssl socket is
very common usage. Injecting wrap_socket is very easy. But injecting unwrap
call is not easy.

In python 2.6, I got a plain socket.error of "connection reset" (not
SSLError) in client side in such situation without unwrap in server side.
The same code does not raise exception in python 2.7, which I don't know
why...

Any way, reading the data in server side will solve the problem, thanks.

2013/4/10 Antoine Pitrou 

>
> Antoine Pitrou added the comment:
>
> > The error looks like : SSLError(8, '_ssl.c:1363: EOF occurred in
> > violation
> > of protocol')
> > But why we see "in violation of protocol" here?
>
> Because the SSL layer wasn't shutdown cleanly: the TCP connection was
> closed while the SSL layer was still active. You have three solutions
> around this:
>
> - you can call unwrap() for a clean SSL shutdown (the server has to call
> unwrap() too).
>
> - you can use suppress_ragged_eofs=True with wrap_socket()
>
> - you can simply avoid reading past the server's data, which will
> solve the problem altogether
>
> --
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

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



[issue17672] ssl unclean shutdown

2013-04-09 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Ok, closing the issue then.

--
resolution:  -> 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



[issue16427] Faster hash implementation

2013-04-09 Thread Gregory P. Smith

Gregory P. Smith added the comment:

> > Note that the patch uses type punning through a union
>
> What is the standard and portable way to cast an array of bytes to size_t?

I'd expect just casting the pointer type before dereferencing:

unsigned char *p;
...
hash = (multiplier * hash) ^ *((Py_uhash_t *)p);

(don't use size_t, use Py_uhash_t)

--

___
Python tracker 

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



[issue17675] show addresses in socket.__repr__

2013-04-09 Thread Antoine Pitrou

Antoine Pitrou added the comment:

This sounds ok to me. It will indeed make things clearer in tests.

--

___
Python tracker 

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



[issue16427] Faster hash implementation

2013-04-09 Thread Antoine Pitrou

Antoine Pitrou added the comment:

> pybench and perf.py can be used to measure performances of the patch.
> The speedup may not be detected, but a slowdown would be detected at
> least.

The slowdown would only occur for specific, well-chosen patterns. Also it may 
make DoS attacks easier.
(remember the reason we randomized hashes is so that it's hard for attackers to 
find collisions)

--

___
Python tracker 

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



[issue16427] Faster hash implementation

2013-04-09 Thread Charles-François Natali

Charles-François Natali added the comment:

> I'd expect just casting the pointer type before dereferencing:
>
> unsigned char *p;
> ...
> hash = (multiplier * hash) ^ *((Py_uhash_t *)p);
>
> (don't use size_t, use Py_uhash_t)

Is p guaranteed to be size_t aligned?
If not, unaligned access can segfault (e.g. on Sparc IIRC).

> Also it may make DoS attacks easier.

Indeed.
And the increase in collision you demonstrated in your previous
message worries me (both security and performance wise).

--

___
Python tracker 

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



[issue16427] Faster hash implementation

2013-04-09 Thread Charles-François Natali

Charles-François Natali added the comment:

> Is p guaranteed to be size_t aligned?
> If not, unaligned access can segfault (e.g. on Sparc IIRC).

Apparently yes.

--

___
Python tracker 

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



[issue17656] Python 2.7.4 breaks ZipFile extraction of zip files with unicode member paths

2013-04-09 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Perhaps this would deserve a 2.7.5?

--
nosy: +pitrou

___
Python tracker 

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



[issue17636] Modify IMPORT_FROM to fallback on sys.modules

2013-04-09 Thread Martin Morrison

Changes by Martin Morrison :


--
nosy: +isoschiz

___
Python tracker 

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



[issue17566] Make importlib.abc.Loader.module_repr optional

2013-04-09 Thread Brett Cannon

Changes by Brett Cannon :


--
components: +Library (Lib) -Documentation
title: Document that importlib.abc.Loader.module_repr is abstract and thus 
needed by various other ABCs -> Make importlib.abc.Loader.module_repr optional
versions:  -Python 3.3

___
Python tracker 

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



[issue17650] There is no exception correspond to errno EROFS

2013-04-09 Thread Andrew Svetlov

Andrew Svetlov added the comment:

Ok. Antoine's comment is clean.
Let's close the issue.

--
status: pending -> closed

___
Python tracker 

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



[issue17674] All examples for concurrent.futures fail with "BrokenProcessPool"

2013-04-09 Thread Richard Oudkerk

Richard Oudkerk added the comment:

@gjwebber: How exactly are you running the program to get that traceback?

The following lines make it look like you are doing something non-standard (as 
opposed to just saving the file and running it from the command line):

  File "", line 420, in run_nodebug
  File "", line 28, in 
  File "", line 24, in main

--

___
Python tracker 

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



[issue8106] SSL session management

2013-04-09 Thread Wade

Changes by Wade :


--
nosy: +WadeC

___
Python tracker 

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



[issue7511] msvc9compiler.py: ValueError when trying to compile with VC Express

2013-04-09 Thread Steve Dower

Steve Dower added the comment:

I've added a patch that replaces query_vcvarsall() with an implementation that 
does not try and use the batch file. Instead, the functionality of the batch 
file (effectively, reading the base path from the registry and appending 
constants) is reproduced in Python code.

(There is a second patch for 2.7, since winreg/_winreg is different between the 
two.)

There is no reason to expect that the installation layout of VC9 and VC10 will 
change at this stage, though future updates may be required for new versions 
(though I've already added the mapping for VC11 - not that we're building 
Python with that one yet).

I have left find_vcvarsall() in there, even though it is no longer used, in 
case other tools are monkeypatching to work around the existing issue.

--
Added file: http://bugs.python.org/file29754/msvccompiler9_33.diff

___
Python tracker 

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



[issue7511] msvc9compiler.py: ValueError when trying to compile with VC Express

2013-04-09 Thread Steve Dower

Steve Dower added the comment:

Adding patch for 2.7.

--
Added file: http://bugs.python.org/file29755/msvccompiler9_27.diff

___
Python tracker 

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



[issue17669] Segfault caused by weird combination of imports and yield from

2013-04-09 Thread Arfrever Frehtes Taifersar Arahesis

Changes by Arfrever Frehtes Taifersar Arahesis :


--
nosy: +Arfrever

___
Python tracker 

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



[issue17093] Make importlib.abc more inheritance-friendly

2013-04-09 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 8e733e30edf6 by Brett Cannon in branch 'default':
Issue #17093,17566,17567: Methods from classes in importlib.abc now raise/return
http://hg.python.org/cpython/rev/8e733e30edf6

New changeset 7e91dc7221d5 by Brett Cannon in branch 'default':
What's new entry for issue #17093
http://hg.python.org/cpython/rev/7e91dc7221d5

--
nosy: +python-dev

___
Python tracker 

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



[issue17093] Make importlib.abc more inheritance-friendly

2013-04-09 Thread Brett Cannon

Changes by Brett Cannon :


--
resolution:  -> fixed
stage: test needed -> 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



[issue17566] Make importlib.abc.Loader.module_repr optional

2013-04-09 Thread Brett Cannon

Brett Cannon added the comment:

Fixed by http://hg.python.org/cpython/rev/8e733e30edf6 by raising 
NotImplementedError and relying on the fact that ModuleType.__repr__() swallows 
any exception.

--
resolution:  -> fixed
stage: needs patch -> 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



[issue17567] Clarify importlib.abc.PathEntryFinder.find_loader() docs

2013-04-09 Thread Brett Cannon

Brett Cannon added the comment:

Covered by http://hg.python.org/cpython/rev/8e733e30edf6

--
resolution:  -> fixed
stage: needs patch -> 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



[issue17675] show addresses in socket.__repr__

2013-04-09 Thread Charles-François Natali

Charles-François Natali added the comment:

+1 from me.
Any info that can help debugging is a good thing (calling getsockname() on an 
non-connected socket will raise an error that will get cacthed, but there's not 
much we can do about it).

--
nosy: +neologix

___
Python tracker 

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



[issue17675] show addresses in socket.__repr__

2013-04-09 Thread STINNER Victor

STINNER Victor added the comment:

+1 for the idea, +1 for the need of tests.

About the patch: you may use a try/except for getsockname(), and another for 
getpeername().

--
nosy: +haypo

___
Python tracker 

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



[issue17615] String comparison performance regression

2013-04-09 Thread Roundup Robot

Roundup Robot added the comment:

New changeset b3168643677b by Victor Stinner in branch 'default':
Issue #17615: On Windows (VS2010), Performances of wmemcmp() to compare Unicode
http://hg.python.org/cpython/rev/b3168643677b

--

___
Python tracker 

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



[issue17615] String comparison performance regression

2013-04-09 Thread STINNER Victor

STINNER Victor added the comment:

"Including the wmemcmp patch did not improve the times on MSC v.1600 32 bit - 
if anything, the performance was a little slower for the test I used:"

I tested my patch on Windows before the commit and I saw similar performances 
with and without wmemcmp().

I checked again and you are true: performances are *a little bit* worse using 
wmemcmp().

"Looking at the assembler, there is a real call to wmemcmp which adds some time 
and wmemcmp does not seem to be optimized compared to a simple loop."

You should be true. I reverted the patch for 16-bit wchar_t to use a dummy loop 
instead. 16-bit wchar_t can only be found on Windows, isn't it?

--

___
Python tracker 

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



[issue6696] Profile objects should be documented

2013-04-09 Thread Tom Pinckney

Tom Pinckney added the comment:

Another update based on comments. Removed links to cProfile.py and _lsof.c.

--
Added file: http://bugs.python.org/file29756/patch4.diff

___
Python tracker 

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



[issue2771] Test issue

2013-04-09 Thread Test User Deily

Test User Deily added the comment:

testing

--
nosy: +testusernad -ezio.melotti, mark.dickinson

___
Python tracker 

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



[issue17628] str==str: compare the first and last character before calling memcmp()

2013-04-09 Thread STINNER Victor

STINNER Victor added the comment:

Because most people agree that checking first and/or last byte/character is not 
a good idea (may be slower), here is a new patch removing code checking 
first/last byte or character in bytes_richcompare() and unicode_eq().

It removes the usage of the "register" keyword, I read that modern compilers 
generate worse code when this keyword is used. Register allocators of modern 
compilers known better than you which variables should use a register.

--
Added file: http://bugs.python.org/file29757/dont_compare_first_last.patch

___
Python tracker 

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



[issue16850] Add "e" mode to open(): close-and-exec (O_CLOEXEC) / O_NOINHERIT

2013-04-09 Thread STINNER Victor

STINNER Victor added the comment:

The PEP 433 and its issue #17036 replaces this issue, they are more generic.

--
resolution:  -> fixed
status: open -> closed
superseder:  -> Implementation of the PEP 433: Easier suppression of file 
descriptor inheritance

___
Python tracker 

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



[issue16286] Use hash if available to optimize a==b and a!=b for bytes and str

2013-04-09 Thread STINNER Victor

STINNER Victor added the comment:

"I will benchmark the overhead of memcmp() on short strings. We may
check the first and last characters before calling memcmp() to limit
the overhead of calling a function."

I created the issue #17628 for this point.

--

___
Python tracker 

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



[issue16153] PyUnicode_FromFormatV() must fail if the format string is invalid

2013-04-09 Thread STINNER Victor

STINNER Victor added the comment:

Barry wrote on python-dev mailing list:
"If it's documented to behave that way, why would you still consider it a bug?
The current behavior is clearly intentional, the function is working as
intended, and there may be code out there that depends on this documented
functionality, or at least, it won't be prepared to handle the new exception."
http://mail.python.org/pipermail/python-dev/2012-October/122122.html

So I'm closing the issue.

--
resolution:  -> wont fix
status: open -> closed

___
Python tracker 

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



[issue17615] String comparison performance regression

2013-04-09 Thread Martin v . Löwis

Martin v. Löwis added the comment:

I'd like to propose a code size reduction. If kind1 < kind2, swap(kind1, kind2) 
and swap(data1, data2). Set a variable swapped to 1 (not swapped) or -1 
(swapped); then return either swapped or -swapped when a difference is found.

With that, the actual comparison could be sure that kind2 <= kind1, so if kind1 
is UCS1, the inner switch can go away. If kind1 is UCS2, kind1 could only be 
UCS1 or UCS2.

--
nosy: +loewis

___
Python tracker 

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



[issue17615] String comparison performance regression

2013-04-09 Thread STINNER Victor

STINNER Victor added the comment:

"I'd like to propose a code size reduction. If kind1 < kind2, swap(kind1, 
kind2) and swap(data1, data2)."

Yeah, I hesitated to implement this, but I forgot it later. Would you like to 
work on such change?

--

___
Python tracker 

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



[issue17628] str==str: compare the first and last character before calling memcmp()

2013-04-09 Thread Antoine Pitrou

Antoine Pitrou added the comment:

> Because most people agree that checking first and/or last
> byte/character is not a good idea (may be slower), here is a new patch
> removing code checking first/last byte or character in
> bytes_richcompare() and unicode_eq().

You misunderstood. Checking the first byte is ok, it's checking the last
byte which can misfire.

> It removes the usage of the "register" keyword, I read that modern
> compilers generate worse code when this keyword is used. Register
> allocators of modern compilers known better than you which variables
> should use a register.

I think you should open a separate issue to remove all instances of the
"register" keyword in the code base. It has become useless, any modern
compiler will allocate registers by itself, happily ignoring any
"register" hint.

--

___
Python tracker 

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



[issue17677] Invitation to connect on LinkedIn

2013-04-09 Thread Ned Deily

Changes by Ned Deily :


--
Removed message: http://bugs.python.org/msg186404

___
Python tracker 

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



[issue14439] Easier error diagnosis when bootstrapping the runpy module in main

2013-04-09 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 39b9b05c3085 by Victor Stinner in branch 'default':
Close #14439: Python now prints the traceback on runpy failure at startup.
http://hg.python.org/cpython/rev/39b9b05c3085

--
nosy: +python-dev
resolution:  -> fixed
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



[issue14439] Easier error diagnosis when bootstrapping the runpy module in main

2013-04-09 Thread STINNER Victor

STINNER Victor added the comment:

Testing the patch manually is simple: add anything wrong in runpy.py and run 
"python -m base64".

Output:
---
Could not import runpy module
---

Output with the patch:
---
Could not import runpy module
Traceback (most recent call last):
  File "/home/haypo/prog/python/default/Lib/runpy.py", line 264, in 
x
NameError: name 'x' is not defined
---

--

___
Python tracker 

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



[issue17677] spam

2013-04-09 Thread Ned Deily

Changes by Ned Deily :


--
nosy:  -dangyogi
title: Invitation to connect on LinkedIn -> spam

___
Python tracker 

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



[issue17679] sysconfig generation uses some env variables multiple times

2013-04-09 Thread Ned Deily

Ned Deily added the comment:

There definitely are configurations where some values do get duplicated in 
CFLAGS and LDFLAGS.  In my experience this is generally harmless for builds 
but, as you point out, it can break tests that expect particular values.  It 
would be nice to clean this up.

--
nosy: +ned.deily
stage:  -> needs patch
versions: +Python 3.3 -Python 3.1

___
Python tracker 

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



[issue17679] sysconfig generation uses some env variables multiple times

2013-04-09 Thread Ned Deily

Changes by Ned Deily :


--
versions: +Python 2.7, Python 3.4

___
Python tracker 

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



[issue15518] Provide test coverage for filecmp.dircmp.report methods.

2013-04-09 Thread Chris Calloway

Changes by Chris Calloway :


Removed file: http://bugs.python.org/file29749/issue-15518-1.patch

___
Python tracker 

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



[issue15518] Provide test coverage for filecmp.dircmp.report methods.

2013-04-09 Thread Chris Calloway

Chris Calloway added the comment:

I replaced issue-15518-1.patch. I believe it now addresses all the concerns 
expressed thus far. If reviewed favorably, I will extend it to clean-up the 
pre-existing tests to address the concerns noted about them, especially since 
the filecmpdata directory added by this patch contains the information 
necessary to test the rest of the filecmp module rather than resorting to 
creating temp directories and files. It seems less than ideal to me to have the 
test script use a mixed model for accessing test data (both temp and 
filecmpdata directories). But that's not my call.

--
Added file: http://bugs.python.org/file29758/issue-15518-1.patch

___
Python tracker 

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



[issue17670] expandtabs() weirdness

2013-04-09 Thread Ned Deily

Ned Deily added the comment:

That's a good point.  Here's a patch for the documentation with a simplified 
example:

  >>> '01\t456\t89'.expandtabs(4)
  '01  456 89'

What do others think: is an example useful and, if so, this example?

--
assignee:  -> docs@python
components: +Documentation -Library (Lib)
keywords: +patch
nosy: +docs@python
resolution: works for me -> 
stage: committed/rejected -> patch review
status: closed -> open
type: behavior -> 
versions: +Python 3.4
Added file: http://bugs.python.org/file29759/issue17670_doc.patch

___
Python tracker 

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



  1   2   >