[issue24965] Implement PEP 498: Literal String Formatting

2015-09-10 Thread Eric V. Smith

Eric V. Smith added the comment:

I discussed it with Guido and added 'F' to the PEP.

--

___
Python tracker 

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



[issue25049] Strange behavior under doctest: staticmethods have different __globals__

2015-09-10 Thread Jurjen N.E. Bos

New submission from Jurjen N.E. Bos:

I found a pretty obscure bug/documentation issue.
It only happens if you use global variables in static methods under doctest.
The thing is that this code fails under doctest, while anyone would expect it 
to work at first sight:

class foo:
@staticmethod
def bar():
"""
>>> GLOBAL = 5; foo.bar()
5
"""
print(GLOBAL)

The cause of the problem is that the static method has a __globals__ that for 
reasons beyond my understanding is not equal to the globals when run under 
doctest.
This might be a doctest bug, or there might be a reason for it that I don't 
get: than it must be documented, before it stupifies others.
The behaviour is the same under python 2 and 3.
The attached file shows all (written for Python 3, but can be trivially adapted 
for python 2), including the workaround.

--
components: Library (Lib)
files: t.py
messages: 250355
nosy: jneb
priority: normal
severity: normal
status: open
title: Strange behavior under doctest: staticmethods have different __globals__
type: enhancement
Added file: http://bugs.python.org/file40422/t.py

___
Python tracker 

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



[issue25050] windows installer does not allow 32 and 64 installs side by side

2015-09-10 Thread Adam Groszer

New submission from Adam Groszer:

Installed with python-3.4.3.msi first, then wanted a 64bit side-by-side )of 
course in an other folder)

Wanted to install python-3.4.3.amd64.msi, the first thing this one did is 
removed the 32bit install :-(

--
components: Installation, Windows
messages: 250356
nosy: Adam.Groszer, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: windows installer does not allow 32 and 64 installs side by side
type: behavior
versions: Python 3.4

___
Python tracker 

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



[issue25051] 'compile' refuses BOM.

2015-09-10 Thread Piotr

New submission from Piotr:

Similar to Issue 679880

>>> compile(open("bom3.py").read(), "bom3.py", 'exec')
Traceback (most recent call last):
  File "", line 1, in 
  File "bom3.py", line 1
# coding: utf-8
  ^
SyntaxError: invalid character in identifier

--
components: Unicode
files: bom3.py
messages: 250357
nosy: Karulis, ezio.melotti, haypo
priority: normal
severity: normal
status: open
title: 'compile' refuses BOM.
type: compile error
versions: Python 3.4
Added file: http://bugs.python.org/file40423/bom3.py

___
Python tracker 

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



[issue25051] 'compile' refuses BOM.

2015-09-10 Thread Serhiy Storchaka

Changes by Serhiy Storchaka https://t.co/JxJCL5FSwT>:


--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue25051] 'compile' refuses BOM.

2015-09-10 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

open() uses locale encoding by default. You should specify correct encoding 
explicitly for portability and unambiguity.

>>> compile(open("bom3.py", encoding="utf-8-sig").read(), "bom3.py", 'exec')
 at 0xb707a7a0, file "bom3.py", line 2>

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue25051] 'compile' refuses BOM.

2015-09-10 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

open() uses locale encoding by default. You should specify correct encoding 
explicitly for portability and unambiguity.

>>> compile(open("bom3.py", encoding="utf-8-sig").read(), "bom3.py", 'exec')
 at 0xb707a7a0, file "bom3.py", line 2>

--
nosy: +serhiy.storchaka
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

___
Python tracker 

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



[issue25052] Test

2015-09-10 Thread Serhiy Storchaka

New submission from Serhiy Storchaka:

Just for testing if I can create a *new* issue.

--
messages: 250360
nosy: serhiy.storchaka
priority: normal
severity: normal
status: open
title: Test

___
Python tracker 

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



[issue25021] product_setstate() Out-of-bounds Read

2015-09-10 Thread Raymond Hettinger

Changes by Raymond Hettinger :


--
assignee: rhettinger -> kristjan.jonsson

___
Python tracker 

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



[issue25051] 'compile' refuses BOM.

2015-09-10 Thread STINNER Victor

STINNER Victor added the comment:

Lib/test/test_tokenize.py contains a test for a Python script encoded to UTF-8 
and starting with the UTF-8 BOM, 
Lib/test/tokenize_tests-utf8-coding-cookie-and-utf8-bom-sig.txt.

--

___
Python tracker 

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



[issue25053] Possible race condition in Pool

2015-09-10 Thread Stanislaw Izaak Pitucha

New submission from Stanislaw Izaak Pitucha:

This is something that happened once and I cannot reproduce anymore. In an 
IPython session I've done the following (see session below), which resulted in 
pool.map raising its internal exceptions in cases where it shouldn't. Then it 
worked again. (see in/out 29)

Running exactly the same lines again did not result in the same behaviour. I 
tried multiple times in the same session as well as new sessions. Looks like a 
weird race / corruption.

I'm on Ubuntu's '3.4.3 (default, Mar 26 2015, 22:03:40) \n[GCC 4.9.2]'. Running 
with 2 virtualised cores (vmware). 64-bit system.

In [21]: import multiprocessing
In [22]: p=multiprocessing.Pool()
... (unrelated, checked p.map? and other helps)
In [26]: class A(object):
def a(self, i):
print("boo", i, multiprocessing.current_process())
   : 
In [27]: obj = A()
In [28]: p.map(obj.a, [1,2,3,4])
Process ForkPoolWorker-1:
Process ForkPoolWorker-2:
Traceback (most recent call last):
Traceback (most recent call last):
  File "/usr/lib/python3.4/multiprocessing/process.py", line 254, in _bootstrap
self.run()
  File "/usr/lib/python3.4/multiprocessing/process.py", line 254, in _bootstrap
self.run()
  File "/usr/lib/python3.4/multiprocessing/process.py", line 93, in run
self._target(*self._args, **self._kwargs)
  File "/usr/lib/python3.4/multiprocessing/process.py", line 93, in run
self._target(*self._args, **self._kwargs)
  File "/usr/lib/python3.4/multiprocessing/pool.py", line 108, in worker
task = get()
  File "/usr/lib/python3.4/multiprocessing/pool.py", line 108, in worker
task = get()
  File "/usr/lib/python3.4/multiprocessing/queues.py", line 357, in get
