[issue29309] Interpreter hang when interrupting a loop.run_in_executor() future

2017-01-19 Thread Rémi Cardona

Changes by Rémi Cardona :


--
nosy: +RemiCardona

___
Python tracker 

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



[issue29312] Use FASTCALL in dict.update()

2017-01-19 Thread STINNER Victor

STINNER Victor added the comment:

Oops, I forgot a DECREF: fixed in the patch version 2.

--

Oh wait, I misunderstood how dict.update() is called. In fact, they are two 
bytecodes to call a function with keyword arguments.

(1) Using **kwargs:

>>> def f():
...  d.update(**d2)
... 
>>> dis.dis(f)
  2   0 LOAD_GLOBAL  0 (d)
  2 LOAD_ATTR1 (update)
  4 BUILD_TUPLE  0
  6 LOAD_GLOBAL  2 (d2)
  8 CALL_FUNCTION_EX 1
 10 POP_TOP
 12 LOAD_CONST   0 (None)
 14 RETURN_VALUE


(2) Using a list of key=value:

>>> def g():
...  d.update(x=1, y=2)
... 
>>> dis.dis(g)
  2   0 LOAD_GLOBAL  0 (d)
  2 LOAD_ATTR1 (update)
  4 LOAD_CONST   1 (1)
  6 LOAD_CONST   2 (2)
  8 LOAD_CONST   3 (('x', 'y'))
 10 CALL_FUNCTION_KW 2
 12 POP_TOP
 14 LOAD_CONST   0 (None)
 16 RETURN_VALUE


The problem is that the dict.update() method has a single implementation, the C 
dict_update() function.


For (2), there is a speedup, but it's minor:

$ ./python -m perf timeit -s 'd={"x": 1, "y": 2}' 'd.update(x=1, y=2)' -p10 
--compare-to=../default-ref/python 
Median +- std dev: [ref] 185 ns +- 62 ns -> [patched] 177 ns +- 2 ns: 1.05x 
faster (-5%)


For (1), I expected that **kwargs would be unpacked *before* calling 
dict.update(), but kwargs is passed unchanged to dict.update() directly! With 
my patch, CALL_FUNCTION_EX calls PyCFunction_Call() which uses 
_PyStack_UnpackDict() to create kwnames and then dict_update() rebuilds a new 
temporary dictionary. It's completely inefficient! As Raymond expected, it's 
much slower:

haypo@smithers$ ./python -m perf timeit -s 'd={"x": 1, "y": 2}; d2=dict(d)' 
'd.update(**d2)' -p10 --compare-to=../default-ref/python
Median +- std dev: [ref] 114 ns +- 1 ns -> [patched] 232 ns +- 21 ns: 2.04x 
slower (+104%)


I expect that (1) dict.update(**kwargs) is more common than (2) 
dict.update(x=1, y=2). Moreover, the speedup for (2) is low (5%), so I prefer 
to reject this issue.

--

Naoki: "So, when considering METH_FASTCALL, supporting **kwargs is lowest 
priority. (Off course, supporting it by AC with METH_KEYWORDS is nice to have)"

Hum, dict.update() is the first function that I found that really wants a 
Python dict at the end.

For dict1.update(**dict2), METH_VARARGS|METH_KEYWORDS is already optimal.

So I don't think that it's worth it to micro-optimize the way to pass 
positional arguments. The common case is to call dict1.update(dict2) which 
requires to build a temporary tuple of 1 item. PyTuple_New() uses a free list 
for such small tuple, so it should be fast enough.

I found a few functions which pass through keyword arguments, but they are 
"proxy". I'm converting all METH_VARARGS|METH_KEYWORDS to METH_FASTCALL, so 
most functions will expects a kwnames tuple at the end of the call for keyword 
arguments. In this case, using METH_FASTCALL for the proxy is optimum for 
func(x=1, y=2) (CALL_FUNCTION_KW), but slower for func(**kwargs) 
(CALL_FUNCTION_EX).

With METH_FASTCALL, CALL_FUNCTION_EX requires to unpack the dictionary if I 
understood correctly.

--
status: open -> closed
Added file: http://bugs.python.org/file46334/dict_update_fastcall-2.patch

___
Python tracker 

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



[issue28595] shlex.shlex should not augment wordchars

2017-01-19 Thread Evan Andrews

Evan Andrews added the comment:

Attaching an updated patch now that the two linked issues are resolved.

--
Added file: http://bugs.python.org/file46335/shlex2.diff

___
Python tracker 

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



[issue26865] Meta-issue: support of the android platform

2017-01-19 Thread Xavier de Gaye

Xavier de Gaye added the comment:

issue #28180: sys.getfilesystemencoding() should default to utf-8

--
dependencies: +sys.getfilesystemencoding() should default to utf-8

___
Python tracker 

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



[issue29318] Optimize _PyFunction_FastCallDict() for **kwargs

2017-01-19 Thread STINNER Victor

New submission from STINNER Victor:

Example:
---
def func(x, y):
print(x, y)

def proxy2(func, **kw):
func(**kw)

def proxy1(func, **kw):
proxy2(func, **kw)
---

The "proxy2(func, **kw)" call in proxy1() is currently inefficient: 
_PyFunction_FastCallDict() converts the dictionary into a C array [key1, 
value1, key2, value2, ...] and then _PyEval_EvalCodeWithName() rebuilds the 
dictionary from the C array.

Since "func(*args, **kw)" proxies are common in Python, especially to call the 
parent constructor when overriding __init__, I think that it would be 
interesting to optimize this code path.

I first expected that it was a regression of FASTCALL, but Python < 3.6 doesn't 
optimize this code neither.

--
components: Interpreter Core
messages: 285773
nosy: haypo, inada.naoki
priority: normal
severity: normal
status: open
title: Optimize _PyFunction_FastCallDict() for **kwargs
type: performance
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



[issue29312] Use FASTCALL in dict.update()

2017-01-19 Thread STINNER Victor

STINNER Victor added the comment:

When analyzing how FASTCALL handles "func(**kwargs)" calls for Python 
functions, I identified a missed optimization. I created the issue #29318: 
"Optimize _PyFunction_FastCallDict() for **kwargs".

--
resolution:  -> rejected

___
Python tracker 

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



[issue29259] Add tp_fastcall to PyTypeObject: support FASTCALL calling convention for all callable objects

2017-01-19 Thread Roundup Robot

Roundup Robot added the comment:

New changeset bf6728085b01 by Victor Stinner in branch 'default':
_PyStack_AsDict() now checks kwnames != NULL
https://hg.python.org/cpython/rev/bf6728085b01

--

___
Python tracker 

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



[issue29311] Argument Clinic: convert dict methods

2017-01-19 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 00c63ee66e0c by Victor Stinner in branch 'default':
dict.get() and dict.setdefault() now use AC
https://hg.python.org/cpython/rev/00c63ee66e0c

--
nosy: +python-dev

___
Python tracker 

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



[issue29318] Optimize _PyFunction_FastCallDict() for **kwargs

2017-01-19 Thread INADA Naoki

INADA Naoki added the comment:

Since mutating kw dict shouldn't affect caller's dict, caller and callee can't 
share the dict.

One possible optimization is using PyDict_Copy() to copy the dict.
It can reduce number of hash() calls.

--

___
Python tracker 

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



[issue29312] Use FASTCALL in dict.update()

2017-01-19 Thread Roundup Robot

Roundup Robot added the comment:

