[issue28294] HTTPServer server.py assumes sys.stderr != None

2016-09-28 Thread Jaap van der Velde

New submission from Jaap van der Velde:

On line 556 of server.py, the sys.stderr.write assumes that sys.stderr is 
assigned and not None.

However, when developing Windows services using the pypiwin32 library (as an 
example), sys.stderr == None

A workaround is to override the log_message method of the 
BaseHTTPRequestHandler, but it seems to me that the method should not assume 
the availability of stderr?

--
components: Library (Lib)
messages: 277593
nosy: grismar
priority: normal
severity: normal
status: open
title: HTTPServer server.py assumes sys.stderr != None
type: behavior
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



[issue28295] PyUnicode_AsUCS4 doc and impl conflict on exception

2016-09-28 Thread Xiang Zhang

New submission from Xiang Zhang:

PyUnicode_AsUCS4 declares to raise ValueError if buffer length is smaller than 
string length. But now the implementation raises SystemError.

--
components: Interpreter Core
messages: 277595
nosy: haypo, serhiy.storchaka, xiang.zhang
priority: normal
severity: normal
status: open
title: PyUnicode_AsUCS4 doc and impl conflict on exception
type: behavior
versions: Python 3.5, Python 3.6, Python 3.7

___
Python tracker 

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



[issue28257] Regression for star argument parameter error messages

2016-09-28 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Proposed patch fixes error message for var-positional arguments. It adds new 
opcode BUILD_TUPLE_UNPACK_WITH_CALL.

>>> min(1, *2)
Traceback (most recent call last):
  File "", line 1, in 
TypeError: min() argument after * must be an iterable, not int
>>> min(*[1], *2)
Traceback (most recent call last):
  File "", line 1, in 
TypeError: min() argument after * must be an iterable, not int

--
keywords: +patch
stage:  -> patch review
Added file: http://bugs.python.org/file44856/built_tuple_unpack_with_call.patch

___
Python tracker 

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



[issue28183] Clean up and speed up dict iteration

2016-09-28 Thread INADA Naoki

INADA Naoki added the comment:

Updated with small refactoring.
Confirmed passes quicktest and no warning from clang on OS X.

--
Added file: http://bugs.python.org/file44857/dict_iter3.patch

___
Python tracker 

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



[issue28296] Add __le__ and __ge__ to collections.Counter

2016-09-28 Thread Manuel Krebber

New submission from Manuel Krebber:

I would really like there to be comparison operators for collection.Counter 
similar to the ones for sets. While you can now use minus to some degree for 
that comparison, it is very inefficient. I have attached an implementation of 
__ge__ and __le__ as a patch. I could also provide the necessary additions to 
the documentation, if that is desired.

--
components: Library (Lib)
files: counter_comparison.patch
keywords: patch
messages: 277597
nosy: Wheerd
priority: normal
severity: normal
status: open
title: Add __le__ and __ge__ to collections.Counter
type: enhancement
versions: Python 3.5, Python 3.6, Python 3.7
Added file: http://bugs.python.org/file44858/counter_comparison.patch

___
Python tracker 

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



[issue28296] Add __le__ and __ge__ to collections.Counter

2016-09-28 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

This is a duplicate of issue22515.

--
nosy: +rhettinger, serhiy.storchaka
resolution:  -> duplicate
superseder:  -> Implement partial order on Counter

___
Python tracker 

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



[issue27838] test_os.test_chown() random failure on "AMD64 FreeBSD CURRENT Debug 3.x" buildbot

2016-09-28 Thread Kubilay Kocak

Kubilay Kocak added the comment:

Attach file with test results.

It's worth mentioning that these results may (or may not) be different than 
output when running under the process id started by twistd, which is executed 
by root (startup script), and results in the following command:

buildbot  9627   0.0  0.3 116200 2  -  IThu17   4:51.87 
/usr/local/bin/python2.7 /usr/local/bin/twistd --uid=buildbot --gid=buildbot 
--pidfile=/usr/home/buildbot/python/twistd.pid 
--python=/usr/home/buildbot/python/buildbot.tac

--
Added file: http://bugs.python.org/file44859/groups-test.log

___
Python tracker 

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



[issue28297] sched module example has wrong output

2016-09-28 Thread Arvind Padmanabhan

New submission from Arvind Padmanabhan:

Example in the sched module shows the following output:

930343690.257
>From print_time 930343695.274 positional
>From print_time 930343695.275 keyword
>From print_time 930343700.273 default
930343700.276

But since "keyword" is scheduled with a higher priority (lower number), it 
should be printed first.

URL: https://docs.python.org/3/library/sched.html
Section: 17.6

--
assignee: docs@python
components: Documentation
messages: 277600
nosy: Arvind Padmanabhan, docs@python
priority: normal
severity: normal
status: open
title: sched module example has wrong output
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



[issue5895] socketmodule.c on HPUX ia64 without _XOPEN_SOURCE_EXTENDED compiles incorrectly

2016-09-28 Thread Christian Heimes

Changes by Christian Heimes :


--
resolution:  -> out of date
stage: test needed -> 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



[issue28296] Add __le__ and __ge__ to collections.Counter

2016-09-28 Thread Manuel Krebber

Manuel Krebber added the comment:

Oh, I should have searched properly before creating this ticket. Sorry about 
that. I guess I will be subclassing Counter in my project then, to get this 
functionality... Only problem is, that when using the builtin __add__ etc. of 
my Counter subclass, I will get a Counter instance, that does not support 
ordering... So I guess I will not use it at all.

--

___
Python tracker 

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



[issue28297] sched module example has wrong output

2016-09-28 Thread Xiang Zhang

Xiang Zhang added the comment:

Though the delay arguments of keyword and positional are both 5, but their 
register time has tiny difference: 930343695.274 vs 930343695.275, so 
positional is printed first.

--
nosy: +xiang.zhang

___
Python tracker 

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



[issue28297] sched module example has wrong output

2016-09-28 Thread Xiang Zhang

Xiang Zhang added the comment:

Sorry, it's not 930343695.274 vs 930343695.275. I mean the register time is 
time.time() + delay, so there is tiny difference between the two. You can 
change the timefunc to lambda: int(time.time()), then you'll see keyword is 
printed first.

--

___
Python tracker 

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



[issue28298] can't set big int-like objects to items in array 'Q', 'L' and 'I'

2016-09-28 Thread Oren Milman

New submission from Oren Milman:

 current state 
On my Windows 10, on a 32-bit Python, The following runs fine:
import array
array.array('L').append(2 ** 32 - 1)