return ForkingPickler.loads(res)
AttributeError: Can't get attribute 'A' on 
  File "/usr/lib/python3.4/multiprocessing/queues.py", line 357, in get
return ForkingPickler.loads(res)
AttributeError: Can't get attribute 'A' on 
boo 3 
boo 4 

^CProcess ForkPoolWorker-4:
Process ForkPoolWorker-3:
Traceback (most recent call last):
Traceback (most recent call last):
  File "/usr/lib/python3.4/multiprocessing/process.py", line 254, in _bootstrap
self.run()
  File "/usr/lib/python3.4/multiprocessing/process.py", line 93, in run
self._target(*self._args, **self._kwargs)
  File "/usr/lib/python3.4/multiprocessing/process.py", line 254, in _bootstrap
self.run()
  File "/usr/lib/python3.4/multiprocessing/process.py", line 93, in run
self._target(*self._args, **self._kwargs)
  File "/usr/lib/python3.4/multiprocessing/pool.py", line 108, in worker
task = get()
  File "/usr/lib/python3.4/multiprocessing/pool.py", line 108, in worker
task = get()
  File "/usr/lib/python3.4/multiprocessing/queues.py", line 354, in get
with self._rlock:
  File "/usr/lib/python3.4/multiprocessing/queues.py", line 355, in get
res = self._reader.recv_bytes()
  File "/usr/lib/python3.4/multiprocessing/synchronize.py", line 96, in 
__enter__
return self._semlock.__enter__()
KeyboardInterrupt
  File "/usr/lib/python3.4/multiprocessing/connection.py", line 216, in 
recv_bytes
buf = self._recv_bytes(maxlength)
  File "/usr/lib/python3.4/multiprocessing/connection.py", line 416, in 
_recv_bytes
buf = self._recv(4)
  File "/usr/lib/python3.4/multiprocessing/connection.py", line 383, in _recv
chunk = read(handle, remaining)
KeyboardInterrupt
---
KeyboardInterrupt Traceback (most recent call last)
 in ()
> 1 p.map(obj.a, [1,2,3,4])