New changeset e371686229e7 by Victor Stinner in branch 'default':
Add a note explaining why dict_update() doesn't use METH_FASTCALL
https://hg.python.org/cpython/rev/e371686229e7

--
nosy: +python-dev

___
Python tracker 

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



[issue20291] Argument Clinic should understand *args and **kwargs parameters

2017-01-19 Thread STINNER Victor

STINNER Victor added the comment:

Once this feature will be implemented, print() should be modified to use 
Argument Clinic: see the issue #29296.

--

___
Python tracker 

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



[issue29296] convert print() to METH_FASTCALL

2017-01-19 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 0327171f05dd by INADA Naoki in branch 'default':
Issue #29296: convert print() to METH_FASTCALL
https://hg.python.org/cpython/rev/0327171f05dd

--
nosy: +python-dev

___
Python tracker 

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



[issue29296] convert print() to METH_FASTCALL

2017-01-19 Thread STINNER Victor

STINNER Victor added the comment:

I pushed print-fastcall.patch since it's simple and has a significant impact on 
bm_telco benchmark (especially when tp_fastcall slot will be added).

I added a reminder (msg285779) in #20291 to convert print() once AC will 
support **kwargs.

Can we close the issue, or do you prefer to keep it open?

--

___
Python tracker 

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



[issue29318] Optimize _PyFunction_FastCallDict() for **kwargs

2017-01-19 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

> It can reduce number of hash() calls.

Keys are strings (even interned strings), and hashes are cached.

In most cases kw is empty or very small. I doubt any optimization can have 
significant effect.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue29319] Embedded 3.6.0 distribution cannot run pyz files

2017-01-19 Thread Paul Moore

New submission from Paul Moore:

Trying to run a pyz file using the embedded distribution for 3.6.0, I get an 
error "Could not import runpy module".

To reproduce, see below:

>type .\__main__.py
print('Hello, world')
>zip test.pyz __main__.py
  adding: __main__.py (172 bytes security) (stored 0%)
>unzip .\python-3.6.0-embed-amd64.zip
...
>.\python.exe .\test.pyz
Could not import runpy module
ModuleNotFoundError: No module named 'runpy'

Running with the standard interpreter works fine:

>py -V
Python 3.6.0
>py .\test.pyz
Hello, world

--
assignee: steve.dower
components: Windows
messages: 285783
nosy: paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: Embedded 3.6.0 distribution cannot run pyz files
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



[issue29296] convert print() to METH_FASTCALL

2017-01-19 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

> Why can't we start with METH_FASTCALL and convert to AC later?

It increases the maintenance burden. When the fastcall protocol be changed, 
this would require changing more handwritten code.

--

___
Python tracker 

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



[issue29319] Embedded 3.6.0 distribution cannot run pyz files

2017-01-19 Thread Paul Moore

Paul Moore added the comment:

I just checked, and 3.6.0b1 (the only prerelease version I had available) has 
the same problem. 3.5.2 works fine.