However, in the following, an OverflowError('Python int too large to convert to 
C long') is raised on the last line:
import array
class LikeInt:
def __init__(self, intVal):
self.intVal = intVal
def __int__(self):
return self.intVal
array.array('L').append(LikeInt(2 ** 32 - 1))

The reason for this behavior is the implementation of the function LL_setitem 
(in Modules/arraymodule.c) (edited brutally for brevity):
LL_setitem(arrayobject *ap, Py_ssize_t i, PyObject *v)
{
unsigned long x;
if (PyLong_Check(v)) {
x = PyLong_AsUnsignedLong(v);
}
else {
long y;
PyArg_Parse(v, "l;array item must be integer", &y);
x = (unsigned long)y;
}
(ap->ob_item)[i] = x;
}
The problem is that PyArg_Parse is used to convert a Python int into a C long. 
So PyArg_Parse fails when it is given a Python int which is in range(LONG_MAX + 
1, ULONG_MAX + 1), even though such Python int can be stored in a C unsigned 
long.

It is quite the same for array('I') and array('Q') (i.e. in II_setitem and in 
QQ_setitem, respectively).

With regard to relevant changes made in the past, PyArg_Parse was always used  
(in case '!PyLong_Check(v)'), since adding the original versions of:
* II_setitem and LL_setitem (back then, they were called I_setitem and 
L_setitem, respectively), in changeset 4875 
(https://hg.python.org/cpython/rev/911040e1bb11)
* QQ_setitem, in changeset 72430 
(https://hg.python.org/cpython/rev/15659e0e2b2e)


 proposed changes 
1. In Modules/arraymodule.c, change the implementation of LL_setitem (and 
likewise, of II_setitem and QQ_setitem) roughly to the following:
LL_setitem(arrayobject *ap, Py_ssize_t i, PyObject *v)
{
unsigned long x;
if (!PyLong_Check(v)) {
v = _PyLong_FromNbInt(v);
}
x = PyLong_AsUnsignedLong(v);
(ap->ob_item)[i] = x;
}

2. In Lib/test/test_array.py, add tests:
* to verify the bug is fixed, i.e. test the bounds of setting int-like 
objects to items in an integers array
* to verify float objects can't be set to items in an integers array 
(as is already the behavior, but there aren't any tests for it)

3. While we are in Lib/test/test_array.py, remove any checks whether 'long 
long' is available, as it must be available, since changeset 103105 
(https://hg.python.org/cpython/rev/9206a86f7321).

Note that issue #12974 (opened in 2011) proposes deprecating the ability to set 
int-like objects to items in an integers array. (I am not sure how that affects 
my patch, but I guess it should be noted.)


 diff 
The proposed patches diff file is attached.

(Note that the I didn't propose to change the perplexing error message 
'unsigned int is greater than maximum' in II_setitem, as there are many such 
messages in the codebase, and I am working on a patch for them as part of issue 
#15988.)


 tests 
I ran 'python_d.exe -m test -j3' (on my 64-bit Windows 10) with and without the 
patches, and got quite the same output. (That also means my new tests in 
test_array passed.)
The outputs of both runs are attached.

--
components: Library (Lib)
files: patchedCPythonTestOutput_ver1.txt
messages: 277604
nosy: Oren Milman
priority: normal
severity: normal
status: open
title: can't set big int-like objects to items in array 'Q', 'L' and 'I'
type: behavior
Added file: http://bugs.python.org/file44860/patchedCPythonTestOutput_ver1.txt

___
Python tracker 

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



[issue28298] can't set big int-like objects to items in array 'Q', 'L' and 'I'

2016-09-28 Thread Oren Milman

Changes by Oren Milman :


Added file: http://bugs.python.org/file44861/CPythonTestOutput.txt

___
Python tracker 

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



[issue28298] can't set big int-like objects to items in array 'Q', 'L' and 'I'

2016-09-28 Thread Oren Milman

Changes by Oren Milman :


--
keywords: +patch
Added file: http://bugs.python.org/file44862/issue28298_ver1.diff

___
Python tracker 

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



[issue28298] can't set big int-like objects to items in array 'Q', 'L' and 'I'

2016-09-28 Thread Oren Milman

Changes by Oren Milman :


--
versions: +Python 3.7

___
Python tracker 

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



[issue28288] Expose environment variable for Py_Py3kWarningFlag

2016-09-28 Thread Marc-Andre Lemburg

Marc-Andre Lemburg added the comment:

+1, but I'd name the env var PYTHON3WARNINGS.

Who knows, when Python 4 comes around the corner, we may need a 
PYTHON4WARNINGS...

--
nosy: +lemburg

___
Python tracker 

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



[issue28297] sched module example has wrong output

2016-09-28 Thread Xiang Zhang

Changes by Xiang Zhang :


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



[issue28247] Add an option to zipapp to produce a Windows executable

2016-09-28 Thread Paul Moore

Paul Moore added the comment:

OK, here's a first draft documentation patch. As it's purely a documentation 
change, I guess it should go into the 3.5, 3.6 and trunk branches? For now it's 
against trunk (it's not like that file has changed recently anyway), and I'll 
sort out the merge dance once it looks OK.

--
components: +Documentation -Library (Lib), Windows
keywords: +patch
stage: needs patch -> patch review
versions: +Python 3.5, Python 3.6
Added file: http://bugs.python.org/file44863/zipapp-doc.patch

___
Python tracker 

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



[issue24549] string.format() should have a safe_substitute equivalent, to be run consecutively

2016-09-28 Thread azrdev

azrdev added the comment:

(Sorry for not replying so long, I expected an email notification)

> Why not use string.Template?

because it's so slow

> I think that there may be a good argument to be made for a safe_format with 
> *named* arguments, like string.Template, but not positional arguments.

Yes!

> But that would require some discussion, to decide on the correct behaviour.

What open question(s) do you think of?


For context, I got the idea for this from Qts .arg() which can be chained, see 
.

--

___
Python tracker 

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



[issue28298] can't set big int-like objects to items in array 'Q', 'L' and 'I'

2016-09-28 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



[issue28298] can't set big int-like objects to items in array 'Q', 'L' and 'I'

2016-09-28 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
nosy: +mark.dickinson, meador.inge

___
Python tracker 

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



[issue12974] array module: deprecate '__int__' conversion support for array elements

2016-09-28 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



[issue28183] Clean up and speed up dict iteration

2016-09-28 Thread INADA Naoki

Changes by INADA Naoki :


--
versions: +Python 3.7
Added file: http://bugs.python.org/file44864/dict_iter4.patch

___
Python tracker 

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



[issue24549] string.format() should have a safe_substitute equivalent, to be run consecutively

2016-09-28 Thread Eric V. Smith

Eric V. Smith added the comment:

>> But that would require some discussion, to decide on the correct behaviour.

>What open question(s) do you think of?

You need to provide an exact specification of what you want. It's not clear, 
for example, if you want to support required positional placeholders ({0}, 
etc.) but optionally missing named placeholders ({foo}).

I'd also suggest implementing this as a function, so you can get some 
real-world usage out of it. Maybe:

def format_safe(s, *args, **kwargs):

format_safe("{0} {1} {foo} {bar}", 'one', 'two', bar='bar')
->
'one two {foo} bar}'

or whatever you decide the signature and functionality should be.

You can probably subclass from string.Formatter to do some of the heavy lifting 
for you, so I expect this wouldn't be very hard, depending on what you're 
really after.

While you might find this function useful, I don't want to get your hopes up 
that this would be added to core Python as a member of str. I still don't see 
why this would be better than a single call to .format() that specifies all of 
the parameters. You'd have to have some use case that doesn't involve chaining 
for that to make sense (to me). And maybe functools.partial() or some 
derivative would make sense in that case.

--
status: open -> pending
versions: +Python 3.7 -Python 3.6

___
Python tracker 

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



[issue28276] test_loading.py - false positive result for "def test_find" when find_library() is not functional or the (shared) library does not exist

2016-09-28 Thread Michael Felt

Michael Felt added the comment:

Is this suitable?

def test_find(self):
# to track that at least one call to find_library() found something
found = false
for name in ("c", "m"):
lib = find_library(name)
if lib:
found = true
cdll.LoadLibrary(lib)
CDLL(lib)
# test is FAILED if nothing was found
self.assertTrue(found)

--

___
Python tracker 

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



[issue28276] test_loading.py - false positive result for "def test_find" when find_library() is not functional or the (shared) library does not exist

2016-09-28 Thread Michael Felt

Michael Felt added the comment:

ok - false needs to be False and true needs to be True

seemed so simple. Sigh.

--

___
Python tracker 

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



[issue28299] DirEntry.is_dir() evaluates True for a file on Windows

2016-09-28 Thread David Staab

New submission from David Staab:

I'm using Python 3.5.2 on Windows 10 Pro to run the following code with the 
attached file structure.

The test code is:
from os import DirEntry, scandir

def test_is_dir():
for item in os.scandir(TEST_DIR):
if item.is_dir:
print(item.path)
return

TEST_DIR = '.'
test_is_dir()


The console output is:
===
Connected to pydev debugger (build 162.1967.10)
.\20160707
.\scratchpad.py

Process finished with exit code 0
===

I would expect to only see '.\20160707', but "if item.is_dir:" always evaluates 
to True.

I notice that changing the import line to "from os import DirEntry, scandir" 
yields the exception "ImportError: cannot import name 'DirEntry'".

--
components: Windows
files: testmodule.zip
messages: 277611
nosy: David Staab, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: DirEntry.is_dir() evaluates True for a file on Windows
type: behavior
versions: Python 3.5
Added file: http://bugs.python.org/file44865/testmodule.zip

___
Python tracker 

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



[issue28183] Clean up and speed up dict iteration

2016-09-28 Thread INADA Naoki

INADA Naoki added the comment:

Draft Misc/NEWS entry (and commit message) is:

 Core and Builtins
 -

+- Issue #28183: Optimize dict iteration.
+

--

___
Python tracker 

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



[issue28299] DirEntry.is_dir() evaluates True for a file on Windows

2016-09-28 Thread Paul Moore

Paul Moore added the comment:

is_dir is a *method*. To find out if an entry is a directory, you need to call 
it.

So you need

from os import DirEntry, scandir

def test_is_dir():
for item in os.scandir(TEST_DIR):
if item.is_dir():
# ^^ note change
print(item.path)
return

TEST_DIR = '.'
test_is_dir()

--
resolution:  -> not a bug
status: open -> closed

___
Python tracker 

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



[issue28299] DirEntry.is_dir() evaluates True for a file on Windows

2016-09-28 Thread Zachary Ware

Changes by Zachary Ware :


--
stage:  -> resolved

___
Python tracker 

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



[issue28147] Unbounded memory growth resizing split-table dicts

2016-09-28 Thread INADA Naoki

INADA Naoki added the comment:

haypo, Could you review fix-28147-py35.patch and fix-28147.patch ?

Draft NEWS entry:

- Issue #28147: Fixed split table dict may consume unlimited memory.

--

___
Python tracker 

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



[issue27275] KeyError thrown by optimised collections.OrderedDict.popitem()

2016-09-28 Thread INADA Naoki

INADA Naoki added the comment:

lgtm

--
nosy: +inada.naoki

___
Python tracker 

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



[issue28300] [PATCH] Fix misspelled "implemented" word

2016-09-28 Thread Shlomi Fish

New submission from Shlomi Fish:

This patch fixes two places where "implement" was misspelled. I hereby disclaim 
all ownership of my changes (but crediting me will be appreciated.)

--
files: python-fix-spelling-of-implement.patch
keywords: patch
messages: 277616
nosy: shlomif
priority: normal
severity: normal
status: open
title: [PATCH] Fix misspelled "implemented" word
versions: Python 3.7
Added file: 
http://bugs.python.org/file44866/python-fix-spelling-of-implement.patch

___
Python tracker 

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



[issue28294] HTTPServer server.py assumes sys.stderr != None

2016-09-28 Thread R. David Murray

R. David Murray added the comment:

That would be masking an error, I think.  What might be reasonable would be to 
convert it to use the logging module in 3.7.

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



[issue28296] Add __le__ and __ge__ to collections.Counter

2016-09-28 Thread R. David Murray

Changes by R. David Murray :


--
status: open -> closed

___
Python tracker 

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



[issue28300] [PATCH] Fix misspelled "implemented" word

2016-09-28 Thread SilentGhost

SilentGhost added the comment:

LGTM

--
assignee:  -> docs@python
components: +Documentation
nosy: +SilentGhost, docs@python
stage:  -> commit review
type:  -> behavior
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



[issue28301] python3.4-config --extension-suffix reports '.cpython-34m.so'

2016-09-28 Thread Lou Picciano

New submission from Lou Picciano:

python3.4-config --extension-suffix reports '.cpython-34m.so'

Is this behavior as intended? Many build integrations may expect(?) an .so 
extension?

--
components: Extension Modules
messages: 277618
nosy: DrLou
priority: normal
severity: normal
status: open
title: python3.4-config --extension-suffix reports '.cpython-34m.so'
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



[issue28293] Don't completely dump the regex cache when full

2016-09-28 Thread SilentGhost

SilentGhost added the comment:

Serhiy, your patch doesn't seem to apply cleanly. Also, it's perhaps worth 
opening the issue if you'd like to continue working on it.

--
nosy: +SilentGhost

___
Python tracker 

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



[issue21903] ctypes documentation MessageBoxA example produces error

2016-09-28 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 11c3d6a8f5fd by Berker Peksag in branch '3.5':
Issue #21903: Update ctypes example to use MessageBoxW
https://hg.python.org/cpython/rev/11c3d6a8f5fd

New changeset 3031e4a95131 by Berker Peksag in branch '3.6':
Issue #21903: Merge from 3.5
https://hg.python.org/cpython/rev/3031e4a95131

New changeset cb55aedcc7e8 by Berker Peksag in branch 'default':
Issue #21903: Merge from 3.6
https://hg.python.org/cpython/rev/cb55aedcc7e8

--
nosy: +python-dev

___
Python tracker 

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



[issue28303] [PATCH] Fix broken grammar in "pydoc3 unittest"

2016-09-28 Thread Shlomi Fish

New submission from Shlomi Fish:

Currently the comment in the example in "pydoc3 unittest" reads:

«
## test method names begin 'test*'
»

This is broken grammar and the attached patch against the hg default branch 
corrects it. All tests are passing and I disclaim any implicit or explicit 
ownership of my changes.

--
components: Library (Lib)
files: python-fix-broken-grammar-in-pydoc3-unittest.patch
keywords: patch
messages: 277623
nosy: shlomif
priority: normal
severity: normal
status: open
title: [PATCH] Fix broken grammar in "pydoc3 unittest"
versions: Python 3.7
Added file: 
http://bugs.python.org/file44867/python-fix-broken-grammar-in-pydoc3-unittest.patch

___
Python tracker 

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



[issue28302] Unpacking numpy array give list

2016-09-28 Thread RAMESH PAMPANA

New submission from RAMESH PAMPANA:

Unpacking numpy array gives list rather numpy array.

>>> import numpy as np
>>> a = np.array([1,2,3,4])
>>> x, *y, z = a
>>> type(a)

>>> type(y)
>
>> type(x)


--
components: Regular Expressions
messages: 277622
nosy: ezio.melotti, mrabarnett, rpampana
priority: normal
severity: normal
status: open
title: Unpacking numpy array give list
type: behavior
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



[issue21903] ctypes documentation MessageBoxA example produces error

2016-09-28 Thread Berker Peksag

Berker Peksag added the comment:

Thanks for the report! I've now updated the example to use MessageBoxw.

Eryk, do you find the second example (GetWindowRect) is useful? Can we make it 
more usable? Unless I'm missing something, we need to pass the return value of 
GetActiveWindow() to make it work.

--
nosy: +berker.peksag, eryksun
resolution:  -> fixed
stage:  -> resolved
status: open -> closed
versions: +Python 3.5, Python 3.6, Python 3.7 -Python 3.3, Python 3.4

___
Python tracker 

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



[issue28300] [PATCH] Fix misspelled "implemented" word

2016-09-28 Thread Berker Peksag

Berker Peksag added the comment:

Thanks!

--
nosy: +berker.peksag
resolution:  -> fixed
stage: commit review -> 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



[issue28302] Unpacking numpy array give list

2016-09-28 Thread SilentGhost

SilentGhost added the comment:

It doesn't matter what you're unpacking, *y will collect the unpacked elements 
into a list.

--
components: +Interpreter Core -Regular Expressions
nosy: +SilentGhost
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



[issue28302] Unpacking numpy array give list

2016-09-28 Thread R. David Murray

R. David Murray added the comment:

Yes, you are unpacking into a list, that's what the * syntax does in this 
context.  Since the rhs can be a mix of types, there's really no other 
reasonable meaning for the syntax.  (The same is true for tuples, by the way).

--
components: +Regular Expressions -Interpreter Core
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



[issue28303] [PATCH] Fix broken grammar in "pydoc3 unittest"

2016-09-28 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 650775f10178 by Berker Peksag in branch '3.5':
Issue #28303: Fix grammar in unittest.__doc__, patch by Shlomi Fish
https://hg.python.org/cpython/rev/650775f10178

New changeset d0b509777443 by Berker Peksag in branch '3.6':
Issue #28303: Merge from 3.5
https://hg.python.org/cpython/rev/d0b509777443

New changeset 6b59551bb4fe by Berker Peksag in branch 'default':
Issue #28303: Merge from 3.6
https://hg.python.org/cpython/rev/6b59551bb4fe

--
nosy: +python-dev

___
Python tracker 

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



[issue28183] Clean up and speed up dict iteration

2016-09-28 Thread STINNER Victor

STINNER Victor added the comment:

I reviewed dict_iter4.patch on Rietveld.

--

___
Python tracker 

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



[issue28303] [PATCH] Fix broken grammar in "pydoc3 unittest"

2016-09-28 Thread Berker Peksag

Berker Peksag added the comment:

Good catch, thanks!

--
nosy: +berker.peksag
resolution:  -> fixed
stage:  -> resolved
status: open -> closed
type:  -> behavior
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



[issue27322] test_compile_path fails when python has been installed

2016-09-28 Thread Roundup Robot

Roundup Robot added the comment:

New changeset e53984b87cf0 by Berker Peksag in branch '3.6':
Issue #27322: Set sys.path to a temp dir in test_compile_path
https://hg.python.org/cpython/rev/e53984b87cf0

New changeset a78446a65b1d by Berker Peksag in branch 'default':
Issue #27322: Merge from 3.6
https://hg.python.org/cpython/rev/a78446a65b1d

--

___
Python tracker 

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



[issue27435] ctypes library loading and AIX - also for 2.7.X (and later)

2016-09-28 Thread Michael Felt

Michael Felt added the comment:

The "core" changes in this patch are very simple - in parallel with the way 
find_library() is managed in util.py



a) __init__.py:
   add an additional mode bit for call to dlopen() (in __init__.py)
diff -u src/Python-2.7.12/Lib/ctypes/__init__.py 
python-2.7.12.2/Lib/ctypes/__init__.py
--- src/Python-2.7.12/Lib/ctypes/__init__.py2016-06-25 21:49:30 +
+++ python-2.7.12.2/Lib/ctypes/__init__.py  2016-09-28 12:55:15 +
@@ -352,6 +352,16 @@
 flags |= _FUNCFLAG_USE_ERRNO
 if use_last_error:
 flags |= _FUNCFLAG_USE_LASTERROR
+if _sys.platform.startswith("aix"):
+"""When the name contains ".a(" and ends with ")",
+   asin "libFOO.a(libFOO.so)" this is taken to be an
+   archive(member) syntax for dlopen(), and the mode is adjusted.
+   Otherwise, name is presented to dlopen() as a file argument.
+"""
+# from _ctypes import RTLD_NOW - not until Python3.7
+if name and name.endswith(")") and ".a(" in name:
+RTLD_MEMBER = 0x0004
+mode |= RTLD_MEMBER

 class _FuncPtr(_CFuncPtr):
 _flags_ = flags

b) util.py:
   determine that is is not generic posix and call and import
   and execute an external .py file
c) some prettier (optional!) print statements in self-test

diff -u src/Python-2.7.12/Lib/ctypes/util.py python-2.7.12.2/Lib/ctypes/util.py
--- src/Python-2.7.12/Lib/ctypes/util.py2016-06-25 21:49:30 +
+++ python-2.7.12.2/Lib/ctypes/util.py  2016-09-28 08:41:57 +
@@ -81,6 +81,14 @@
 continue
 return None

+if sys.platform.startswith("aix"):
+# find .so members in .a files
+# using dump loader header information + sys.
+import ctypes._aix as aix
+
+def find_library(name):
+return aix.find_library(name)
+
 elif os.name == "posix":
 # Andreas Degert's find functions, using gcc, /sbin/ldconfig, objdump
 import re, tempfile, errno
@@ -247,10 +255,11 @@
 print find_library("msvcrt")

 if os.name == "posix":
-# find and load_version
-print find_library("m")
-print find_library("c")
-print find_library("bz2")
+# find
+print("m\t:: %s" % find_library("m"))
+print("c\t:: %s" % find_library("c"))
+print("bz2\t:: %s" % find_library("bz2"))
+print("crypt\t:: %s" % find_library("crypt"))

 # getattr
 ##print cdll.m
@@ -262,6 +271,12 @@
 print cdll.LoadLibrary("libcrypto.dylib")
 print cdll.LoadLibrary("libSystem.dylib")
 print cdll.LoadLibrary("System.framework/System")
+elif sys.platform.startswith("aix"):
+print("crypto\t:: %s" % cdll.LoadLibrary(find_library("crypto")))
+if (sys.maxsize < 2**32):
+print("c\t:: %s" % cdll.LoadLibrary("libc.a(shr.o)"))
+else:
+print("c\t:: %s" % cdll.LoadLibrary("libc.a(shr_64.o)"))
 else:
 print cdll.LoadLibrary("libm.so")
 print cdll.LoadLibrary("libcrypt.so")


d) in test_loading.py say test is failed if find_library does not find
   at least one library

diff -u src/Python-2.7.12/Lib/ctypes/test/test_loading.py 
python-2.7.12.2/Lib/ctypes/test/test_loading.py
--- src/Python-2.7.12/Lib/ctypes/test/test_loading.py   2016-06-25 21:49:30 
+
+++ python-2.7.12.2/Lib/ctypes/test/test_loading.py 2016-09-28 12:43:46 
+
@@ -11,6 +11,11 @@
 libc_name = "coredll"
 elif sys.platform == "cygwin":
 libc_name = "cygwin1.dll"
+elif sys.platform.startswith("aix"):
+if (sys.maxsize < 2**32):
+libc_name = "libc.a(shr.o)"
+else:
+libc_name = "libc.a(shr_64.o)"
 else:
 libc_name = find_library("c")

@@ -38,11 +43,16 @@
 self.assertRaises(OSError, cdll.LoadLibrary, self.unknowndll)

 def test_find(self):
+# to track that at least one call to find_library() found something
+found = False
 for name in ("c", "m"):
 lib = find_library(name)
 if lib:
+found = True
 cdll.LoadLibrary(lib)
 CDLL(lib)
+# test is FAILED if nothing was found
+self.assertTrue(found)

 @unittest.skipUnless(os.name in ("nt", "ce"),
  'test specific to Windows (NT/CE)')

Finally - there is the additional file: _aix.py - submitted as an attachment - 
and a patch with them all

--
Added file: http://bugs.python.org/file44868/Python2.7.Lib.ctypes.160928.patch

___
Python tracker 

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



[issue27322] test_compile_path fails when python has been installed

2016-09-28 Thread Berker Peksag

Changes by Berker Peksag :


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



[issue28300] [PATCH] Fix misspelled "implemented" word

2016-09-28 Thread Roundup Robot

Roundup Robot added the comment:

New changeset ce19dcce84fe by Berker Peksag in branch '3.5':
Issue #28300: Fix typos, patch by Shlomi Fish
https://hg.python.org/cpython/rev/ce19dcce84fe

New changeset 078f185f0041 by Berker Peksag in branch '3.6':
Issue #28300: Merge from 3.5
https://hg.python.org/cpython/rev/078f185f0041

New changeset b1d2e303570d by Berker Peksag in branch 'default':
Issue #28300: Merge from 3.6
https://hg.python.org/cpython/rev/b1d2e303570d

--
nosy: +python-dev

___
Python tracker 

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



[issue27435] ctypes library loading and AIX - also for 2.7.X (and later)

2016-09-28 Thread Michael Felt

Changes by Michael Felt :


Added file: http://bugs.python.org/file44869/_aix.py

___
Python tracker 

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



[issue28281] Remove year limits from calendar

2016-09-28 Thread Raymond Hettinger

Raymond Hettinger added the comment:

> Under my proposal year=-1 is 2 B.C. and year 0 is a leap year

We should refuse the temptation to guess (i.e. make up our own arbitrary 
interpretations).   Instead, just document the known limits.

--
nosy: +rhettinger

___
Python tracker 

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



[issue23520] test_os failed (python-3.4.3, Linux SuSE)

2016-09-28 Thread Berker Peksag

Berker Peksag added the comment:

This is a duplicate of issue 11341.

--
nosy: +berker.peksag
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> test_os fails

___
Python tracker 

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



[issue28295] PyUnicode_AsUCS4 doc and impl conflict on exception

2016-09-28 Thread Xiang Zhang

Xiang Zhang added the comment:

Here is the patch.

--
keywords: +patch
stage:  -> patch review
Added file: http://bugs.python.org/file44870/PyUnicode_AsUCS4.patch

___
Python tracker 

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



[issue27565] Offer error context manager for code.interact

2016-09-28 Thread Berker Peksag

Berker Peksag added the comment:

Hi Claudiu, thanks for the report, but I don't think this is a common use case 
that needs to be supported in the standard library. Other people may prefer to 
use different solutions in a similar case (e.g. using a debugger) Plus, it's 
not hard to implement this as a custom context manager in your code.

--
nosy: +berker.peksag
resolution:  -> rejected
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



[issue28217] Add interactive console tests

2016-09-28 Thread Steve Dower

Changes by Steve Dower :


--
assignee:  -> steve.dower

___
Python tracker 

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



[issue28247] Add an option to zipapp to produce a Windows executable

2016-09-28 Thread Brett Cannon

Brett Cannon added the comment:

Only backport if you want; it's not a bug fix so technically it doesn't need to 
be backported.

--

___
Python tracker 

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



[issue28304] Condition.wait() doesn't raise KeyboardInterrupt

2016-09-28 Thread Adam Roberts

New submission from Adam Roberts:

This was fixed for Python 3 in https://bugs.python.org/issue8844 but needs to 
be backported.

--
components: Library (Lib)
messages: 277639
nosy: Adam Roberts
priority: normal
severity: normal
status: open
title: Condition.wait() doesn't raise KeyboardInterrupt
type: behavior
versions: Python 2.7

___
Python tracker 

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



[issue8844] Condition.wait() doesn't raise KeyboardInterrupt

2016-09-28 Thread STINNER Victor

STINNER Victor added the comment:

> Is it possible to backport this patch to 2.7?

No.

Python 2.7 supports many implementations of threads:

$ ls Python/thread_*h -1
Python/thread_atheos.h
Python/thread_beos.h
Python/thread_cthread.h
Python/thread_foobar.h
Python/thread_lwp.h
Python/thread_nt.h
Python/thread_os2.h
Python/thread_pth.h
Python/thread_pthread.h
Python/thread_sgi.h
Python/thread_solaris.h
Python/thread_wince.h

Supporting signals on all implementations would be a huge work.

Handling correctly signals is also a complex task. For example, the PEP 475 
changed how Python 3.5 handles signals (retry interrupted syscall), the change 
is larger than just the threading module. This PEP has an impact on the whole 
CPython code base (C and Python).

In Python, unit tests are important. The change b750c45a772c added many unit 
tests, I expect that it will be tricky to make them reliable on all platforms 
supported by Python 2.7. I dislike the idea of backporting the feature just for 
a few platforms.

I mean that the change b750c45a772c alone is not enough, this change depends on 
many earlier changes used to cleanup/prepare the code to support this change. 
It is also followed by many changes to enhance how Python handles signals. It 
took multiple years to fix all subtle issues, race conditions, etc.

There is also a significant risk of breaking applications relying on the 
current behaviour of Python 2.7 (locks are not interrupted by signals).

--

___
Python tracker 

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



[issue28281] Remove year limits from calendar

2016-09-28 Thread Alexander Belopolsky

Alexander Belopolsky added the comment:

The proposed interpretation of nonpositive years is not arbitrary, it is a 
natural extension of the same formulas that we use for positive years.  On the 
other hand 1- limits are arbitrary.  If we wanted to restrict calendars to 
4-digit years we would limit years to the 1000- range.

Note that interpreting year 0 as 1 BCE is not without a precedent.  ISO 8601 
standard does exactly that with the caveat that "values in the range [] 
through [1582] shall only be used by mutual agreement of the partners in 
information interchange." Furthermore, "an expanded year representation 
[±Y] must have an agreed-upon number of extra year digits beyond the 
four-digit minimum, and it must be prefixed with a + or − sign instead of the 
more common AD/BC (or BCE/CE) notation; by convention 1 BC is labelled +, 2 
BC is labeled -0001, and so on."  See 
 citing ISO 8601:2004 sections 
3.4.2, 4.1.2.4 and Annex B.1.1.

Furthermore, documenting the existing limits is not an easy task.  For example

>>> from calendar import *
>>> cal = TextCalendar(1)
>>> cal.prmonth(1, 1)
 January 1
Tu We Th Fr Sa Su Mo
   1
 2  3  4  5  6  7  8
 9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31

displays 6 days in December of 1 BCE as blanks.  Similarly itermonthdays() and 
itermonthdays2() generators yield objects corresponding to these days.  Are 
these days within the calendar limits or not?

Note that I am not proposing to extend the range of the datetime.date objects.  
Doing that would be a much more difficult task, but defining calendars for out 
of range years as those for year % 400 is trivial and much easier than to 
figure out and document the edge behaviors.

--

___
Python tracker 

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



[issue28300] [PATCH] Fix misspelled "implemented" word

2016-09-28 Thread Shlomi Fish

Shlomi Fish added the comment:

You're welcome and thanks for applying it (and so quickl).

--

___
Python tracker 

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



[issue28303] [PATCH] Fix broken grammar in "pydoc3 unittest"

2016-09-28 Thread Shlomi Fish

Shlomi Fish added the comment:

You're welcome, and thanks for applying the patch so quickly.

--

___
Python tracker 

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



[issue28292] Make Calendar.itermonthdates() behave consistently in edge cases

2016-09-28 Thread Alexander Belopolsky

Alexander Belopolsky added the comment:

I would like to take the #1 approach, and also implement an itermonthdays3() 
generator that would be like  itermonthdates(), but return 3-tuples (year, 
month, day) instead of datetime.date objects.

The name "itermonthdays3" is subject to discussion, but it fits with the 
existing "itermonthdays" and "itermonthdays2" that yield integers and 2-tuples 
respectively.  An alternative, but slightly longer name would be 
"itermonthdatetuples".

itermonthdates() can then be reimplemented as

def itermonthdates(self, year, month):
for y, m, d in self.itermonthdays3(year, month):
yield datetime.date(y, m, d)

with the obvious out of bounds behavior.

--

___
Python tracker 

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



[issue12743] C API marshalling doc contains XXX

2016-09-28 Thread Berker Peksag

Changes by Berker Peksag :


--
versions: +Python 3.7
Added file: http://bugs.python.org/file44871/issue12743_v2.diff

___
Python tracker 

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



[issue27740] Fix doc of Py_CompileStringExFlags

2016-09-28 Thread Roundup Robot

Roundup Robot added the comment:

New changeset ee76e84f115f by Berker Peksag in branch '3.5':
Issue #27740: Fix typo in Py_CompileStringExFlags
https://hg.python.org/cpython/rev/ee76e84f115f

New changeset 2ee939b314a2 by Berker Peksag in branch '3.6':
Issue #27740: Merge from 3.5
https://hg.python.org/cpython/rev/2ee939b314a2

New changeset a0b13ea75849 by Berker Peksag in branch 'default':
Issue #27740: Merge from 3.6
https://hg.python.org/cpython/rev/a0b13ea75849

--
nosy: +python-dev

___
Python tracker 

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



[issue27740] Fix doc of Py_CompileStringExFlags

2016-09-28 Thread Berker Peksag

Changes by Berker Peksag :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
versions: +Python 3.7

___
Python tracker 

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



[issue28304] Condition.wait() doesn't raise KeyboardInterrupt

2016-09-28 Thread Berker Peksag

Berker Peksag added the comment:

Per Victor's comment in issue 8844 
(http://bugs.python.org/issue8844#msg277640), I'm closing this as 'wont fix'. 
Thanks for the report!

--
nosy: +berker.peksag
resolution:  -> wont fix
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



[issue27322] test_compile_path fails when python has been installed

2016-09-28 Thread Berker Peksag

Berker Peksag added the comment:

The buildbot is now green. Closing this as fixed.

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



[issue27322] test_compile_path fails when python has been installed

2016-09-28 Thread STINNER Victor

STINNER Victor added the comment:

Thanks for your fix :-)

--

___
Python tracker 

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



[issue27322] test_compile_path fails when python has been installed

2016-09-28 Thread Chris Angelico

Chris Angelico added the comment:

Also working for me. Thanks!

--

___
Python tracker 

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



[issue28281] Remove year limits from calendar

2016-09-28 Thread Mariatta Wijaya

Changes by Mariatta Wijaya :


--
nosy: +Mariatta

___
Python tracker 

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



[issue26869] unittest longMessage docs

2016-09-28 Thread Mariatta Wijaya

Changes by Mariatta Wijaya :


--
nosy: +Mariatta

___
Python tracker 

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



[issue28255] TextCalendar.prweek/month/year outputs an extra whitespace character

2016-09-28 Thread Alexander Belopolsky

Changes by Alexander Belopolsky :


--
nosy: +belopolsky

___
Python tracker 

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



[issue28305] Make error for Python3.6 on Cygwin

2016-09-28 Thread Ron Barak

New submission from Ron Barak:

Successfully did:

$ gunzip Python-3.6.0b1.tgz
$ tar xvf Python-3.6.0b1.tar
$ pushd Python-3.6.0b1
$ ./configure --disable-ipv6 --with-optimizations

However, when trying to do:

$ make profile-opt

I get:

...

gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall 
-Wstrict-prototypes-std=c99 -Wextra -Wno-unused-result 
-Wno-unused-parameter -Wno-missing-field-initializers -fprofile-generate   -I. 
-IInclude -I./Include-DPy_BUILD_CORE  -c ./Modules/signalmodule.c -o 
Modules/signalmodule.o
In file included from Include/Python.h:85:0,
 from ./Modules/signalmodule.c:6:
./Modules/signalmodule.c: In function 'fill_siginfo':
./Modules/signalmodule.c:960:60: error: 'siginfo_t {aka struct }' 
has no member named 'si_band'
 PyStructSequence_SET_ITEM(result, 6, PyLong_FromLong(si->si_band));
^
Include/tupleobject.h:62:75: note: in definition of macro 'PyTuple_SET_ITEM'
 #define PyTuple_SET_ITEM(op, i, v) (((PyTupleObject *)(op))->ob_item[i] = v)
   ^
./Modules/signalmodule.c:960:5: note: in expansion of macro 
'PyStructSequence_SET_ITEM'
 PyStructSequence_SET_ITEM(result, 6, PyLong_FromLong(si->si_band));
 ^
make[2]: *** [Makefile:1731: Modules/signalmodule.o] Error 1
make[2]: Leaving directory '/home/Administrator/python/3.6/Python-3.6.0b1'
make[1]: *** [Makefile:511: build_all_generate_profile] Error 2
make[1]: Leaving directory '/home/Administrator/python/3.6/Python-3.6.0b1'
make: *** [Makefile:496: profile-opt] Error 2

--
components: Build
files: python3.6Make.err.txt
messages: 277650
nosy: ronbarak
priority: normal
severity: normal
status: open
title: Make error for Python3.6 on Cygwin
type: compile error
versions: Python 3.6
Added file: http://bugs.python.org/file44872/python3.6Make.err.txt

___
Python tracker 

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



[issue2504] Add gettext.pgettext() and variants support

2016-09-28 Thread Leonid Suprun

Changes by Leonid Suprun :


--
nosy: +Leonid Suprun

___
Python tracker 

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



[issue28305] Make error for Python3.6 on Cygwin

2016-09-28 Thread Christian Heimes

Christian Heimes added the comment:

Cygwin is an unsupported platform. It seems like Cygwin broke siginfo_t. The 
struct must have a si_band member, see 
http://man7.org/linux/man-pages/man2/rt_sigaction.2.html .

--
nosy: +christian.heimes

___
Python tracker 

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



[issue28305] Make error for Python3.6 on Cygwin

2016-09-28 Thread R. David Murray

Changes by R. David Murray :


--
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> compile error Python3.3 on Cygwin

___
Python tracker 

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



[issue2504] Add gettext.pgettext() and variants support

2016-09-28 Thread Antti Haapala

Antti Haapala added the comment:

*wow* isn't this in Python 3 yet (I've been using Zope translationstrings 
lately so I didn't know that pgettext is still not supported).

--
nosy: +ztane

___
Python tracker 

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



[issue28305] Make error for Python3.6 on Cygwin

2016-09-28 Thread Ron Barak

Ron Barak added the comment:

Re: Cygwin is an unsupported platform. 

Currently, from the contents of Python-3.6.0b1, one may be led to believe that 
Cygwin _is_ supported, e.g. - see the references to Cygwin in the README file:

$ grep -i cygwin README
On Unix, Linux, BSD, OSX, and Cygwin:
find out more.  On OSX and Cygwin, the executable is called python.exe;

--

___
Python tracker 

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



[issue28305] Make error for Python3.6 on Cygwin

2016-09-28 Thread R. David Murray

R. David Murray added the comment:

cygwin used to be fully supported, but support broke because there was no one 
around that was maintaining it.  There has been renewed interest, and some 
progress toward fixing cygwin support (more help is appreciated), but it cannot 
be called a supported platform at the moment because there is no maintainer on 
our team and there is no buildbot.  There are hopes that both of these 
deficiencies will be remedied.

This issue is a duplicate of issue 21085, and there is a patch in that issue 
that has not been applied yet.

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



[issue27100] Attempting to use class with both __enter__ & __exit__ undefined yields __exit__ attribute error

2016-09-28 Thread Ned Deily

Changes by Ned Deily :


--
stage:  -> patch review
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



[issue28305] Make error for Python3.6 on Cygwin

2016-09-28 Thread Ron Barak

Ron Barak added the comment:

Can I apply 
http://bugs.python.org/file44208/3.5-issue21085-struct_siginfo-2.patch to 3.6 
as is?

--

___
Python tracker 

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



[issue28305] Make error for Python3.6 on Cygwin

2016-09-28 Thread R. David Murray

R. David Murray added the comment:

If you can't please report it on that issue.

--

___
Python tracker 

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



[issue28306] incorrect output "int division or modulo by zero" in Handling Exceptions tutorial

2016-09-28 Thread Viorel Tabara

New submission from Viorel Tabara:

I'm reading the Python 3.5.2 documentation at:
  
   https://docs.python.org/3/tutorial/errors.html#handling-exceptions

which shows the following example:

   >>> def this_fails():
   ... x = 1/0
   ...
   >>> try:
   ... this_fails()
   ... except ZeroDivisionError as err:
   ... print('Handling run-time error:', err)
   ...
   Handling run-time error: int division or modulo by zero 

Running the code as a script produces:

   $ python3 -V
   Python 3.5.2
   $ python3 p.py
   Handling run-time error: division by zero

   $ python2 -V
   Python 2.7.12
   $ python2 p.py
   ('Handling run-time error:', ZeroDivisionError('integer division or modulo 
by zero',))
   
The same output is listed for 3.6 and 3.7 tutorials but I don't have those 
versions installed on my system.

--
assignee: docs@python
components: Documentation
messages: 277657
nosy: docs@python, viorel
priority: normal
severity: normal
status: open
title: incorrect output "int division or modulo by zero" in Handling Exceptions 
tutorial
type: behavior
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



[issue8844] Condition.wait() doesn't raise KeyboardInterrupt

2016-09-28 Thread Gregory P. Smith

Gregory P. Smith added the comment:

As a data point confirming that: we tried backporting the much nicer 
non-polling condition implementation 
(https://github.com/python/cpython/commit/15801a1d52c25fa2a19d649ea2671080f138fca1.patch)
 to our Python 2.7 interpreter at work but ran into actual code that failed as 
a result of the interruption behavior changing.

While it is a nice goal, it is a non-trivial change.  Not something we could 
ever do within a stable release (2.7).

--

___
Python tracker 

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



[issue28306] incorrect output "int division or modulo by zero" in Handling Exceptions tutorial

2016-09-28 Thread Roundup Robot

Roundup Robot added the comment:

New changeset f60396d8f95c by Berker Peksag in branch '3.5':
Issue #28306: Update exception message of ZeroDivisionError
https://hg.python.org/cpython/rev/f60396d8f95c

New changeset e6dcb14829cf by Berker Peksag in branch '3.6':
Issue #28306: Merge from 3.5
https://hg.python.org/cpython/rev/e6dcb14829cf

New changeset ddeeb7d666eb by Berker Peksag in branch 'default':
Issue #28306: Merge from 3.6
https://hg.python.org/cpython/rev/ddeeb7d666eb

--
nosy: +python-dev

___
Python tracker 

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



[issue28306] incorrect output "int division or modulo by zero" in Handling Exceptions tutorial

2016-09-28 Thread Berker Peksag

Berker Peksag added the comment:

Good catch! Thanks for the report.

--
nosy: +berker.peksag
resolution:  -> fixed
stage:  -> resolved
status: open -> closed
versions: +Python 3.6, Python 3.7

___
Python tracker 

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



[issue28281] Remove year limits from calendar

2016-09-28 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Okay, if this is specified by ISO 8601 standard, I think we can extend calendar 
below year 1. But the meaning of non-positive years should be documented. And 
maybe even provide a way to customize the representation of year (this is a 
separate issue).

Standard Unix utilities cal and ncal support only years in range 1...

--

___
Python tracker 

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



[issue28294] HTTPServer server.py assumes sys.stderr != None

2016-09-28 Thread Mariatta Wijaya

Changes by Mariatta Wijaya :


--
nosy: +Mariatta

___
Python tracker 

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



[issue28210] argparse with subcommands difference in python 2.7 / 3.5

2016-09-28 Thread Mariatta Wijaya

Changes by Mariatta Wijaya :


--
nosy: +Mariatta

___
Python tracker 

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



[issue9253] argparse: optional subparsers

2016-09-28 Thread Mariatta Wijaya

Changes by Mariatta Wijaya :


--
nosy: +Mariatta

___
Python tracker 

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



[issue28292] Make Calendar.itermonthdates() behave consistently in edge cases

2016-09-28 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

LGTM. Maybe add also itermonthdays4() that yields 4-tuples (year, month, day, 
day_of_week)? I seen a code that filters out weekends from itermonthdates().

--

___
Python tracker 

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



[issue28148] [Patch] Also stop using localtime() in timemodule

2016-09-28 Thread Roundup Robot

Roundup Robot added the comment:

New changeset c81b9107ec42 by Alexander Belopolsky in branch '3.6':
Issue #28148: Stop using localtime() and gmtime() in the time module.
https://hg.python.org/cpython/rev/c81b9107ec42

--
nosy: +python-dev

___
Python tracker 

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



[issue21903] ctypes documentation MessageBoxA example produces error

2016-09-28 Thread Eryk Sun

Eryk Sun added the comment:

The GetWindowRect example seems fine, for the most part. The docs don't have to 
show it being called. If I were to call it, I'd use GetForegroundWindow to get 
a window handle. GetActiveWindow returns the active window attached to the 
current thread's message queue, but a console application probably doesn't own 
a window. (The console window is owned by conhost.exe.)

A more pressing matter is the GetModuleHandle examples, which need to either be 
fixed or replaced. GetModuleHandle returns a module's base address, and in a 
64-bit process the result could be truncated when returned as the default C int 
type. GetModuleHandleW.restype has to be set to a pointer type. Setting it to a 
Python function, such as the ValidHandle example, has the same truncation 
problem. In general, a ValidHandle checker would have to be implemented as an 
errcheck function.

--

___
Python tracker 

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



[issue28148] [Patch] Also stop using localtime() in timemodule

2016-09-28 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 3afad465b3e1 by Alexander Belopolsky in branch '3.6':
Issue #28148: Added a NEWS entry.
https://hg.python.org/cpython/rev/3afad465b3e1

--

___
Python tracker 

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



[issue27100] Attempting to use class with both __enter__ & __exit__ undefined yields __exit__ attribute error

2016-09-28 Thread Spencer Brown

Spencer Brown added the comment:

Alternatively, SETUP_WITH could additionally check for the other method, and 
raise an AttributeError with a custom message mentioning both methods.

--
nosy: +Spencer Brown

___
Python tracker 

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



[issue28148] [Patch] Also stop using localtime() in timemodule

2016-09-28 Thread Alexander Belopolsky

Changes by Alexander Belopolsky :


--
resolution:  -> fixed
stage: commit review -> 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



  1   2   >