/usr/lib/python3.4/multiprocessing/pool.py in map(self, func, iterable, 
chunksize)
258 in a list that is returned.
259 '''
--> 260 return self._map_async(func, iterable, mapstar, chunksize).get()
261 
262 def starmap(self, func, iterable, chunksize=None):

/usr/lib/python3.4/multiprocessing/pool.py in get(self, timeout)
591 
592 def get(self, timeout=None):
--> 593 self.wait(timeout)
594 if not self.ready():
595 raise TimeoutError

/usr/lib/python3.4/multiprocessing/pool.py in wait(self, timeout)
588 
589 def wait(self, timeout=None):
--> 590 self._event.wait(timeout)
591 
592 def get(self, timeout=None):

/usr/lib/python3.4/threading.py in wait(self, timeout)
551 signaled = self._flag
552 if not signaled:
--> 553 signaled = self._cond.wait(timeout)
554 return signaled
555 finally:

/usr/lib/python3.4/threading.py in wait(self, timeout)
288 try:# restore state no matter what (e.g., KeyboardInterrupt)
289 if timeout is None:
--> 290 waiter.acquire()
291 gotit = True
292 else:

KeyboardInterrupt: 

In [29]: p.map(obj.a, [1,2,3,4])
boo 1 
boo 2 
boo 3 
boo 4 
Out[29]: [None, None, None, None]

--
components:

[issue25051] 'compile' refuses BOM.

2015-09-10 Thread Piotr

Piotr added the comment:

Ok I have tried it(I had to remove ЉЊЈЁЂ from *.txt - my cp is 1250):

c:\tmp>type test.py
compile(open("tokenize_tests-utf8-coding-cookie-and-utf8-bom-sig.txt").read(), 
"bom3.py", 'exec')

c:\tmp>c:\Python34\python.exe test.py
Traceback (most recent call last):
  File "test.py", line 1, in 

compile(open("tokenize_tests-utf8-coding-cookie-and-utf8-bom-sig.txt").read(), 
"bom3.py", 'exec')
  File "bom3.py", line 1
# -*- coding: utf-8 -*-
  ^
SyntaxError: invalid character in identifier


Is it something in my setup?

--

___
Python tracker 

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



[issue15012] test issue

2015-09-10 Thread R. David Murray

R. David Murray added the comment:

Test issue update.

--
nosy: +r.david.murray

___
Python tracker 

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



[issue25054] Capturing start of line '^'

2015-09-10 Thread Alcolo Alcolo

New submission from Alcolo Alcolo:

Why
re.findall('^|a', 'a') != ['', 'a'] ?

We have:
re.findall('^|a', ' a') == ['', 'a']
and
re.findall('$|a', ' a') == ['a', '']

Capturing '^' take the 1st character. It's look like a bug ...

--
components: Regular Expressions
messages: 250364
nosy: Alcolo Alcolo, ezio.melotti, mrabarnett
priority: normal
severity: normal
status: open
title: Capturing start of line '^'
type: behavior
versions: Python 3.4

___
Python tracker 

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



[issue25054] Capturing start of line '^'

2015-09-10 Thread R. David Murray

R. David Murray added the comment:

^ finds an empty match at the beginning of the string, $ finds an empty match 
at the end.  I don't see the bug (but I'm not a regex expert).

--
nosy: +r.david.murray

___
Python tracker 

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



[issue25021] product_setstate() Out-of-bounds Read

2015-09-10 Thread Kristján Valur Jónsson

Kristján Valur Jónsson added the comment:

Thanks, I'll get this committed and merged asap.

--

___
Python tracker 

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



[issue25043] document socket constants for Bluetooth

2015-09-10 Thread Tim Tisdall

Tim Tisdall added the comment:

I'm not sure how to unit test a constant...  it's just a string.  If you're 
asking for a unit test for when you'd actually make use of the constant, I 
haven't been able to figure out that situation yet.  It seems like in Bluez 
4.101 it's used to issue a command to all interfaces (but in contexts I don't 
quite understand), but in Bluez 5.XX there's no example or documentation of its 
use (it remains as a constant, though).  [looking through the Bluez git, I 
found where the constant was added in 2004 and the log message is simply "Add 
BDADDR_ALL constant"; 
http://git.kernel.org/cgit/bluetooth/bluez.git/commit/?id=c7b26f3e5d03e1d54dfb945e5ca0c041da524348
 ]

--

___
Python tracker 

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



[issue25043] document socket constants for Bluetooth

2015-09-10 Thread Tim Tisdall

Changes by Tim Tisdall :


--
keywords: +patch
Added file: http://bugs.python.org/file40424/bdaddr_36_1.patch

___
Python tracker 

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



[issue25043] document socket constants for Bluetooth

2015-09-10 Thread Tim Tisdall

Changes by Tim Tisdall :


Added file: http://bugs.python.org/file40425/bdaddr_34_1.patch

___
Python tracker 

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



[issue25043] document socket constants for Bluetooth

2015-09-10 Thread Tim Tisdall

Changes by Tim Tisdall :


Added file: http://bugs.python.org/file40426/bdaddr_35_1.patch

___
Python tracker 

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



[issue24984] document AF_BLUETOOTH socket address formats

2015-09-10 Thread Tim Tisdall

Tim Tisdall added the comment:

oops.  yeah, I got my terminology wrong.  It accepts only a byte-string.

--

___
Python tracker 

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



[issue25044] bring BTPROTO_SCO inline with other Bluetooth protocols

2015-09-10 Thread Tim Tisdall

Tim Tisdall added the comment:

Yes, then any existing implementations will continue to work.

One sticky issue with all of this... there's no existing tests as per #7687 .

--

___
Python tracker 

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



[issue7687] Bluetooth support untested

2015-09-10 Thread Tim Tisdall

Changes by Tim Tisdall :


--
versions: +Python 3.6

___
Python tracker 

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



[issue25054] Capturing start of line '^'

2015-09-10 Thread Matthew Barnett

Matthew Barnett added the comment:

After matching '^', it advances so that it won't find the same match again (and 
again and again...).

Unfortunately, that means that it sometimes misses some matches.

It's a known issue.

--

___
Python tracker 

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



[issue24272] PEP 484 docs

2015-09-10 Thread Berker Peksag

Changes by Berker Peksag :


--
resolution:  -> fixed
stage: patch review -> resolved

___
Python tracker 

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



[issue25051] 'compile' refuses BOM.

2015-09-10 Thread eryksun

eryksun added the comment:

You're passing an already decoded string, so the BOM is treated as text. 
Instead open the file in binary mode, i.e. open("bom3.py", "rb"). This way the 
BOM will be detected when decoding the source bytes. Here's an example that 
passes the source as a bytes object:

>>> source = b'\xef\xbb\xbf#coding: utf-8\nprint("spam")'
>>> code = compile(source, '', 'exec')
>>> exec(code)
spam

Or you could also decode the file contents without the BOM via open("bom3.py", 
encoding="utf-8-sig").

--
nosy: +eryksun
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

___
Python tracker 

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



[issue23270] Use the new __builtin_mul_overflow() of Clang and GCC 5 to check for integer overflow

2015-09-10 Thread STINNER Victor

STINNER Victor added the comment:

Implementation for any compiler using the new builtin if available:
http://thread.gmane.org/gmane.linux.kernel/204

--

___
Python tracker 

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



[issue23270] Use the new __builtin_mul_overflow() of Clang and GCC 5 to check for integer overflow

2015-09-10 Thread STINNER Victor

STINNER Victor added the comment:

Implementation for any compiler using the new builtin if available:
http://thread.gmane.org/gmane.linux.kernel/204

--

___
Python tracker 

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



[issue25055] Test

2015-09-10 Thread Serhiy Storchaka

New submission from Serhiy Storchaka:

Just test if the tracker works for me now.

--
messages: 250375
nosy: serhiy.storchaka
priority: normal
severity: normal
status: open
title: Test

___
Python tracker 

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



[issue25056] no support for Bluetooth LE in socket

2015-09-10 Thread Tim Tisdall

New submission from Tim Tisdall:

When Bluetooth LE support was added to Bluez they expanded sockaddr_l2 (the 
struct for making L2CAP connections) to include a l2_bdaddr_type.  Since the 
existing code initializes the struct with 0's the type is set to regular 
Bluetooth (BDADDR_BREDR).  An additional optional argument is needed to allow 
it to also be set to BDADDR_LE_PUBLIC or BDADDR_LE_RANDOM which indicate it's a 
LE connection to be made.

--
components: Library (Lib)
messages: 250376
nosy: Tim.Tisdall
priority: normal
severity: normal
status: open
title: no support for Bluetooth LE in socket
type: enhancement
versions: Python 3.6

___
Python tracker 

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



[issue25041] document AF_PACKET socket address format

2015-09-10 Thread Adam

Changes by Adam :


--
nosy: +azsorkin

___
Python tracker 

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



[issue25054] Capturing start of line '^'

2015-09-10 Thread Alcolo Alcolo

Alcolo Alcolo added the comment:

Naively, I thinked that ^ is be considered as a 0-length token (like $, \b, 
\B), then after capturing it, we can read the next token : 'a' (for the input 
string "a").

I use a simple work around: prepending my string with ' ' (because ' ' is 
neutral with my regex results).

--

___
Python tracker 

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



[issue15012] test issue

2015-09-10 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Test.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue15012] test issue

2015-09-10 Thread Serhiy Storchaka

Changes by Serhiy Storchaka https://t.co/JxJCL5FSwT>:


--
type:  -> behavior

___
Python tracker 

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



[issue15012] test issue

2015-09-10 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Test again.

--
nosy: +serhiy.storchaka
status: open -> closed

___
Python tracker 

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



[issue15012] test issue

2015-09-10 Thread Serhiy Storchaka

Changes by Serhiy Storchaka https://t.co/JxJCL5FSwT>:


--
status: closed -> open

___
Python tracker 

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



[issue15012] test issue

2015-09-10 Thread STINNER Victor

STINNER Victor added the comment:

victor test

--
nosy: +haypo

___
Python tracker 

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



[issue15012] test issue

2015-09-10 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Test.

--
nosy: +serhiy.storchaka
status: open -> closed

___
Python tracker 

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



[issue25057] Make parameter of io.base to be positional and keyword

2015-09-10 Thread shiyao.ma

New submission from shiyao.ma:

The parameters for io.[Text]IOBase.seek are currently positional only, as 
discussed in http://bugs.python.org/issue25030.

We make the parameters to be both positional and keyword based.

--
files: patch.diff
keywords: patch
messages: 250382
nosy: berker.peksag, ezio.melotti, introom
priority: normal
severity: normal
status: open
title: Make parameter of io.base to be positional and keyword
type: enhancement
versions: Python 3.6
Added file: http://bugs.python.org/file40427/patch.diff

___
Python tracker 

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



[issue25050] windows installer does not allow 32 and 64 installs side by side

2015-09-10 Thread Steve Dower

Steve Dower added the comment:

This is an issue with 3.4.3 only, and I suspect it was something funny in the 
build config that should just work with 3.4.4 - adding Martin to make sure.

Basically, the upgrade code in the 32-bit installer was (I think) the code used 
for dev snapshots. Both installers are supposed to remove dev snapshots, so the 
64-bit installer will remove it.

If you install the 64-bit version first then you can have both.

--
nosy: +loewis

___
Python tracker 

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



[issue21657] pip.get_installed_distributions() Does not return packages in the current working directory

2015-09-10 Thread David Fraser

David Fraser added the comment:

Filed with pypa at https://github.com/pypa/pip/issues/3091

--
nosy: +davidfraser

___
Python tracker 

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



[issue25024] Allow passing "delete=False" to TemporaryDirectory

2015-09-10 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

I'm inclined to reject this idea too.

--
nosy: +georg.brandl, ncoghlan, pitrou, serhiy.storchaka

___
Python tracker 

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



[issue24900] Raising an exception that cannot be unpickled causes hang in ProcessPoolExecutor

2015-09-10 Thread Benedikt Reinartz

Benedikt Reinartz added the comment:

That would touch 2, but as this is happening in the exception handling already 
that would need to be catched and handled by itself. However, one could then do 
without a "pickle -> unpickle" dance.

--

___
Python tracker 

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



[issue25024] Allow passing "delete=False" to TemporaryDirectory

2015-09-10 Thread Antoine Pitrou

Antoine Pitrou added the comment:

The idea looks ok to me, but you'd have to provide a patch.

--

___
Python tracker 

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



[issue25058] Right square bracket argparse metavar

2015-09-10 Thread Juan Jimenez-Anca

New submission from Juan Jimenez-Anca:

When trying to assign the metavar in add_argument() method of argparse module 
I'm unable to include characters after a right square bracket.

Trying to set something like this:

metavar="[host:database:collection:]field"

would raise an AssertionError, which includes:

File "/usr/lib64/python3.4/argparse.py", line 329, in _format_usage
assert ' '.join(opt_parts) == opt_usage

However, the following is accepted:

metavar="[host:database:collection:]field"

--
components: Library (Lib)
messages: 250388
nosy: cortopy
priority: normal
severity: normal
status: open
title: Right square bracket argparse metavar
type: behavior
versions: Python 3.4

___
Python tracker 

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



[issue25058] Right square bracket argparse metavar

2015-09-10 Thread Juan Jimenez-Anca

Juan Jimenez-Anca added the comment:

My apologies for the formatting of the last line. This is my issue corrected:

When trying to assign the metavar in add_argument() method of argparse module 
I'm unable to include characters after a right square bracket.

Trying to set something like this:

metavar="[host:database:collection:]field"

would raise an AssertionError, which includes:

File "/usr/lib64/python3.4/argparse.py", line 329, in _format_usage
assert ' '.join(opt_parts) == opt_usage

However, the following is accepted:

metavar="[host:database:collection:] field"

--

___
Python tracker 

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



[issue25059] Mistake in input-output tutorial regarding print() seperator

2015-09-10 Thread Saimadhav Heblikar

New submission from Saimadhav Heblikar:

Feel free to make changes to the patch if you want to improve the sentence 
structure.

--
assignee: docs@python
components: Documentation
messages: 250390
nosy: docs@python, sahutd
priority: normal
severity: normal
status: open
title: Mistake in input-output tutorial regarding print() seperator
versions: Python 3.5, Python 3.6

___
Python tracker 

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



[issue25059] Mistake in input-output tutorial regarding print() seperator

2015-09-10 Thread Saimadhav Heblikar

Changes by Saimadhav Heblikar :


Added file: http://bugs.python.org/file40428/issue25059

___
Python tracker 

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



[issue25060] BUILD_MAP stack effect suboptimal

2015-09-10 Thread Antoine Pitrou

New submission from Antoine Pitrou:

In PyCompile_OpcodeStackEffect() compile.c:

case BUILD_MAP:
return 1;

But starting from 3.5, BUILD_MAP pops 2*oparg objects from the stack.

--
components: Interpreter Core
messages: 250391
nosy: benjamin.peterson, georg.brandl, pitrou
priority: normal
severity: normal
status: open
title: BUILD_MAP stack effect suboptimal
type: resource usage
versions: Python 3.5, Python 3.6

___
Python tracker 

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



[issue25054] Capturing start of line '^'

2015-09-10 Thread Matthew Barnett

Matthew Barnett added the comment:

Just to confirm, it _is_ a bug.

It tries to avoid getting stuck, but the way it does that causes it to skip a 
character, sometimes missing a match it should have found.

--

___
Python tracker 

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



[issue25053] Possible race condition in Pool

2015-09-10 Thread Davin Potts

Davin Potts added the comment:

I have been able to reproduce the behavior you described under 3.5 under one 
set of circumstances so far.

When attempting to use classes/functions/other not defined in an importable 
module, an AttributeError is expected as you observed.  The viability of that 
existing Pool to perform further useful work has been compromised and no 
promises are made regarding its continued behavior.

In general, the recommendations in 
https://docs.python.org/3.4/library/multiprocessing.html#multiprocessing-programming
 hold to avoid these situations.

Understanding the exact set of circumstances to provoke situations where viable 
work can continue with a locally-defined (not in an importable module) 
function/class is perhaps worth further investigation.

That said, multiple places in the multiprocessing docs (including the 
introductory paragraphs) provide the guidance to always use functions/classes 
whose definitions are importable.  Hence, I'm inclined to mark this mentally as 
"interesting" but on the bug tracker as "not a bug".  Any objections?

--
nosy: +davin

___
Python tracker 

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



[issue25059] Mistake in input-output tutorial regarding print() seperator

2015-09-10 Thread R. David Murray

R. David Murray added the comment:

Well, it's a tutorial.  I'm not sure it makes sense to introduce sep at that 
point, that's more appropriate for when the user is more advanced and looking 
at the reference documentation.  (Frankly, I've *never* used that feature, and 
I've been using python for longer than it has had that feature :)  

I could see changing 'always' to 'by default' and leaving it at that, though.

--
nosy: +r.david.murray

___
Python tracker 

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



[issue25059] Mistake in input-output tutorial regarding print() seperator

2015-09-10 Thread Eric V. Smith

Eric V. Smith added the comment:

+1 on the "by default" change.

--
nosy: +eric.smith

___
Python tracker 

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



[issue24272] PEP 484 docs

2015-09-10 Thread Berker Peksag

Berker Peksag added the comment:

By the way, for some reason the changes in revision e361130782d4 are not in 
Doc/library/typing.rst.

For example,

io documentation on current default branch: 
https://hg.python.org/cpython/file/default/Doc/library/typing.rst#l376
io documentation on current 3.5 branch: 
https://hg.python.org/cpython/file/3.5/Doc/library/typing.rst#l376
Updates to the io documntation in revision e361130782d4: 
https://hg.python.org/cpython/rev/e361130782d4#l1.67

Also, my clone is up-to-date:

changeset:   97855:d433d74e0377
tag: tip
user:Victor Stinner 
date:Thu Sep 10 16:00:06 2015 +0200
files:   Python/pytime.c
description:
pytime: oops, fix typos on Windows

--

___
Python tracker 

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



[issue25059] Mistake in input-output tutorial regarding print() seperator

2015-09-10 Thread Saimadhav Heblikar

Saimadhav Heblikar added the comment:

Agreed with both David Murray and Eric.

--

___
Python tracker 

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



[issue24272] PEP 484 docs

2015-09-10 Thread Guido van Rossum

Guido van Rossum added the comment:

I suck at merge. :-( No idea what happened. To fix it, I have now just
copied the file again from the larry branch and committed that in 3.5, then
merged up to 3.6 (default).

changeset:   97856:8a7814a3613b
branch:  3.5
parent:  97847:6c8e2c6e3a99
user:Guido van Rossum 
date:Thu Sep 10 10:52:11 2015 -0700
summary: Restore doc updates to typing.rst by Ivan Levkivskyi and
Daniel Andrade Groppe.

changeset:   97857:7fc4306d537b
tag: tip
parent:  97855:d433d74e0377
parent:  97856:8a7814a3613b
user:Guido van Rossum 
date:Thu Sep 10 10:54:10 2015 -0700
summary: Restore doc updates to typing.rst by Ivan Levkivskyi and
Daniel Andrade Groppe.

--

___
Python tracker 

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



[issue25061] Add native enum support for argparse

2015-09-10 Thread desbma

New submission from desbma:

I often find myself using the following pattern with argparse:

import argparse
import enum

CustomEnumType = enum.Enum("CustomEnumType",
   ("VAL1", "VAL2", "VAL3", ...))

arg_parser = argparse.ArgumentParser(...)
...
arg_parser.add_argument("-p",
"--param",
type="string",
action="store",
choices=tuple(t.name.lower() for t in CustomEnumType),
default=CustomEnumType.VAL1.name.lower(),
dest="param"
...)
args = arg_parser.parse_args()
args.param = CustomEnumType[args.param.upper()]

I think it would be a great addition to be able to pass the enum type to the 
add_argument 'type' parameter directly, and have it validate the input and 
store the resulting enum.

--
messages: 250399
nosy: desbma
priority: normal
severity: normal
status: open
title: Add native enum support for argparse
type: enhancement

___
Python tracker 

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



[issue25061] Add native enum support for argparse

2015-09-10 Thread Barry A. Warsaw

Changes by Barry A. Warsaw :


--
nosy: +barry

___
Python tracker 

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



[issue3548] subprocess.pipe function

2015-09-10 Thread desbma

Changes by desbma :


--
nosy: +desbma

___
Python tracker 

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



[issue25062] Doc linter error: [2] library/typing.rst:358: default role used

2015-09-10 Thread STINNER Victor

New submission from STINNER Victor:

The Docs buildbot is red since the changeset 
7fc4306d537b5feedb7f9dac54d96ed378c093a7.

http://buildbot.python.org/all/builders/Docs%203.x/builds/52

--
assignee: docs@python
components: Documentation
messages: 250400
nosy: docs@python, gvanrossum, haypo
priority: normal
severity: normal
status: open
title: Doc linter error:  [2] library/typing.rst:358: default role used
versions: Python 3.6

___
Python tracker 

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



[issue25061] Add native enum support for argparse

2015-09-10 Thread desbma

Changes by desbma :


--
components: +Library (Lib)

___
Python tracker 

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



[issue25063] shutil.copyfileobj should internally use os.sendfile when possible

2015-09-10 Thread desbma

New submission from desbma:

Sorry if it has already been discussed, or if this is a stupid idea.

By looking at the signature, my thought was that the only use of 
shutil.copyfileobj was to wrap the use of sendfile, and use a fallback if it is 
not available on the system or not usable with "fake" Python files (not having 
a file descriptor, eg. like gzip.GzipFile).

By looking at the implementation, I was surprised that it does not try to call 
os.sendfile.

--
components: Library (Lib)
messages: 250401
nosy: desbma
priority: normal
severity: normal
status: open
title: shutil.copyfileobj should internally use os.sendfile when possible

___
Python tracker 

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



[issue1103213] Adding a recvexactly() to socket.socket: receive exactly n bytes

2015-09-10 Thread STINNER Victor

STINNER Victor added the comment:

Oh, in fact recvall() is a bad name. The io module uses the "readall()" name to 
really read all content of a file, whereas "recvall(N)" here only read up to N 
bytes.

It would be better to reuse the same name than asyncio, "readexactly(N)":
https://docs.python.org/dev/library/asyncio-stream.html#asyncio.StreamReader.readexactly

asyncio and http.client already have their IncompleteRead exceptions. Maybe it 
would be time to add a builtin exception?

--
title: Adding the missing socket.recvall() method -> Adding a recvexactly() to 
socket.socket: receive exactly n bytes

___
Python tracker 

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



[issue25003] os.urandom() should call getrandom(2) not getentropy(2) on Solaris 11.3 and newer

2015-09-10 Thread STINNER Victor

Changes by STINNER Victor :


--
title: os.urandom() should call getrandom(2) not getentropy(2) on Solaris -> 
os.urandom() should call getrandom(2) not getentropy(2) on Solaris 11.3 and 
newer

___
Python tracker 

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



[issue25003] os.urandom() should call getrandom(2) not getentropy(2)

2015-09-10 Thread STINNER Victor

STINNER Victor added the comment:

> Yes, the syscall was failing with EINVAL.

Sorry, I don't understand. Do you mean that calling a non-existant syscall on 
Solaris fails with EINVAL? Calling the getrandom() syscall on Solaris < 11.3 
fails with EINVAL?

--

___
Python tracker 

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



[issue25003] os.urandom() should call getrandom(2) not getentropy(2) on Solaris

2015-09-10 Thread STINNER Victor

Changes by STINNER Victor :


--
title: os.urandom() should call getrandom(2) not getentropy(2) -> os.urandom() 
should call getrandom(2) not getentropy(2) on Solaris

___
Python tracker 

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



[issue25029] MemoryError in test_strptime

2015-09-10 Thread STINNER Victor

STINNER Victor added the comment:

The test doesn't fail anymore on buildbots. I ran manually test_strptime with a 
memory limit of 1 GB on Python 3.5 and 3.6: the test pass.

Can we close the issue?

--

___
Python tracker 

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



[issue23517] datetime.utcfromtimestamp rounds results incorrectly

2015-09-10 Thread STINNER Victor

STINNER Victor added the comment:

Alexander: can you please review attached round_half_even_py34.patch? It's the 
minimum patch to fix datetime/timedelta rounding for Python 3.4 (and 3.5).

--

___
Python tracker 

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



[issue23517] datetime.utcfromtimestamp rounds results incorrectly

2015-09-10 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue25063] shutil.copyfileobj should internally use os.sendfile when possible

2015-09-10 Thread R. David Murray

R. David Murray added the comment:

No, it's to copy file like objects that aren't necessarily true file system 
objects.  The only requirement is that they support a minimal file-like object 
interface.  There is no suggestion or requirement that the object supports file 
descriptors (which would make it a real os file object).

I think changing it to use os.sendfile if possible would be too risky in terms 
of causing unexpected breakage (objects that look like they have a file 
descriptor but really don't), especially since handling file system files is 
explicitly not the purpose of copyfileobj.

--
nosy: +r.david.murray

___
Python tracker 

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



[issue24909] Windows: subprocess.Popen: race condition for leaking inheritable handles

2015-09-10 Thread STINNER Victor

STINNER Victor added the comment:

> The one potential problem that I see is that it looks like specifying 
> PROC_THREAD_ATTRIBUTE_HANDLE_LIST means that no other handles are inherited, 
> even if they are inheritable.

We can maybe add a parameter to configure the behaviour: keep current behaviour 
by default in Python 3.6 and change the default in Python 3.7 for example.

> I could add Windows support for pass_fds, (...)

Yes, we need a new "pass_handles" parameter to pass a list of handles which 
will be explicitly inherited. This parameter is useful even if you inherit all 
inheritable handles, because handles can be non-inhertable too.

It's the same with pass_fds: if you pass a file descriptor in pass_fds, it will 
be marked as inheritable to be passed to the child.

I guess that "pass_handles" will be implemented with 
PROC_THREAD_ATTRIBUTE_HANDLE_LIST, or by making handles temporary inheritable 
if PROC_THREAD_ATTRIBUTE_HANDLE_LIST is not available.

--

___
Python tracker 

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



[issue25062] Doc linter error: [2] library/typing.rst:358: default role used

2015-09-10 Thread Guido van Rossum

Guido van Rossum added the comment:

That link gives me a timeout right now. How can I run the doc linter manually? 
"make html" in the Doc tree didn't alert me to this issue.

--

___
Python tracker 

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



[issue24870] Optimize coding with surrogateescape and surrogatepass error handlers

2015-09-10 Thread STINNER Victor

STINNER Victor added the comment:

I rebased patch because faster-decode-ascii-surrogateescape.patch was generated 
in git format, and the git format is not accepted by Rietveld (the Review 
button).

--
Added file: 
http://bugs.python.org/file40429/faster-decode-ascii-surrogateescape.patch

___
Python tracker 

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



[issue24821] The optimization of string search can cause pessimization

2015-09-10 Thread STINNER Victor

STINNER Victor added the comment:

> I think we should use more robust optimization.

What do you propose? I don't understand the purpose of the issue. Do you want 
to remove the optimization?

--

___
Python tracker 

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



[issue25062] Doc linter error: [2] library/typing.rst:358: default role used

2015-09-10 Thread Guido van Rossum

Guido van Rossum added the comment:

Maybe Zach knows how to fix this since he fixed it for an earlier version? 
(Sorry Zach!)

--
nosy: +zach.ware

___
Python tracker 

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



[issue25062] Doc linter error: [2] library/typing.rst:358: default role used

2015-09-10 Thread Zachary Ware

Zachary Ware added the comment:

Guido van Rossum added the comment:
> That link gives me a timeout right now. How can I run the doc linter 
> manually? "make html" in the Doc tree didn't alert me to this issue.

"make check" is the doc linter.

I've considered whether to back that buildbot off to only warn on
'lint' or 'suspicious' failure, but warnings aren't reported by the
IRC notifier.  Anyone else have an opinion on that?


I'll try to get this fixed soonish, but if anyone can beat me to it, feel free 
:)

--

___
Python tracker 

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



[issue25062] Doc linter error: [2] library/typing.rst:358: default role used

2015-09-10 Thread Zachary Ware

Zachary Ware added the comment:

Oh right, Berker already beat me to it:

changeset 97861:72e696bc480a 3.5

Fix typos and improve markup in typing.rst.
author  Berker Peksag 
dateThu, 10 Sep 2015 21:55:50 +0300 (35 minutes ago)
parents a380841644b2
childrenc52194da1ae2 47e9d7ddb06a
files   Doc/library/typing.rst
diffstat1 files changed, 18 insertions(+), 19 deletions(-)

--

___
Python tracker 

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



[issue25062] Doc linter error: [2] library/typing.rst:358: default role used

2015-09-10 Thread Zachary Ware

Changes by Zachary Ware :


--
resolution:  -> fixed
stage:  -> resolved
status: open -> closed
versions: +Python 3.5

___
Python tracker 

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



[issue25053] Possible race condition in Pool

2015-09-10 Thread Davin Potts

Changes by Davin Potts :


--
status: open -> pending
versions: +Python 3.5

___
Python tracker 

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



[issue25062] Doc linter error: [2] library/typing.rst:358: default role used

2015-09-10 Thread Guido van Rossum

Guido van Rossum added the comment:

Thanks everyone! This episode shows I should not try to commit CPython stuff. 
Period.

--

___
Python tracker 

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



[issue25003] os.urandom() should call getrandom(2) not getentropy(2) on Solaris 11.3 and newer

2015-09-10 Thread John Beck

John Beck added the comment:

Sorry, let me try to clarify.  ENOSYS is the correct errno value to check for, 
for the situation (e.g., Solaris < 11.3) of a non-existent system call. But 
EINVAL should also be checked for to make sure the system call was invoked with 
proper parameters.  My builds of Python 3.5.0.X (don't recall whether X was a 
late Beta or release candidate) were core dumping because Python was making 
that syscall but not checking for EINVAL, and thus assuming the call was valid, 
when it was not.  Sorry, I did not try to debug why it was invalid.  But once I 
added EINVAL, alongside ENOSYS, as a reason to set getrandom_works to 0, then 
python started behaving properly.

--

___
Python tracker 

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



[issue25029] MemoryError in test_strptime

2015-09-10 Thread Steve Dower

Steve Dower added the comment:

Done.

--
resolution:  -> fixed
stage:  -> resolved
status: open -> closed

___
Python tracker 

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



[issue25022] Remove PC/example_nt/

2015-09-10 Thread Roundup Robot

Roundup Robot added the comment:

New changeset a30598e59964 by Zachary Ware in branch '2.7':
Issue #25022: Remove PC/example_nt/
https://hg.python.org/cpython/rev/a30598e59964

New changeset de3e1c81ecd7 by Zachary Ware in branch '3.4':
Issue #25022: Remove PC/example_nt/
https://hg.python.org/cpython/rev/de3e1c81ecd7

New changeset 2460fa584323 by Zachary Ware in branch '3.5':
Issue #25022: Merge with 3.4
https://hg.python.org/cpython/rev/2460fa584323

New changeset e1ddec83a311 by Zachary Ware in branch 'default':
Closes #25022: Merge with 3.5
https://hg.python.org/cpython/rev/e1ddec83a311

--
nosy: +python-dev
resolution:  -> fixed
stage:  -> resolved
status: open -> closed

___
Python tracker 

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



[issue25022] Remove PC/example_nt/

2015-09-10 Thread Zachary Ware

Zachary Ware added the comment:

Erk...just discovered there's a section of Doc/extending/windows.rst that 
depends on example_nt that will need to be excised.

--
resolution: fixed -> 
stage: resolved -> needs patch
status: closed -> open

___
Python tracker 

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



[issue24821] The optimization of string search can cause pessimization

2015-09-10 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

I was going to provide another optimization (I had an idea), but it is not so 
easy as looked to me at first glance. This issue exists rather as a reminder to 
me. I should make a second attempt.

--
resolution:  -> remind

___
Python tracker 

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



[issue24965] Implement PEP 498: Literal String Formatting

2015-09-10 Thread Eric V. Smith

Eric V. Smith added the comment:

This version does dynamic allocation for the expression list, and fixes some 
memory leaks and early decrefs.

I think it's complete, but I'll take some more passes through it checking for 
leaks.

--

___
Python tracker 

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



[issue24965] Implement PEP 498: Literal String Formatting

2015-09-10 Thread Eric V. Smith

Changes by Eric V. Smith :


Added file: http://bugs.python.org/file40430/pep-498-4.diff

___
Python tracker 

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



[issue25022] Remove PC/example_nt/

2015-09-10 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 3456af022541 by Zachary Ware in branch '2.7':
Issue #25022: Add NEWS, fix docs to not mention the old example.
https://hg.python.org/cpython/rev/3456af022541

New changeset c535bf72aa60 by Zachary Ware in branch '3.4':
Issue #25022: Add NEWS, fix docs to not mention the old example.
https://hg.python.org/cpython/rev/c535bf72aa60

New changeset 70c97a626c41 by Zachary Ware in branch '3.5':
Issue #25022: Merge with 3.4
https://hg.python.org/cpython/rev/70c97a626c41

New changeset 8c436c36a4a7 by Zachary Ware in branch 'default':
Closes #25022 (again): Merge with 3.5
https://hg.python.org/cpython/rev/8c436c36a4a7

--
resolution:  -> fixed
stage: needs patch -> resolved
status: open -> closed

___
Python tracker 

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



[issue24965] Implement PEP 498: Literal String Formatting

2015-09-10 Thread Eric V. Smith

Eric V. Smith added the comment:

The good news is that the performance is pretty good, and finally I have a case 
where I can beat %-formatting:

$ ./python.bat -mtimeit -s 'a=2' "'%s' % a"
100 loops, best of 3: 0.883 usec per loop

$ ./python.bat -mtimeit -s 'a=2' '"{}".format(a)'
100 loops, best of 3: 1.16 usec per loop

$ ./python.bat -mtimeit -s 'a=2' 'f"{a}"'
100 loops, best of 3: 0.792 usec per loop

This example is mildly contrived, and the performance of f-strings is slightly 
worse than %-formatting once the f-strings contains both expressions and 
literals.

I could speed it up significantly (I think) by adding opcodes for 2 things: 
calling __format__ and joining the strings together. Calling __format__ in an 
opcode could be a win because I could optimize for known types (str, int, 
float). Having a join opcode would be a win because I could use 
_PyUnicodeWriter instead of ''.join.

I'm inclined to check this code in as-is, then optimize it later, if we think 
it's needed and if I get motivated.

For reference, here's the ast and opcodes for f'a={a}':

>>> ast.dump(ast.parse("f'a={a}'"))
"Module(body=[Expr(value=JoinedStr(values=[Str(s='a='), 
FormattedValue(value=Name(id='a', ctx=Load()), conversion=0, 
format_spec=None)]))])"

>>> dis.dis("f'a={a}'")
  1   0 LOAD_CONST   0 ('')
  3 LOAD_ATTR0 (join)
  6 LOAD_CONST   1 ('a=')
  9 LOAD_NAME1 (a)
 12 LOAD_ATTR2 (__format__)
 15 LOAD_CONST   0 ('')
 18 CALL_FUNCTION1 (1 positional, 0 keyword pair)
 21 BUILD_LIST   2
 24 CALL_FUNCTION1 (1 positional, 0 keyword pair)
 27 RETURN_VALUE

--

___
Python tracker 

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



[issue25035] Getter/setter for argparse keys

2015-09-10 Thread Sworddragon

Sworddragon added the comment:

In this case probably all is fine then. But there is a minor thing I noticed 
from one of your previous posts: You said parser.add_argument returns an Action 
object but I noticed that this is not mentioned on "16.4.3. The add_argument() 
method". Is it maybe mentioned somewhere else or probably just missing?

--

___
Python tracker 

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



[issue22980] C extension naming doesn't take bitness into account

2015-09-10 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 1744d65705d0 by Yury Selivanov in branch '3.5':
whatsnew/3.5: Describe changes in issue #22980
https://hg.python.org/cpython/rev/1744d65705d0

New changeset cfbcb3a6a848 by Yury Selivanov in branch 'default':
Merge 3.5 (issue #22980, whatsnew/3.5)
https://hg.python.org/cpython/rev/cfbcb3a6a848

--

___
Python tracker 

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



[issue22980] C extension naming doesn't take bitness into account

2015-09-10 Thread Yury Selivanov

Yury Selivanov added the comment:

Larry, Matthias, Steve, Berker - I've mentioned this issue in the whatsnew 
(applied Larry's patch with some modifications to address comments from Steve 
and Matthias).  Please review.

--

___
Python tracker 

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



[issue25063] shutil.copyfileobj should internally use os.sendfile when possible

2015-09-10 Thread Martin Panter

Martin Panter added the comment:

I agree it is a nice idea, but have the same concern as David. Many pseudo file 
objects wrap real file descriptors. E.g. BufferedReader hides unread data in a 
buffer, GzipFile decompresses data, HTTPResponse decodes chunks. Detecting when 
sendfile() is appropriate would be hard to do. And I understand some platforms 
only support sockets.

Also I notice that 3.5 has a new socket.sendfile() method (Issue 17552), which 
partly overlaps with this proposal. BTW the 3.4 os documentation should not 
mention the socket method, but it does!

--
nosy: +martin.panter
type:  -> enhancement

___
Python tracker 

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



[issue25058] Right square bracket argparse metavar

2015-09-10 Thread paul j3

paul j3 added the comment:

This assertion error caused by brackets (and other 'odd' characters) in the 
metavar is a known issue.

http://bugs.python.org/issue11874
http://bugs.python.org/issue14046

The formatter that handles line wrapping of the usage line is fragile.

--
nosy: +paul.j3

___
Python tracker 

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



[issue25057] Make parameter of io.base to be positional and keyword

2015-09-10 Thread Martin Panter

Martin Panter added the comment:

I’m not sure this is a good idea. IOBase is a base class, so adding to its API 
really means everybody’s subclasses may need to be updated to support the 
proper keyword argument names. Even ignoring classes outside Python’s standard 
library, it looks like you would need to update BufferedReader, FileIO, etc.

What is the reason you want to add keyword argument support? See also Issue 
8706 about doing this in general to other functions. I can think of one or two 
weak reasons why this might be useful:

* It allows swapping the arguments: file.seek(whence=SEEK_CUR, offset=+4) may 
be slightly more readable, because the offset has to be interpreted in the 
context of “whence”.

* It could allow usage like functools.partial(file.seek, 
whence=SEEK_CUR)(offset)

Also, making the offset default to zero might be useful for doing 
file.seek(whence=SEEK_END).

If we do go ahead with this, it would need documenting (version changed note), 
and test cases.

--
nosy: +martin.panter

___
Python tracker 

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



[issue25061] Add native enum support for argparse

2015-09-10 Thread paul j3

paul j3 added the comment:

The `type` parameter is a *function* that takes a string, and returns a valid 
value.  If it can't convert the string it is supposed to raise an error.  The 
default one is a do-nothing identity (take a string, return the string).  `int` 
is the Python function that converts a string to an integer.  Same for `float`.

Your example could be implemented with a simple type function:

def enumtype(astring):
try:
return CustomEnumType[astring.upper()]
except KeyError:
raise argparse.ArgumentError()

parser=argparse.ArgumentParser()
parser.add_argument("-p", type=enumtype, default="VAL1")

print(parser.parse_args([]))
print(parser.parse_args(["-p","val2"]))
print(parser.parse_args(["-p","val4"]))

which produces:

1557:~/mypy$ python3 issue25061.py
Namespace(p=)
Namespace(p=)
usage: issue25061.py [-h] [-p P]
issue25061.py: error: argument -p: invalid enumtype value: 'val4'


The default and 'val2' produce enum values in the Namespace.

'val4' raises an error, resulting in the usage and error message.

I tried to customize the error message to include the list of valid strings, 
but it looks like I'll have to dig into the calling tree to do that right.  
Still the default message is useful, displaying the name of the 'type' function.

If we were to add 'enum' support it would have to be something like 
'argparse.FileType', a factory class that would take an enum class as 
parameter, and create a function like my sample.

--
nosy: +paul.j3

___
Python tracker 

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



[issue25043] document socket constants for Bluetooth

2015-09-10 Thread Martin Panter

Martin Panter added the comment:

Well if the constant is not very useful then maybe we shouldn’t add it :)

For testing, nothing complicated. Maybe check the module attributes exist, and 
are strings. In the past, people have converted module-level constants to 
enums, and introduced a typo in a name along the way. Even the simplest test 
case would pick up this sort of typo.

--

___
Python tracker 

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



[issue22980] C extension naming doesn't take bitness into account

2015-09-10 Thread Steve Dower

Steve Dower added the comment:

There's no dot before the debug marker on Windows. Otherwise, looks good to me. 
Thanks for writing this up.

--

___
Python tracker 

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



[issue25061] Add native enum support for argparse

2015-09-10 Thread paul j3

paul j3 added the comment:

Here's a type function that enumerates the enum in the error message:

def enumtype(astring):
try:
return CustomEnumType[astring.upper()]
except KeyError:
msg = ', '.join([t.name.lower() for t in CustomEnumType])
msg = 'CustomEnumType: use one of {%s}'%msg
raise argparse.ArgumentTypeError(msg)

You could do the same sort of enumeration in the `help` parameter (or even the 
metavar).

One further note - the input string is first passed through `type`, then it is 
checked against the `choices` (if any).  If it is converted to the enum in an 
type function, the choices will also have to be enums, not their string 
representation.  

String defaults are (usually) passed through `type`.  Nonstring defaults are 
not converted or tested.

So the value of this sort of type function depends on whether it is more 
convenient to work with the string representation or the enum itself.  When 
exactly do you want the commandline string to be converted to the enum?

--

___
Python tracker 

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



[issue25038] test_os.TestSendfile.test_keywords() introduced a regression

2015-09-10 Thread Martin Panter

Martin Panter added the comment:

Victor, the BSD and OS X buildbots seem to be passing test_os now. E.g.:

http://buildbot.python.org/all/buildslaves/koobs-freebsd10
http://buildbot.python.org/all/buildslaves/intel-yosemite-icc

Do you agree we can close this?

--
nosy: +berker.peksag

___
Python tracker 

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



  1   2   >