I thought I'd had similar code working during the beta cycle, but I can't 
demonstrate that any more, so maybe my recollection is wrong :-(

--

___
Python tracker 

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



[issue29320] bdist_msi install_script fail to execute if alt python location specified

2017-01-19 Thread eszense

New submission from eszense:

if install-script specified and
alternative python location selected during installation,
msiexec will fail with:

"There is a problem with this Windows Installer
package. A program required for this install to
complete could not be run. Contact your support
personnel or package vendor.

This is due to the lack of PythonExeX Custom Action setting
the path to python.exe

Patch attacked for your consideration

--
files: patch.txt
messages: 285786
nosy: eszense
priority: normal
pull_requests: 18
severity: normal
status: open
title: bdist_msi install_script fail to execute if alt python location specified
type: crash
Added file: http://bugs.python.org/file46336/patch.txt

___
Python tracker 

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



[issue29320] bdist_msi install_script fail to execute if alt python location specified

2017-01-19 Thread eszense

Changes by eszense :


--
components: +Distutils
nosy: +dstufft, eric.araujo

___
Python tracker 

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



[issue28911] Clarify the behaviour of assert_called_once_with

2017-01-19 Thread Arne de Laat

Arne de Laat added the comment:

Unfortunately there cant be commas in the method name, that would clarify the 
name. It should be read as 'assert called once, with ...' not 'assert called 
once with ...'.

I have often used the method to test something was called only once, and with 
the specified arguments.

It seems that it is more difficult (i.e. no single method) to check if only one 
call was made with the specified arguments (allowing for more calls with other 
arguments), perhaps that could be added. Something like 
'assert_once_called_with' or 'assert_one_call_with'.

--
nosy: +153957

___
Python tracker 

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



[issue29313] msi by bdist_msi will fail execute install-scripts if space in present in python path

2017-01-19 Thread eszense

eszense added the comment:

This issue can be fixed together with Issue 15797.

Patch attached for your consideration

--
Added file: http://bugs.python.org/file46337/patch.txt

___
Python tracker 

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



[issue29313] msi by bdist_msi will fail execute install-scripts if space in present in python path

2017-01-19 Thread eszense

Changes by eszense :


Removed file: http://bugs.python.org/file46337/patch2.diff

___
Python tracker 

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



[issue29313] msi by bdist_msi will fail execute install-scripts if space in present in python path

2017-01-19 Thread eszense

Changes by eszense :


Added file: http://bugs.python.org/file46338/patch.diff

___
Python tracker 

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



[issue29319] Embedded 3.6.0 distribution cannot run pyz files

2017-01-19 Thread Paul Moore

Paul Moore added the comment:

Confirmed that it works with alpha 2, 3 and 4. But fails with beta 1 and the 
release version.

--

___
Python tracker 

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



[issue29321] Wrong documentation for unicode and str comparison

2017-01-19 Thread RK-5wWm9h

New submission from RK-5wWm9h:

PROBLEM (IN BRIEF):

In the currently published 2.7.13 The Python Language Reference manual, section 
5.9 "Comparisons" 
(https://docs.python.org/2/reference/expressions.html#comparisons):

"If both are numbers, they are converted to a common type. Otherwise, 
objects of different types always compare unequal..."

This an *incorrect (and misleading) statement*.


PROPOSED FIX:

Insert a new sentence, to give this resulting text:

"If both are numbers, they are converted to a common type. If one is str 
and the other unicode, they are compared as below. Otherwise, objects of 
different types always compare unequal..."


DETAILS, JUSTIFICATION, CORRECTNESS, ETC:

The behaviour that a str and a unicode object -- despite being objects of 
different types -- may compare equal, is explicitly stated several paragraphs 
later:

"* Strings are compared lexicographically using the numeric equivalents 
(the result of the built-in function ord()) of their characters. Unicode and 
8-bit strings are fully interoperable in this behavior. [4]"

Text in the 2.7.13 The Python Standard Library (Library Reference manual) is 
careful to cover this unicode - str case 
(https://docs.python.org/2/library/stdtypes.html#comparisons):

"Objects of different types, except different numeric types and different 
string types, never compare equal; such objects are ordered consistently but 
arbitrarily (so that sorting a heterogeneous array yields a consistent result)."


IMPACT AND RELATED BUG:

The current incorrect text is really misleading for anyone reading the Language 
Ref.  It's easy to see the categorical statement and stop reading because your 
question has been answered.

Further, the Library ref about unicode and str (The Python Standard Library 
(Library Reference manual) section 5.6 "Sequence Types": 
https://docs.python.org/2/library/stdtypes.html#sequence-types-str-unicode-list-tuple-bytearray-buffer-xrange),
 links here.  Link text: "(For full details see Comparisons in the language 
reference.)".

(Aside: That paragraph has a mistake similar to this present bug: it says "to 
compare equal, every element must compare equal and the two sequences must be 
of the same type"; I'll file a separate bug for it.)

PS: First time reporting a Python bug; following 
https://docs.python.org/2/bugs.html.  Hope I did ok!  :-)

--
assignee: docs@python
components: Documentation
messages: 285790
nosy: RK-5wWm9h, docs@python
priority: normal
severity: normal
status: open
title: Wrong documentation for unicode and str comparison
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



[issue29322] SimpleCV error on Raspberry Pi

2017-01-19 Thread Michael J

New submission from Michael J:

Hello,
I'm using a Microsoft LifeCam with SimpleCV on the ipython interpreter(or 
shell) on a Raspberry Pi 3 model B(with Raspbian, tell me if you need the exact 
OS version as it's quite complicated). 

I'm following the directions of a book: Raspberry Pi Cookbook by Simon Monk.
I get this error:
SimpleCV:1> c = Camera()

SimpleCV:2> i = c.getImage()

SimpleCV:3> i
SimpleCV:3: 

SimpleCV:4> 

SimpleCV:4> i.show()
---
IOError   Traceback (most recent call last)
/usr/local/lib/python2.7/dist-packages/SimpleCV/Shell/Shell.pyc in ()
> 1 i.show()

/usr/local/lib/python2.7/dist-packages/SimpleCV/ImageClass.pyc in show(self, 
type)
   5445   d = Display(displaytype='notebook')
   5446   else:
-> 5447   d = Display(self.size())
   5448   self.save(d)
   5449   return d

/usr/local/lib/python2.7/dist-packages/SimpleCV/Display.pyc in __init__(self, 
resolution, flags, title, displaytype, headless)
156 if not displaytype == 'notebook':
157 self.screen = pg.display.set_mode(resolution, flags)
--> 158 scvLogo = SimpleCV.Image("simplecv").scale(32,32)
159 pg.display.set_icon(scvLogo.getPGSurface())
160 if flags != pg.FULLSCREEN and flags != pg.NOFRAME:

/usr/local/lib/python2.7/dist-packages/SimpleCV/ImageClass.pyc in 
__init__(self, source, camera, colorSpace, verbose, sample, cv2image)
785 self._bitmap = cv.LoadImage(self.filename, 
iscolor=cv.CV_LOAD_IMAGE_COLOR)
786 except:
--> 787 self._pil = pil.open(self.filename).convert("RGB")
788 self._bitmap = cv.CreateImageHeader(self._pil.size, 
cv.IPL_DEPTH_8U, 3)
789 cv.SetData(self._bitmap, self._pil.tostring())

/usr/local/lib/python2.7/dist-packages/PIL/Image.pyc in open(fp, mode)
   2280 
   2281 if filename:
-> 2282 fp = builtins.open(filename, "rb")
   2283 
   2284 try:

IOError: [Errno 2] No such file or directory: 
'/usr/local/lib/python2.7/dist-packages/SimpleCV/sampleimages/simplecv.png'

I(Michael J or "MJ" as I'm commonly called) have searched for the directory 
myself, and I can tell you, it's not there.

Tell me if you need more information, as I will be glad to assist.

I'm sorry for any inconvenience caused by me using ipython if it's unfamiliar.

--
components: IO
messages: 285791
nosy: MJ
priority: normal
severity: normal
status: open
title: SimpleCV error on Raspberry Pi
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



[issue29323] Wrong documentation (Library) for unicode and str comparison

2017-01-19 Thread RK-5wWm9h

New submission from RK-5wWm9h:

PROBLEM (IN BRIEF):
In the currently published 2.7.13 The Python Standard Library (Library 
Reference manual) section 5.6 "Sequence Types" 
(https://docs.python.org/2/library/stdtypes.html#sequence-types-str-unicode-list-tuple-bytearray-buffer-xrange):

"to compare equal, ... the two sequences must be of the same type"

This an *incorrect (and misleading) statement*, for the unicode and str case.


PROPOSED FIX:

Current full paragraph:

"Sequence types also support comparisons. In particular, tuples and lists 
are compared lexicographically by comparing corresponding elements. This means 
that to compare equal, every element must compare equal and the two sequences 
must be of the same type and have the same length. (For full details see 
Comparisons in the language reference.)"

Proposed replacement text:

"Sequence types also support comparisons. In particular, tuples and lists 
are compared lexicographically by comparing corresponding elements. This means 
that to compare equal, every element must compare equal and the two sequences 
must be of the same type and have the same length. (Unicode and str are treated 
as the same type here; for full details see Comparisons in the language 
reference.)"


DETAILS, JUSTIFICATION, CORRECTNESS, ETC:

The current incorrect text is really misleading.

The behaviour that a str and a unicode object -- despite being objects of 
different types -- may compare equal, is explicitly stated in the 2.7.13 The 
Python Language Reference manual, section 5.9 "Comparisons" 
(https://docs.python.org/2/reference/expressions.html#comparisons):

"* Strings are compared lexicographically using the numeric equivalents 
(the result of the built-in function ord()) of their characters. Unicode and 
8-bit strings are fully interoperable in this behavior. [4]"

(Aside: Incidentally an earlier paragraph in the Language Ref fails to cover 
the unicode and str case; see separately filed bug Issue 29321.)

--
assignee: docs@python
components: Documentation
messages: 285792
nosy: RK-5wWm9h, docs@python
priority: normal
severity: normal
status: open
title: Wrong documentation (Library) for unicode and str comparison
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



[issue29321] Wrong documentation (Language Ref) for unicode and str comparison

2017-01-19 Thread RK-5wWm9h

Changes by RK-5wWm9h :


--
title: Wrong documentation for unicode and str comparison -> Wrong 
documentation (Language Ref) for unicode and str comparison

___
Python tracker 

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



[issue21628] 2to3 does not fix zip in some cases

2017-01-19 Thread Stuart Berg

Stuart Berg added the comment:

Already closed, but FWIW, I think this was incorrectly marked as a duplicate.  
Issue 20742 discusses a different issue related to lib2to3 and zip.

Meanwhile, this issue has been raised again in 28837, so I will continue the 
discussion there.  (I have a patch.)

--
nosy: +stuarteberg

___
Python tracker 

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



[issue29324] test_aead_aes_gcm fails on Kernel 4.9

2017-01-19 Thread Christian Heimes

New submission from Christian Heimes:

$ ./python -m test -m test_aead_aes_gcm test_socket
Run tests sequentially
0:00:00 [1/1] test_socket
test test_socket failed -- Traceback (most recent call last):
  File "/home/heimes/dev/python/cpython/Lib/test/support/__init__.py", line 
556, in wrapper
return func(*args, **kw)
  File "/home/heimes/dev/python/cpython/Lib/test/test_socket.py", line 5515, in 
test_aead_aes_gcm
res = op.recv(assoclen + len(plain) + taglen)
OSError: [Errno 22] Invalid argument

The tests were written and passed under Linux Kernel 4.7. I was under the 
assumption that the API is stable. But the most recent version 4.9 has changed 
the API for AEAD mode slightly. libkcapi project maintain a well written 
documentation of the Kernel crypto API,
https://github.com/smuellerDD/libkcapi/commit/be242c387b7030cbccae2c183107efa86d9a3cd6

Fedora 24 and 25 are affected. I'm going to update the tests. Downstream 
distributors: Feel free to disable the test in the mean time. The feature is 
not critical.

--
assignee: christian.heimes
components: Extension Modules
messages: 285794
nosy: christian.heimes
priority: normal
severity: normal
status: open
title: test_aead_aes_gcm fails on Kernel 4.9
type: behavior
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



[issue29322] SimpleCV error on Raspberry Pi

2017-01-19 Thread Xiang Zhang

Xiang Zhang added the comment:

Hi Michael, this bug tracker is meant for developing CPython. Your problem 
exists in your own codes or third party applications. You'd better report to 
the related parties.

--
nosy: +xiang.zhang
resolution:  -> third party
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



[issue29324] test_aead_aes_gcm fails on Kernel 4.9

2017-01-19 Thread Charalampos Stratakis

Changes by Charalampos Stratakis :


--
nosy: +cstratak

___
Python tracker 

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



[issue28837] 2to3 does not wrap zip correctly

2017-01-19 Thread Stuart Berg

Stuart Berg added the comment:

In addition to zip(), this problem also affects map() and filter().

The problem is that the match patterns in FixZip, FixMap, and FixFilter do not 
allow for more than one "trailer" node.  (And even if they did, their 
transform() methods aren't expecting it.)

For example, in the following expression, 'zip' is followed by two 'trailers', 
which are '(a,b)', and [0]:

zip(a,b)[0]

... but FixZip.PATTERN only expects a single trailer (the argument list), so 
the presence of a second trailer prevents the match: https://git.io/vMDP9


(Here's the relevant line of the grammar: https://git.io/vMDPJ)

I've written a patch that fixes this problem for zip, map, and filter, with 
tests.  See attached.

BTW, this problem was previously reported in 21628, but that issue was 
incorrectly closed as a duplicate, so I'm submitting my patch here.

--
keywords: +patch
nosy: +stuarteberg
Added file: http://bugs.python.org/file46339/fix-28837.patch

___
Python tracker 

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



[issue20186] Derby #18: Convert 31 sites to Argument Clinic across 23 files

2017-01-19 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 3713f7de576d by Serhiy Storchaka in branch 'default':
Issue #20186: Converted the _operator module to Argument Clinic.
https://hg.python.org/cpython/rev/3713f7de576d

--

___
Python tracker 

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



[issue29324] test_aead_aes_gcm fails on Kernel 4.9

2017-01-19 Thread Christian Heimes

Christian Heimes added the comment:

recv(64) works. I need to figure out why 64 and what's in the extra bytes.

--

___
Python tracker 

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



[issue29319] Embedded 3.6.0 distribution cannot run pyz files

2017-01-19 Thread Steve Dower

Steve Dower added the comment:

Does running with -v provide any more hints?

I'm also interested in whether the alphas work when you don't have a full 
install on the same machine. PC/getpathp.c changed for b1. But that's probably 
less important.

Perhaps runpy just never made it into the python36.zip file?

--

___
Python tracker 

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



[issue20186] Derby #18: Convert 31 sites to Argument Clinic across 23 files

2017-01-19 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

The only change I made is used the return converter in length_hint().

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



[issue29319] Embedded 3.6.0 distribution cannot run pyz files

2017-01-19 Thread Paul Moore

Paul Moore added the comment:

Sorry I should have thought of trying -v. The output (included below) doesn't 
seem to offer many hints, though. runpy.pyc is in python36.zip, I checked that.

I'll see if I can find a machine without Python installed to test that case.

>.\python.exe -v .\test.pyz
import _frozen_importlib # frozen
import _imp # builtin
import sys # builtin
import '_warnings' # 
import '_thread' # 
import '_weakref' # 
import '_frozen_importlib_external' # 
import '_io' # 
import 'marshal' # 
import 'nt' # 
import _thread # previously loaded ('_thread')
import '_thread' # 
import _weakref # previously loaded ('_weakref')
import '_weakref' # 
import 'winreg' # 
# installing zipimport hook
import 'zipimport' # 
# installed zipimport hook
# zipimport: found 609 names in 'C:\\Work\\Scratch\\test\\python36.zip'
import 'zlib' # 
# zipimport: zlib available
# zipimport: zlib available
# zipimport: zlib available
# zipimport: zlib available
import '_codecs' # 
import codecs # loaded from Zip C:\Work\Scratch\test\python36.zip\codecs.pyc
# zipimport: zlib available
# zipimport: zlib available
import encodings.aliases # loaded from Zip 
C:\Work\Scratch\test\python36.zip\encodings\aliases.pyc
import encodings # loaded from Zip 
C:\Work\Scratch\test\python36.zip\encodings\__init__.pyc
# zipimport: zlib available
# zipimport: zlib available
import encodings.utf_8 # loaded from Zip 
C:\Work\Scratch\test\python36.zip\encodings\utf_8.pyc
import '_signal' # 
# zipimport: zlib available
# zipimport: zlib available
import encodings.latin_1 # loaded from Zip 
C:\Work\Scratch\test\python36.zip\encodings\latin_1.pyc
# zipimport: zlib available
# zipimport: zlib available
# zipimport: zlib available
# zipimport: zlib available
# zipimport: zlib available
# zipimport: zlib available
import _weakrefset # loaded from Zip 
C:\Work\Scratch\test\python36.zip\_weakrefset.pyc
import abc # loaded from Zip C:\Work\Scratch\test\python36.zip\abc.pyc
import io # loaded from Zip C:\Work\Scratch\test\python36.zip\io.pyc
Python 3.6.0 (v3.6.0:41df79263a11, Dec 23 2016, 08:06:12) [MSC v.1900 64 bit 
(AMD64)] on win32
# zipimport: zlib available
# zipimport: zlib available
import encodings.cp437 # loaded from Zip 
C:\Work\Scratch\test\python36.zip\encodings\cp437.pyc
# zipimport: found 1 names in '.\\test.pyz'
Could not import runpy module
Traceback (most recent call last):
  File "", line 961, in _find_and_load
  File "", line 948, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'runpy'
# clear builtins._
# clear sys.path
# clear sys.argv
# clear sys.ps1
# clear sys.ps2
# clear sys.last_type
# clear sys.last_value
# clear sys.last_traceback
# clear sys.path_hooks
# clear sys.path_importer_cache
# clear sys.meta_path
# clear sys.__interactivehook__
# clear sys.flags
# clear sys.float_info
# restore sys.stdin
# restore sys.stdout
# restore sys.stderr
# cleanup[2] removing builtins
# cleanup[2] removing sys
# cleanup[2] removing _frozen_importlib
# cleanup[2] removing _imp
# cleanup[2] removing _warnings
# cleanup[2] removing _thread
# cleanup[2] removing _weakref
# cleanup[2] removing _frozen_importlib_external
# cleanup[2] removing _io
# cleanup[2] removing marshal
# cleanup[2] removing nt
# cleanup[2] removing winreg
# cleanup[2] removing zipimport
# cleanup[2] removing zlib
# cleanup[2] removing encodings
# destroy encodings
# cleanup[2] removing codecs
# cleanup[2] removing _codecs
# cleanup[2] removing encodings.aliases
# cleanup[2] removing encodings.utf_8
# cleanup[2] removing _signal
# cleanup[2] removing __main__
# destroy __main__
# cleanup[2] removing encodings.latin_1
# cleanup[2] removing io
# destroy io
# cleanup[2] removing abc
# destroy abc
# cleanup[2] removing _weakrefset
# destroy _weakrefset
# cleanup[2] removing encodings.cp437
# destroy zipimport
# destroy zlib
# destroy _signal
# cleanup[3] wiping _frozen_importlib
# destroy _frozen_importlib_external
# cleanup[3] wiping _imp
# cleanup[3] wiping _warnings
# cleanup[3] wiping _thread
# cleanup[3] wiping _weakref
# cleanup[3] wiping _io
# cleanup[3] wiping marshal
# cleanup[3] wiping nt
# cleanup[3] wiping winreg
# cleanup[3] wiping codecs
# cleanup[3] wiping _codecs
# cleanup[3] wiping encodings.aliases
# cleanup[3] wiping encodings.utf_8
# cleanup[3] wiping encodings.latin_1
# cleanup[3] wiping encodings.cp437
# cleanup[3] wiping sys
# cleanup[3] wiping builtins
# destroy _imp
# destroy io
# destroy _warnings
# destroy marshal
# destroy nt
# destroy _thread
# destroy _weakref
# destroy winreg
# destroy _frozen_importlib

--

___
Python tracker 

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



[issue20186] Derby #18: Convert 31 sites to Argument Clinic across 23 files

2017-01-19 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 112f27b8c8ea by Serhiy Storchaka in branch 'default':
Issue #20186: Converted the math module to Argument Clinic.
https://hg.python.org/cpython/rev/112f27b8c8ea

--

___
Python tracker 

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



[issue20186] Derby #18: Convert 31 sites to Argument Clinic across 23 files

2017-01-19 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

issue20186.mathmodule.v2.patch needed just synchronizing docstrings.

--

___
Python tracker 

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



[issue12067] Doc: remove errors about mixed-type comparisons.

2017-01-19 Thread Martin Panter

Changes by Martin Panter :


--
dependencies: +Wrong documentation (Language Ref) for unicode and str comparison

___
Python tracker 

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



[issue29325] pysqlite: Evaluate removal of sqlite3_stmt_readonly

2017-01-19 Thread Brian Vandenberg

New submission from Brian Vandenberg:

I'm not sure where to request changes to pysqlite, so my apologies if this 
isn't the right place.

To begin with: I'll either end up building a newer version of sqlite myself or 
just accepting that pysqlite won't be part of this python installation.  
However, I thought it might be useful to know that use of the function 
"sqlite3_stmt_readonly" is the only thing tying pysqlite to the current minimum 
requirement to use sqlite 3.7.4.

The currently available 'supported' version of sqlite for RHEL6 is 3.6.x and 
there's likely others out there who (for whatever reason) are stuck on an older 
release of sqlite and moving to the latest & greatest OS isn't [currently] 
feasible.

--
components: Extension Modules
messages: 285804
nosy: phantal
priority: normal
severity: normal
status: open
title: pysqlite: Evaluate removal of sqlite3_stmt_readonly
type: enhancement

___
Python tracker 

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



[issue29321] Wrong documentation (Language Ref) for unicode and str comparison

2017-01-19 Thread Martin Panter

Martin Panter added the comment:

The Python 3 version of this was rewritten in Issue 12067. It would be good to 
port the new text to the Python 2 version, although that is not straightforward 
because of various differences between Python 2 and 3.

That doesn’t rule out making smaller more specific edits in the mean time. 
However your proposal still seems misleading to only mention str and unicode as 
special cases. It does not allow for str vs bytearray, set vs frozenset, or 
custom classes/types implementing their own __eq__() etc methods.

--
nosy: +martin.panter

___
Python tracker 

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



[issue20186] Derby #18: Convert 31 sites to Argument Clinic across 23 files

2017-01-19 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

issue20186.enumobject.patch LGTM too.

--

___
Python tracker 

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



[issue20186] Derby #18: Convert 31 sites to Argument Clinic across 23 files

2017-01-19 Thread Roundup Robot

Roundup Robot added the comment:

New changeset e3db9bccff3f by Serhiy Storchaka in branch 'default':
Issue #20186: Converted builtins enumerate() and reversed() to Argument Clinic.
https://hg.python.org/cpython/rev/e3db9bccff3f

--

___
Python tracker 

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



[issue20186] Derby #18: Convert 31 sites to Argument Clinic across 23 files

2017-01-19 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Sorry for committing patches for you Tal, but they were hanging so long time.

--

___
Python tracker 

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



[issue29326] Blank lines in ._pth file are not ignored

2017-01-19 Thread Steve Dower

New submission from Steve Dower:

If a python._pth file includes a blank line, it gets treated as '\n' which is 
then appended to the directory and used as an entry in sys.path.

Empty lines should be ignored completely.

--
components: Windows
messages: 285809
nosy: paul.moore, steve.dower, tim.golden, zach.ware
priority: low
severity: normal
stage: needs patch
status: open
title: Blank lines in ._pth file are not ignored
type: behavior
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



[issue13886] readline-related test_builtin failure

2017-01-19 Thread Xavier de Gaye

Xavier de Gaye added the comment:

With input-readline.v3.patch, test_builtin runs with success on Android api 21.

With pep538_coerce_legacy_c_locale_v4.diff that implements PEP 538 in issue 
28180, and with input-readline.v3.patch modified to have 'readline_encoding = 
locale.getpreferredencoding()' even when 'is_android' is True, test_builtin 
runs with success. This means that no specific Android handling would be needed 
if PEP 538 were to be adopted.

The new input-readline.v4.patch is a slight improvement over the previous patch 
and sets readline_encoding to 'UTF-8' on Android when test_builtin is run with 
the environment variable LANG set to 'en_US.UTF-8' and in that case the test 
exercises all the code paths including those with the readline module.  This is 
because locale.getdefaultlocale() returns ('en_US', 'UTF-8') on Android in that 
case and because both getdefaultlocale() and readline scan the environment to 
check for the locale.  This new patch is only useful if tests on Android are 
expected to be run also with one of the locale environment variables set to 
UTF-8 (and PEP 538 is rejected).

I have left some comments on Rietveld.

--
Added file: http://bugs.python.org/file46340/input-readline.v4.patch

___
Python tracker 

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



[issue29319] Embedded 3.6.0 distribution cannot run pyz files

2017-01-19 Thread Steve Dower

Steve Dower added the comment:

I just tried it and it makes no difference.

Omitting the "._pth" file seems to fix it, but apart from issue29326 (benign) 
sys.path is fine.

Still digging, but don't worry about testing on other machines.

--

___
Python tracker 

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



[issue29311] Argument Clinic: convert dict methods

2017-01-19 Thread Roundup Robot

Roundup Robot added the comment:

New changeset fe1d83fe29d6 by Serhiy Storchaka in branch 'default':
Issue #29311: Argument Clinic generates reasonable name for the parameter 
"default".
https://hg.python.org/cpython/rev/fe1d83fe29d6

--

___
Python tracker 

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



[issue29311] Argument Clinic: convert dict methods

2017-01-19 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

There are same problems with docstrings as in OrderedDict. The name "D" is not 
defined.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue29319] Embedded 3.6.0 distribution cannot run pyz files

2017-01-19 Thread Steve Dower

Steve Dower added the comment:

Found it in Modules/main.c in RunMainFromImporter():

/* argv0 is usable as an import source, so put it in sys.path[0]
   and import __main__ */
sys_path = PySys_GetObject("path");
if (sys_path == NULL) {
PyErr_SetString(PyExc_RuntimeError, "unable to get sys.path");
goto error;
}
if (PyList_SetItem(sys_path, 0, argv0)) {
argv0 = NULL;
goto error;
}
Py_INCREF(argv0);

When running with a ._pth file, we force the -I option, which removes the empty 
entry at sys.path[0]. Instead, it becomes the path to the .zip file with the 
standard library, so when RunMainFromImporter overwrites it blindly, it's 
cutting out the only hope it has of finding runpy.

You can see this in a normal install by doing:

py -I -c "import sys; print(sys.path)"
[correct output]

py -Ii test.pyz
[output from test.pyz]
>>> import sys; sys.path
[incorrect output]

So we need to stop blindly overwriting sys.path[0] here. I'm not sure what the 
best approach would be, but maybe Nick has a preference? Perhaps we should pass 
the zip file path into runpy._run_module_as_main so it can initialize __path__ 
with it rather than making a global change? Or maybe an insert rather than a 
set is the right way and I'm over-thinking this.

--
assignee: steve.dower -> 
nosy: +ncoghlan
stage:  -> needs patch
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



[issue29323] Wrong documentation (Library) for unicode and str comparison

2017-01-19 Thread R. David Murray

R. David Murray added the comment:

Unicode and string *are* of the same type: basestring.  This is a specific 
example of the liskov substitution principle, so I don't think it should be 
called out explicitly in this section.

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



[issue29323] Wrong documentation (Library) for unicode and str comparison

2017-01-19 Thread R. David Murray

R. David Murray added the comment:

As per your other issue, though, the real issue is that the two objects must be 
*comparable*, not that they be of the same type, and the language should 
probably be updated to reflect that.

--

___
Python tracker 

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



[issue29311] Argument Clinic: convert dict methods

2017-01-19 Thread STINNER Victor

STINNER Victor added the comment:

> Argument Clinic generates reasonable name for the parameter "default".
> -default as failobj: object = None
> +default: object = None

Thanks, that's a better name :-)

FYI I wanted to limit changes when converting to AC, the change is already big 
enough and hard to review.

--

___
Python tracker 

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



[issue29327] SystemError in sorted(iterable=[])

2017-01-19 Thread Serhiy Storchaka

New submission from Serhiy Storchaka:

In Python 3.6:

>>> sorted(iterable=[])
Traceback (most recent call last):
  File "", line 1, in 
SystemError: Objects/tupleobject.c:81: bad argument to internal function

In Python 3.5 and 2.7:

>>> sorted(iterable=[])
Traceback (most recent call last):
  File "", line 1, in 
TypeError: 'iterable' is an invalid keyword argument for this function

--
components: Interpreter Core
keywords: 3.6regression
messages: 285817
nosy: serhiy.storchaka
priority: normal
severity: normal
status: open
title: SystemError in sorted(iterable=[])
type: behavior
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



[issue29311] Argument Clinic: convert dict methods

2017-01-19 Thread STINNER Victor

STINNER Victor added the comment:

> There are same problems with docstrings as in OrderedDict. The name "D" is 
> not defined.

I copied the old docstring to AC.

Python 3.6 doc:
---
get(...)
D.get(k[,d]) -> D[k] if k in D, else d.  d defaults to None.
---

D was already implicitly "self".


Python 3.7 (new) doc:
---
get(self, key, default=None, /)
D.get(key[, default]) -> D[key] if key in D, else default.
---

What do you propose? Use self?

--

___
Python tracker 

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



[issue28837] 2to3 does not wrap zip correctly

2017-01-19 Thread Stuart Berg

Changes by Stuart Berg :


Removed file: http://bugs.python.org/file46339/fix-28837.patch

___
Python tracker 

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



[issue29289] Convert OrderedDict methods to Argument Clinic

2017-01-19 Thread Roundup Robot

Roundup Robot added the comment:

New changeset c144bf6c0ff7 by Serhiy Storchaka in branch 'default':
Issue #29289: Argument Clinic generates reasonable name for the parameter 
"default".
https://hg.python.org/cpython/rev/c144bf6c0ff7

--

___
Python tracker 

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



[issue28837] 2to3 does not wrap zip correctly

2017-01-19 Thread Stuart Berg

Changes by Stuart Berg :


Added file: http://bugs.python.org/file46341/fix-28837.patch

___
Python tracker 

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



[issue29311] Argument Clinic: convert dict methods

2017-01-19 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

There was a context in old docstrings removed in new docstrings.

It is not always possible just to copy docstrings in Argument Clinic. Sometimes 
rewriting docstrings is the hardest part of converting to Argument Clinic.

I suggest either restore the context that defines D, or better totally rewrite 
docstrings, getting the wording from the documentation.

--

___
Python tracker 

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



[issue29319] Embedded 3.6.0 distribution cannot run pyz files

2017-01-19 Thread Paul Moore

Paul Moore added the comment:

Nice! Thanks for finding this. I don't suppose there's any chance this would 
qualify as a bugfix for 3.6.1? I've been holding off on working on 
https://github.com/pfmoore/pylaunch until 3.6 because 3.5 doesn't handle being 
in a subdirectory very well. It'd be a shame if this meant I could only really 
support 3.7+

But it is a pretty minor use case, so I'll live either way.

FWIW, I'm inclined to think we shouldn't be blindly overwriting things, at the 
very least we should check that what we're overwriting is what we expect. But 
my knowledge of this part of the interpreter is pretty much zero, so I'll defer 
to the experts.

--

___
Python tracker 

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



[issue28837] 2to3 does not wrap zip correctly

2017-01-19 Thread Stuart Berg

Stuart Berg added the comment:

Sorry for re-uploading the patch; I made some pep8 fixes.

--
Added file: http://bugs.python.org/file46342/fix-28837.patch

___
Python tracker 

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



[issue28837] 2to3 does not wrap zip correctly

2017-01-19 Thread Stuart Berg

Changes by Stuart Berg :


Removed file: http://bugs.python.org/file46341/fix-28837.patch

___
Python tracker 

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



[issue29316] Can we keep typing.py provisional for the duration of the Python 3.6 release cycle?

2017-01-19 Thread Brett Cannon

Brett Cannon added the comment:

Keeping it provisional sounds reasonable to me, especially if it helps land 
protocol support.

--
nosy: +brett.cannon

___
Python tracker 

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



[issue29319] Embedded 3.6.0 distribution cannot run pyz files

2017-01-19 Thread Steve Dower

Steve Dower added the comment:

I'd say it definitely qualifies as a bug fix, even in 3.5 (which repros), 
assuming we don't break any existing APIs in the process.

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



[issue28837] 2to3 does not wrap zip correctly

2017-01-19 Thread Stuart Berg

Changes by Stuart Berg :


Removed file: http://bugs.python.org/file46342/fix-28837.patch

___
Python tracker 

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



[issue28837] 2to3 does not wrap zip correctly

2017-01-19 Thread Stuart Berg

Changes by Stuart Berg :


Added file: http://bugs.python.org/file46343/fix-28837.patch

___
Python tracker 

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



[issue2771] Test issue

2017-01-19 Thread Brett Cannon

Changes by Brett Cannon :


--
pull_requests: +19

___
Python tracker 

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



[issue29327] SystemError in sorted(iterable=[])

2017-01-19 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Seems this regression was introduced in issue27809.

--

___
Python tracker 

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



[issue29327] SystemError in sorted(iterable=[])

2017-01-19 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

In debug build Python is crashed.

>>> sorted(iterable=[])
python: Objects/abstract.c:2317: _PyObject_FastCallDict: Assertion `nargs >= 0' 
failed.
Aborted (core dumped)

--
type: behavior -> crash

___
Python tracker 

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



[issue29328] struct module should support variable-length strings

2017-01-19 Thread Elizabeth Myers

New submission from Elizabeth Myers:

There was some discussion on python-ideas about this, and I figured it would be 
more productive to bring it here since to me this appears to be a glaring 
omission.

The struct module has no capability to support variable-length strings; this 
includes null-terminated and Pascal-ish strings with a different integer 
datatype (usually in binary) specifying length.

This unfortunate omission makes the struct module extremely unwieldy to use in 
situations where you need to unpack a lot of variable-length strings, 
especially iteratively; see 
https://mail.python.org/pipermail/python-ideas/2017-January/044328.html for 
why. For zero-terminated strings, it is essentially impossible.

It's worth noting many modern protocols use variable-length strings, including 
DHCP.

I therefore propose the following extensions to the struct module (details can 
be bikeshedded over :P):

- Z (uppercase) format specifier (I did not invent this idea, see 
https://github.com/stendec/netstruct - although that uses $), which states the 
preceding whole-number datatype is the length of a string that follows.
- z (lowercase) format specifier, which specifies a null-terminated (also known 
as C style) string. An optional length parameter can be added to specify the 
maximum search length.

These two additions will make the struct module much more usable in a wider 
variety of contexts.

--
components: Library (Lib)
messages: 285828
nosy: Elizacat
priority: normal
severity: normal
status: open
title: struct module should support variable-length strings
type: enhancement
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



[issue29327] SystemError or crash in sorted(iterable=[])

2017-01-19 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Proposed patch fixes the bug.

--
keywords: +patch
nosy: +haypo
stage:  -> patch review
title: SystemError in sorted(iterable=[]) -> SystemError or crash in 
sorted(iterable=[])
Added file: http://bugs.python.org/file46344/sorted.diff

___
Python tracker 

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



[issue29328] struct module should support variable-length strings

2017-01-19 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Could you provide some examples of using these format specifiers? I suppose 
that due to limitations of the struct module the way in which they can be 
implemented would be not particularly useful for you.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue13285] signal module ignores external signal changes

2017-01-19 Thread Thomas Kluyver

Thomas Kluyver added the comment:

I'd like to make the case for a fix in the code again. Our use case is, I 
believe, the same as Vilya's. We want to temporarily set a signal handler from 
Python and then restore the previous handler. This is fairly straightforward 
for Python handler functions, and SIG_DFL and SIG_IGN, but it breaks if 
anything has set a C level signal handler.

The opaque wrapper object is a solution that had occurred to me too. Another 
option would be a context manager implemented in C (I assume context managers 
can be written in C) which can set one or more signal handlers on entry, and 
restore them on exit.

--
nosy: +takluyver

___
Python tracker 

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



[issue29329] Incorrect documentation for custom `hex()` support on Python 2

2017-01-19 Thread Pekka Klärck

New submission from Pekka Klärck:

Documentation of `hex()` on Python 2 says that custom objects need to implement 
`__index__` to support it. Based on my tests that doesn't work but `__hex__` is 
needed instead. Docs are at 
https://docs.python.org/2/library/functions.html?highlight=hex#hex and here's 
an example session:

Python 2.7.6 (default, Oct 26 2016, 20:30:19) 
[GCC 4.8.4] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> class Hex(object):
... def __index__(self):
... return 255
... 
>>> hex(Hex())
Traceback (most recent call last):
  File "", line 1, in 
TypeError: hex() argument can't be converted to hex
>>> 
>>> class Hex(object):
... def __hex__(self):
... return hex(255)
... 
>>> hex(Hex())
'0xff'


 
Assuming this is fixed, should probably note that with Python 3 you actually 
*need* to implement `__index__` and `__hex__` has no effect.

--
messages: 285832
nosy: pekka.klarck
priority: normal
severity: normal
status: open
title: Incorrect documentation for custom `hex()` support on Python 2

___
Python tracker 

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



[issue29328] struct module should support variable-length strings

2017-01-19 Thread Ethan Furman

Changes by Ethan Furman :


--
nosy: +ethan.furman

___
Python tracker 

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



[issue20186] Derby #18: Convert 31 sites to Argument Clinic across 23 files

2017-01-19 Thread Tal Einat

Tal Einat added the comment:

Serhiy, no apology is required. On the contrary, thank you for the taking the 
time to review this and commit, I don't have time available for this these days.

--

___
Python tracker 

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



[issue29328] struct module should support variable-length strings

2017-01-19 Thread Mark Dickinson

Mark Dickinson added the comment:

IMO, as one of the previous maintainers of the struct module, this feature 
request isn't compatible with the current design and purpose of the struct 
module. I agree that there's an important problem to solve (and one I've had to 
solve many times for various formats in consulting work); it's simply that the 
struct module isn't the right place to solve it.

--
nosy: +mark.dickinson

___
Python tracker 

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



[issue29329] Incorrect documentation for custom `hex()` support on Python 2

2017-01-19 Thread Eryk Sun

Eryk Sun added the comment:

Python 3 uses __index__ for bin(), oct(), and hex(), but Python 2 only uses 
__index__ for bin() and otherwise uses __oct__ and __hex__. Antoine overlooked 
this when updating the 2.7 docs for hex() in issue 16665.

--
nosy: +eryksun

___
Python tracker 

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



[issue29282] Fused multiply-add: proposal to add math.fma()

2017-01-19 Thread Mark Dickinson

Mark Dickinson added the comment:

Serhiy, Victor: thanks for the reviews. Here's a new patch. Differences w.r.t. 
the old one:

- Converted to argument clinic.
- Updated docstring to talk about special cases.
- More tests, as suggested by Serhiy.
- whatsnew entry and ..versionadded in docs.

--

___
Python tracker 

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



[issue29282] Fused multiply-add: proposal to add math.fma()

2017-01-19 Thread Mark Dickinson

Mark Dickinson added the comment:

Whoops; looks like I failed to attach the updated patch. Here it is.

--
Added file: http://bugs.python.org/file46345/math_fma2.patch

___
Python tracker 

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



[issue29329] Incorrect documentation for custom `hex()` support on Python 2

2017-01-19 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
assignee:  -> docs@python
components: +Documentation
keywords: +easy
nosy: +docs@python
stage:  -> needs patch
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



[issue29282] Fused multiply-add: proposal to add math.fma()

2017-01-19 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Have you missed the patch?

--

___
Python tracker 

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



[issue29282] Fused multiply-add: proposal to add math.fma()

2017-01-19 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


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

___
Python tracker 

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



[issue29282] Fused multiply-add: proposal to add math.fma()

2017-01-19 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

LGTM except that lines in What's New are too long.

--
assignee:  -> mark.dickinson
stage: patch review -> commit review

___
Python tracker 

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



[issue29282] Fused multiply-add: proposal to add math.fma()

2017-01-19 Thread Mark Dickinson

Mark Dickinson added the comment:

> lines in What's New are too long.

Thanks. Fixed (I think). I'm not sure what the limit is, but the lines are now 
all <= 79 characters long.

--
Added file: http://bugs.python.org/file46346/math_fma3.patch

___
Python tracker 

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



[issue29282] Fused multiply-add: proposal to add math.fma()

2017-01-19 Thread Mark Dickinson

Mark Dickinson added the comment:

Ah, the dev guide says 80 characters. 
(https://docs.python.org/devguide/documenting.html)

--

___
Python tracker 

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



[issue13285] signal module ignores external signal changes

2017-01-19 Thread R. David Murray

R. David Murray added the comment:

IMO the signal handler context manager would be useful (I have existing code 
where I wrote one that didn't quite work right :).  I suggest you propose this 
on python-ideas.

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



[issue29282] Fused multiply-add: proposal to add math.fma()

2017-01-19 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Then LGTM unconditionally.

--

___
Python tracker 

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



[issue29282] Fused multiply-add: proposal to add math.fma()

2017-01-19 Thread Mark Dickinson

Mark Dickinson added the comment:

Thanks, Serhiy. I'm going to hold off committing this for 24 hours or so, 
because I want to follow the buildbots when I do (and I don't have time for 
that right now). I wouldn't be at all surprised to see platform-specific test 
failures.

--

___
Python tracker 

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



[issue29311] Argument Clinic: convert dict methods

2017-01-19 Thread Martin Panter

Martin Panter added the comment:

D.get(key[, default]) -> D[key] if key in D, else default.

There is no big problem with that. D is defined at the start. The only thing I 
would have suggested is avoid using square brackets to mean two things in the 
one expression. Since it is no longer the signature, calling with both 
parameters should be okay:

'''
get($self, key, default=None, /)
--
D.get(key, default) -> D[key] if key in D, else default.
'''

However the other method no longer defines D:

'''
setdefault($self, key, default=None, /)
--
D.get(key,default), also set D[key]=default if key not in D.
'''

You could restore the initial text as “D.setdefault(key,default) ->”, or maybe 
rewrite it like

“Like get(), but also insert the default value if it is missing.”

--
nosy: +martin.panter

___
Python tracker 

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



[issue29328] struct module should support variable-length strings

2017-01-19 Thread Ethan Furman

Ethan Furman added the comment:

>From Yury Selivanov:
---
This is a neat idea, but this will only work for parsing framed
binary protocols.  For example, if you protocol prefixes all packets
with a length field, you can write an efficient read buffer and
use your proposal to decode all of message's fields in one shot.
Which is good.

Not all protocols use framing though.  For instance, your proposal
won't help to write Thrift or Postgres protocols parsers.

Overall, I'm not sure that this is worth the hassle.  With proposal:

   data, = struct.unpack('!H$', buf)
   buf = buf[2+len(data):]

with the current struct module:

   len, = struct.unpack('!H', buf)
   data = buf[2:2+len]
   buf = buf[2+len:]

Another thing: struct.calcsize won't work with structs that use
variable length fields.

--

___
Python tracker 

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



[issue29296] convert print() to METH_FASTCALL

2017-01-19 Thread STINNER Victor

STINNER Victor added the comment:

Serhiy Storchaka:
> When the fastcall protocol be changed, this would require changing more 
> handwritten code.

I don't plan to modify the fastcall protocol. I'm not sure that it's
really possible to modify it anymore. It would probably be simpler to
add a new protocol. But it may become a little bit annoying to have to
support so many calling convention :-) So someone should come up with
a serious rationale to add another one :-)

I tried to make fastcall as private as possible, but recently I
noticed that METH_FASTCALL is now public in Python 3.6 API (but
hopefully excluded from the stable ABI). I know that it's already used
by Cython since 0.25:
https://mail.python.org/pipermail/cython-devel/2016-October/004959.html

About the maintenance burden, I'm ok to handle it :-) My final goal is
to use Argument Clinic everywhere. While converting existing code to
AC is a slow process, I consider (from my recent experiences with AC)
that the new code is easier to maintain! It's a slow process beause AC
still has limitaitons, but also because it's used an opportunity to
review (and enhance!) the existing docstrings.

--

___
Python tracker 

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



[issue29327] SystemError or crash in sorted(iterable=[])

2017-01-19 Thread Raymond Hettinger

Raymond Hettinger added the comment:

Please be careful with all of these AC changes.  They need to have tests.  They 
need to not change APIs.  They need to not introduce bugs.  The whole effort 
seems to be being pushed forward in a cavalier and aggressive manner.

In this case, there was an API change and bugs introduced for basically zero 
benefit.

--
nosy: +rhettinger
priority: normal -> high

___
Python tracker 

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



[issue29327] SystemError or crash in sorted(iterable=[])

2017-01-19 Thread STINNER Victor

STINNER Victor added the comment:

Oh, this issue is very subtle.

Since the list.sorted() class method became a builtin sorted() method (Python 
2.4.0, change c06b570adf12 by Raymond Hettinger), the sorted() function accepts 
an iterable as a keyword argument, whereas list.sort() doesn't. 
sorted(iterable=[]) fails on calling internally list.sort(iterable=[]), not 
when sorted() parses its arguments.

The change 6219aa966a5f (issue #20184) converted sorted() to Argument Clinic. 
This change was released in Python 3.5.3 and 3.6.0... but it didn't introduce 
the bug. It's not the fault of Argument Clinic!

The change b34d2ef5c412 (issue #27809) replacing METH_VARARGS|METH_KEYWORDS 
with METH_FASTCALL didn't introduce the bug neither.

It's the change 15eab21bf934 (issue #27809) which replaced 
PyEval_CallObjectWithKeywords() with _PyObject_FastCallDict(). This change also 
replaces PyTuple_GetSlice(args, 1, argc) with &PyTuple_GET_ITEM(args, 1) which 
introduced the bug. I didn't notice that args can be an empty tuple. I never 
tried to call sorted(iterable=seq), I didn't know the name of the first 
parameter :-)

I also replaced PyTuple_GetSlice(args, 1, argc) with &PyTuple_GET_ITEM(args, 1) 
in methoddescr_call(), but this function make sure that we have at least one 
positional argument and so doesn't have this bug. Moreover, this method doesn't 
use Argument Clinic (yet? ;-)). I'm quite sure that I didn't replace 
PyTuple_GetSlice() in other functions.

--

___
Python tracker 

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



[issue29330] __slots__ needs documentation

2017-01-19 Thread saumitra paul

New submission from saumitra paul:

As you said..assiging it to you :)

--
messages: 285850
nosy: rhettinger, saumitra1978
priority: normal
severity: normal
status: open
title: __slots__ needs documentation
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



[issue29327] SystemError or crash in sorted(iterable=[])

2017-01-19 Thread STINNER Victor

STINNER Victor added the comment:

While Python 3.5 doesn't crash, I consider that it has also the bug. So I added 
Python 3.5 in Versions.

sorted.diff LGTM. And thank you for the unit test!

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



[issue29323] Wrong documentation (Library) for unicode and str comparison

2017-01-19 Thread Martin Panter

Martin Panter added the comment:

If you read the whole paragraph carefully, I don't think it is too misleading. 
"In particular, tuples and lists . . ." suggests the author was just trying to 
say that a tuple never compares equal to a list. Maybe we just need to make 
that more obvious?

However there are other problems in this part of the reference about comparing 
different types. See Issue 22000, about the earlier section on Comparisons of 
built-in types.

--
nosy: +martin.panter

___
Python tracker 

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



[issue27596] Build failure with Xcode 8 beta on OSX 10.11

2017-01-19 Thread Maxime Belanger

Maxime Belanger added the comment:

We're hitting this issue with Python 2.7 (which we deploy on Mac OS X 
10.6-10.12). We've worked around it by manually patching `pyconfig.h` to 
un-define `HAVE_GETENTROPY` before `make`ing. Is a patch is in the works to 
support weak-linking this symbol (and the other new Sierra additions)?

--
nosy: +Maxime Belanger

___
Python tracker 

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



  1   2   >