[issue35187] a bug about np.arrange

2018-11-08 Thread Mark Dickinson


Mark Dickinson  added the comment:

np.arange is part of NumPy, not core Python; I'd suggest asking this question 
on the NumPy mailing lists, e.g. 
https://mail.python.org/pipermail/numpy-discussion/

But no, it's not a bug; it's a well-known gotcha.

--
nosy: +mark.dickinson
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



[issue35187] a bug about np.arrange

2018-11-08 Thread Mark Dickinson


Mark Dickinson  added the comment:

It's also worth taking a look at the documentation: 
https://docs.scipy.org/doc/numpy-1.15.0/reference/generated/numpy.arange.html

See particularly the "Result" section, where it says:

> Because of floating point overflow, this rule may result in the last > 
> element of out being greater than stop.

--

___
Python tracker 

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



[issue34155] email.utils.parseaddr mistakenly parse an email

2018-11-08 Thread Kal Sze


Kal Sze  added the comment:

Another failure case:

>>> from email.utils import parseaddr
>>> parseaddr('fo@o...@bar.com')
('', 'fo@o')

If I understand the RFC correctly, the correct results should be ('', '') 
because there are two '@' signs. The first '@' would need to be quoted for the 
address to be valid.

--
nosy: +Kal Sze2

___
Python tracker 

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



[issue32409] venv activate.bat is UTF-8 encoded but uses current console codepage

2018-11-08 Thread STINNER Victor


STINNER Victor  added the comment:

Pablo Galindo reverted the change because it broke Windows buildbots, and we 
have a policy to revert a change breaking buildbots if the regression cannot be 
fixed "quickly" event:
https://pythondev.readthedocs.io/ci.html#revert-on-fail

Is someone working on investigating the bug? Do you need help to reproduce the 
bug?

Copy of the test_venv error:

==
ERROR: test_unicode_in_batch_file (test.test_venv.BasicTest)
--
Traceback (most recent call last):
  File "D:\buildarea\3.x.bolen-windows8\build\lib\test\test_venv.py", line 302, 
in test_unicode_in_batch_file
out, err = check_output(
  File "D:\buildarea\3.x.bolen-windows8\build\lib\test\test_venv.py", line 37, 
in check_output
raise subprocess.CalledProcessError(
TypeError: __init__() takes from 3 to 5 positional arguments but 6 were given

https://buildbot.python.org/all/#/builders/32/builds/1707

--

___
Python tracker 

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



[issue34987] A possible null pointer dereference in _pickle.c's save_reduce()

2018-11-08 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

I was wrong. get_class() returns NULL when and only when an exception is set.

--

___
Python tracker 

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



[issue35188] something confused about numpy.arange

2018-11-08 Thread xiyunlong


New submission from xiyunlong :

when I use:print(np.arange(1,2.2,0.2))
I got: 
1.0
1.2
1.4
1.5999
1.7998
1.9998
2.1997
could any one tell me why it's not 1.0,1.2,1.4,1.6,1.8,2.0?
Many thanks!

--
components: Library (Lib)
messages: 329466
nosy: xyl123
priority: normal
severity: normal
status: open
title: something confused about numpy.arange
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



[issue35188] something confused about numpy.arange

2018-11-08 Thread xiyunlong


Change by xiyunlong :


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



[issue35065] Reading received data from a closed TCP stream using `StreamReader.read` might hang forever

2018-11-08 Thread Andrew Svetlov


Andrew Svetlov  added the comment:


New changeset fd512d76456b65c529a5bc58d8cfe73e4a10de7a by Andrew Svetlov 
(Vincent Michel) in branch 'master':
bpo-35065: Remove `StreamReaderProtocol._untrack_reader` (#10212)
https://github.com/python/cpython/commit/fd512d76456b65c529a5bc58d8cfe73e4a10de7a


--

___
Python tracker 

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



[issue35065] Reading received data from a closed TCP stream using `StreamReader.read` might hang forever

2018-11-08 Thread Andrew Svetlov


Change by Andrew Svetlov :


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



[issue34885] asyncio documention has lost its paragraph about cancellation

2018-11-08 Thread Andrew Svetlov


Andrew Svetlov  added the comment:

I think the issue can be closed

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



[issue35189] EINTR is not being retried

2018-11-08 Thread Aapo Samuli Keskimolo


New submission from Aapo Samuli Keskimolo :

According to https://www.python.org/dev/peps/pep-0475/ the EINTR interruption 
should be retried automatically, but somehow it does not work and the exception 
is raised:

2018-11-05 05:21:35,257 ERROR:storage(23491): Remote storage operation failed 
(request: '{  'excludeSubModules': None,
   'storageLocation': 
'qt/qtdatavis3d/68faa5b00f73096eb096c6acdfce76b052ca20b9/LinuxUbuntu_18_04x86_64LinuxQEMUarm64GCCqtci-linux-Ubuntu-18.04-x86_64-a6
c9f7Release/ac4280d182ec320eaf0e68efaeeeb6be14b9689f/test_1542834179',
   'type': 3}')
Traceback (most recent call last):
  File "src/storage.py", line 507, in handle
self.handle_upload_artifact(message)
  File "src/storage.py", line 437, in handle_upload_artifact
log.info("upload of %s to %s", uploadType, message.storageLocation)
  File "/usr/lib/python3.6/logging/__init__.py", line 1306, in info
self._log(INFO, msg, args, **kwargs)
  File "/usr/lib/python3.6/logging/__init__.py", line 1442, in _log
self.handle(record)
  File "/usr/lib/python3.6/logging/__init__.py", line 1452, in handle
self.callHandlers(record)
  File "/usr/lib/python3.6/logging/__init__.py", line 1514, in callHandlers
hdlr.handle(record)
  File "/usr/lib/python3.6/logging/__init__.py", line 861, in handle
self.acquire()
  File "/home/vmbuilder/qt-ci/src/application.py", line 151, in acquire
fcntl.lockf(self._lock_fd, fcntl.LOCK_EX)
InterruptedError: [Errno 4] Interrupted system call

--
components: Library (Lib)
messages: 329469
nosy: akeskimo
priority: normal
severity: normal
status: open
title: EINTR is not being retried
type: crash
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



[issue35189] EINTR is not being retried

2018-11-08 Thread STINNER Victor


STINNER Victor  added the comment:

You're right, it should, but the fcntl module hasn't been patched. Are you 
interested to work or on patch, or do you want to me to find someone to do it?

--
nosy: +vstinner

___
Python tracker 

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



[issue35189] EINTR is not being retried

2018-11-08 Thread Aapo Samuli Keskimolo


Aapo Samuli Keskimolo  added the comment:

My colleague has made a prospective fix:

https://github.com/nierob/cpython/commit/3b76b887b2b339664dc52c5f246bc7cb268ea616

--

___
Python tracker 

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



[issue35189] EINTR is not being retried

2018-11-08 Thread STINNER Victor


STINNER Victor  added the comment:

> https://github.com/nierob/cpython/commit/3b76b887b2b339664dc52c5f246bc7cb268ea616

Oh, nice! Please rebase this change on the master branch and reuse "int 
async_err = 0;" pattern from Modules/posixmodule.c. You must not raise a new 
exception if PyErr_CheckSignals() raised an exception, something like:

return (!async_err) ? posix_error() : NULL;

--

___
Python tracker 

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



[issue35189] EINTR is not being retried

2018-11-08 Thread Nierob


Nierob  added the comment:

PR waits for CLA

--
keywords: +patch
nosy: +nierob
pull_requests: +9693
stage:  -> patch review

___
Python tracker 

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



[issue6721] Locks in the standard library should be sanitized on fork

2018-11-08 Thread STINNER Victor


STINNER Victor  added the comment:

> New changeset 3b699932e5ac3e76031bbb6d700fbea07492641d by Gregory P. Smith 
> (Miss Islington (bot)) in branch '3.7':
> bpo-6721: Hold logging locks across fork() (GH-4071) (#9291)

It seems like this change caused a regression in the Anaconda installer of 
Fedora:
https://bugzilla.redhat.com/show_bug.cgi?id=1644936

But we are not sure at this point. I have to investigate to understand exactly 
what is happening.

--

___
Python tracker 

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



[issue35189] PEP 475: fnctl functions are not retried if interrupted by a signal (EINTR)

2018-11-08 Thread STINNER Victor


Change by STINNER Victor :


--
versions: +Python 3.7, Python 3.8

___
Python tracker 

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



[issue35189] PEP 475: fnctl functions are not retried if interrupted by a signal (EINTR)

2018-11-08 Thread STINNER Victor


Change by STINNER Victor :


--
title: EINTR is not being retried -> PEP 475: fnctl functions are not retried 
if interrupted by a signal (EINTR)

___
Python tracker 

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



[issue35190] collections.abc.Sequence cannot be used to test whether a class provides a particular interface

2018-11-08 Thread Miro Hrončok

New submission from Miro Hrončok :

The collections.abc — Abstract Base Classes for Containers documentation says:

> This module provides abstract base classes that can be used to test whether a 
> class provides a particular interface; for example, whether it is hashable or 
> whether it is a mapping.

https://docs.python.org/3/library/collections.abc.html

However this is not true for Sequence.

When I implement a class that provides a particular interface (defined in the 
Collections Abstract Base Classes table in that very page), I cannot check 
whether it implements a Sequence.

See an example:

from collections import abc

class Box:
def __init__(self, wrapped):
self._w = wrapped

def __len__(self):
return len(self._w)

def __iter__(self):
yield from self._w

def __getitem__(self, i):
return self._w[i]

def __reversed__(self):
yield from reversed(self._w)

def __contains__(self, i):
return i in self._w

def index(self, value, start=0, stop=None):
return self._w.index(value, start, stop)

def count(self, value):
return self._w.count(value)


b = Box([1, 2, 3])

for t in 'Sized', 'Iterable', 'Reversible', 'Container', 'Collection', 
'Sequence':
print(f'{t}: {isinstance(b, getattr(abc, t))}')


My class is Reversible.
My class is a Collection (as it is a Sized Iterable Container).
It implements __getitem__, __len__, __contains__, __iter__, __reversed__, 
index, and count.

Yet my class instance is not an instance of Sequence.

I suppose this behavior might be intentional, as discussed in issue16728 - or 
it might as well not be.

The main concern was that dict also provides these methods, but is not 
considered a Sequence,
however dict does not provide index() or count().

Regardless whether this is right or wrong behavior, as documented this should 
be a Sequence.

See also 
https://stackoverflow.com/questions/34927949/issubclass-of-abstract-base-class-sequence


As I see it, either:

collections.abc.Sequence needs a __subclasshook__ so it can be used as the 
documentation implies.

Or:

the documentation should not say that "abstract base classes (from abc 
module) can be used to test whether a class provides a particular interface" if 
it doesn't generally apply


Or:

the Sequence documentation should say: "this particular abstract base class 
cannot be used to test whether a class provides a particular interface because 
reasons" (yet I don't really get those reasons)

--
assignee: docs@python
components: Documentation, Library (Lib)
messages: 329475
nosy: docs@python, hroncok, vstinner
priority: normal
severity: normal
status: open
title: collections.abc.Sequence cannot be used to test whether a class provides 
a particular interface
versions: Python 3.6, Python 3.7, Python 3.8

___
Python tracker 

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



[issue35186] distutils.command.upload uses deprecated platform.dist with bdist_rpm

2018-11-08 Thread Paul Ganssle


Change by Paul Ganssle :


--
keywords: +patch
pull_requests: +9694
stage:  -> patch review

___
Python tracker 

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



[issue35190] collections.abc.Sequence cannot be used to test whether a class provides a particular interface

2018-11-08 Thread STINNER Victor


Change by STINNER Victor :


--
nosy: +gvanrossum, rhettinger, serhiy.storchaka

___
Python tracker 

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



[issue35190] collections.abc.Sequence cannot be used to test whether a class provides a particular interface

2018-11-08 Thread Guido van Rossum


Guido van Rossum  added the comment:

Yeah, the docs need to be clarified.

--

___
Python tracker 

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



[issue35190] collections.abc.Sequence cannot be used to test whether a class provides a particular interface

2018-11-08 Thread Guido van Rossum


Change by Guido van Rossum :


--
nosy:  -gvanrossum

___
Python tracker 

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



[issue35190] collections.abc.Sequence cannot be used to test whether a class provides a particular interface

2018-11-08 Thread Miro Hrončok

Miro Hrončok  added the comment:

I fail to understand what abc classes can be used to test whether a class 
provides a particular interface, and what abc classes cannot be used that way. 
What is the difference between those abc classes and why are all those abc 
classes listed together when they behave differently?

--

___
Python tracker 

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



[issue35188] something confused about numpy.arange

2018-11-08 Thread Zachary Ware


Change by Zachary Ware :


--
resolution:  -> third party

___
Python tracker 

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



[issue35191] socket.setblocking(x) treats multiples of 2**32 as False

2018-11-08 Thread Alexey Izbyshev


New submission from Alexey Izbyshev :

UBSAN with -fsanitize=implicit-integer-truncation reported a suspicious case:

testSetBlocking_overflow (test.test_socket.NonBlockingTCPTests) ... 
/scratch2/izbyshev/cpython/Modules/socketmodule.c:2688:33: runtime error: 
implicit conversion from type 'long' of value 4294967296 (64-bit, signed) to 
type 'int' changed the value to 0 (32-bit, signed)

It turned out that sock_setblocking() converts its (logically boolean) argument 
to long, but then passes it to internal_setblocking() which accepts int 
(https://github.com/python/cpython/blob/fd512d76456b65c529a5bc58d8cfe73e4a10de7a/Modules/socketmodule.c#L2688).
 This results in unexpected truncation on platforms with 64-bit long.

testSetBlocking_overflow() which is supposed to check this doesn't work because 
it only checks socket timeout which is updated correctly. However, the actual 
state of socket descriptor is changed to the opposite value (non-blocking) in 
this case.

--
components: Extension Modules
messages: 329478
nosy: izbyshev, serhiy.storchaka, vstinner
priority: normal
severity: normal
status: open
title: socket.setblocking(x) treats multiples of 2**32 as False
type: behavior
versions: Python 2.7, Python 3.6, Python 3.7, Python 3.8

___
Python tracker 

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



[issue35191] socket.setblocking(x) treats multiples of 2**32 as False

2018-11-08 Thread Alexey Izbyshev


Change by Alexey Izbyshev :


--
keywords: +patch
pull_requests: +9695
stage:  -> patch review

___
Python tracker 

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



[issue35081] Move internal headers to Include/internal/

2018-11-08 Thread Paul Ganssle


Change by Paul Ganssle :


--
pull_requests: +9696

___
Python tracker 

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



[issue32485] Multiprocessing dict sharing between forked processes

2018-11-08 Thread Tal Einat


Tal Einat  added the comment:

Is this supposed to work at all? Does multiprocessing support sharing resources 
between processes forked outside of its own abstractions?

Reading the docs[1], calling os.fork() directly doesn't seem to be the way that 
the multiprocessing module is supposed to be used.

[1] https://docs.python.org/library/multiprocessing.html

--

___
Python tracker 

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



[issue34766] BaseProxy cache should be cleaned when Manager client is reconnected

2018-11-08 Thread Yongnan Wu


Yongnan Wu  added the comment:

ping

--

___
Python tracker 

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



[issue32409] venv activate.bat is UTF-8 encoded but uses current console codepage

2018-11-08 Thread Steve Dower


Steve Dower  added the comment:

That error is a bug in the test, but it only shows up on an error path anyway. 
Without removing the extra None we don't get to see the actual error output.

I can't look into this over the next week or two, but a quick glance at the 
original PR looks like a lot of quotes are missing around executable paths, so 
maybe it was that?

--

___
Python tracker 

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



[issue31625] stop using ranlib

2018-11-08 Thread Charalampos Stratakis


Change by Charalampos Stratakis :


--
pull_requests: +9697

___
Python tracker 

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



[issue35190] collections.abc.Sequence cannot be used to test whether a class provides a particular interface

2018-11-08 Thread Paul Ganssle


Change by Paul Ganssle :


--
nosy: +p-ganssle

___
Python tracker 

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



[issue35190] collections.abc.Sequence cannot be used to test whether a class provides a particular interface

2018-11-08 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
nosy: +stutzbach

___
Python tracker 

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



[issue31625] stop using ranlib

2018-11-08 Thread STINNER Victor


STINNER Victor  added the comment:

(I reopen the issue.)

> Would it make sense to backport that to 3.6 as well? Currently this blocks 
> https://bugs.python.org/issue28015 from being backported to 3.6

There is a risk of regression. Does bpo-28015 fix really depend on this change?

Benjamin wrote: "As far as I'm aware, every modern *nix's ar supports an "s" 
flag", but I'm not sure if Python 3.6 is only used on "modern Unix". Some 
people use AIX and HP-UX: does ar support "s" on these OSes?

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

___
Python tracker 

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



[issue30825] csv.Sniffer does not detect lineterminator

2018-11-08 Thread Gertjan van den Burg


Gertjan van den Burg  added the comment:

Note that the current CSV parser in _csv.c doesn't require the line terminator, 
it eats up \r and \n where necessary. See: 

https://github.com/python/cpython/blob/fd512d76456b65c529a5bc58d8cfe73e4a10de7a/Modules/_csv.c#L752

This is why the line terminator isn't detected and doesn't need to be detected.

Also, files that use the \r line terminator exist and are parsed correctly at 
the moment. See for example: 
https://raw.githubusercontent.com/hadley/data-fuel-economy/master/1998-2008/2008.csv

--
nosy: +Gertjan van den Burg

___
Python tracker 

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



[issue35192] pathlib mkdir throws FileExistsError when not supposed to

2018-11-08 Thread Adam Dunlap


New submission from Adam Dunlap :

I have 2 processes (one C, one python) that are started at the same time and 
both need a certain directory tree to exist to continue, so both processes 
create the directory tree while ignoring errors about it already existing.

In the python process, I'm using pathlib's mkdir function 
(https://docs.python.org/3/library/pathlib.html#pathlib.Path.mkdir) with 
parents=True, exist_ok=True, but this is sometimes throwing a FileExistsError. 
I don't expect this because the documentation says "If exist_ok is true, 
FileExistsError exceptions will be ignored (same behavior as the POSIX mkdir -p 
command), but only if the last path component is not an existing non-directory 
file." The last component is never a non-directory file.

I believe what is happening is that mkdir realizes that the parent doesn't 
exist, so it recursively tries to make the parent directory. However, when it 
recurses, it uses the default exists_ok value of False. Before the recursive 
call can make the parent directory, the other process makes the directory. This 
causes the inner call to throw a FileExistsError.

I believe the correct thing to do is to always pass True for exists_ok in the 
recursive call.

--
components: Library (Lib)
messages: 329484
nosy: Adam Dunlap
priority: normal
severity: normal
status: open
title: pathlib mkdir throws FileExistsError when not supposed to
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



[issue35193] Off by one error in peephole call to find_op on case RETURN_VALUE

2018-11-08 Thread Gregory P. Smith


New submission from Gregory P. Smith :

An off by one error was introduced to peephole.c by the "off by one error fix" 
in https://bugs.python.org/issue28517.  Clang's memory sanitizer detects it 
(msan).

find_op is ultimately called with h == codelen so it accesses one byte out of 
bounds.

I have a fix, PR coming.

--
assignee: gregory.p.smith
components: Interpreter Core
messages: 329485
nosy: gregory.p.smith, serhiy.storchaka
priority: normal
severity: normal
status: open
title: Off by one error in peephole call to find_op on case RETURN_VALUE
type: crash
versions: Python 3.6, Python 3.7, Python 3.8

___
Python tracker 

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



[issue28517] Dead code in wordcode

2018-11-08 Thread Gregory P. Smith


Gregory P. Smith  added the comment:

the off by one error fix here introduced a new off by one error.  PR coming, 
follow https://bugs.python.org/issue35193 for that.

--
nosy: +gregory.p.smith

___
Python tracker 

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



[issue30825] csv.Sniffer does not detect lineterminator

2018-11-08 Thread Skip Montanaro


Skip Montanaro  added the comment:

A couple comments.

1. Terry Reedy wrote:

> The csv expert listed in https://devguide.python.org/experts/ is marked as 
> inactive

That would be me. I am indeed inactive w.r.t. fixing broken stuff, and
don't want to feel obligated to jump in with both feet when a CSV
ticket is raised. Still, I keep half an eye on things. If people are
actually interested in my opinion on such stuff, drop me a line.

2. Regarding the csv.Sniffer class... I've personally never found it
useful, and would be happy to see it deprecated. I occasionally define
a delimiter other than comma, and never specify the quotechar. (I've
never seen anything other than quotation marks used anyway.) As others
have indicated, the line terminator is kind of unnecessary with Python
3 (unless you need something really weird). If you actually need to
specify a delimiter, I think giving a set of candidate delimiters
would be sufficient. The first one encountered wins.

Maybe I'm just getting old and cranky, but deprecation is the fork in
the road I'd take, given the choice. Second choice would be to
simplify the delimiter sniffing logic and get rid of anything to do
with line terminators.

Skip

--

___
Python tracker 

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



[issue35193] Off by one error in peephole call to find_op on case RETURN_VALUE

2018-11-08 Thread Gregory P. Smith


Change by Gregory P. Smith :


--
keywords: +patch
pull_requests: +9698
stage:  -> patch review

___
Python tracker 

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



[issue12568] Add functions to get the width in columns of a character

2018-11-08 Thread STINNER Victor


STINNER Victor  added the comment:

I close the issue as WONTFIX.

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



[issue30064] BaseSelectorEventLoop.sock_{recv, sendall}() don't remove their callbacks when canceled

2018-11-08 Thread Andrew Svetlov


Change by Andrew Svetlov :


--
keywords: +patch
pull_requests: +9699
stage:  -> patch review

___
Python tracker 

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



[issue35194] A typo in a constant in cp932 codec

2018-11-08 Thread Alexey Izbyshev


New submission from Alexey Izbyshev :

UBSan with -fsanitize=implicit-integer-truncation found a suspicious one:
/scratch2/izbyshev/cpython/Modules/cjkcodecs/_codecs_jp.c:43:17: runtime error: 
implicit conversion from type 'unsigned int' of value 4294966013 (32-bit, 
unsigned) to type 'unsigned char' changed the value to 253 (8-bit, unsigned)

Indeed, the wrong constant was used (the correct one is used in corresponding 
decoder code at 
https://github.com/python/cpython/blob/fd512d76456b65c529a5bc58d8cfe73e4a10de7a/Modules/cjkcodecs/_codecs_jp.c#L105).
 In this case the truncation was harmless because only the lowest byte of the 
wrong result was used, and it was correct. But it probably makes sense to fix 
it if only to reduce noise from UBSan.

All Python versions are affected, but I've marked 3.8 only since I'm not sure 
what the policy for backporting such changes is.

--
components: Extension Modules
messages: 329489
nosy: izbyshev, serhiy.storchaka, vstinner
priority: normal
severity: normal
status: open
title: A typo in a constant in cp932 codec
type: behavior
versions: Python 3.8

___
Python tracker 

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



[issue35195] Pandas read_csv() is 3.5X Slower on Python 3.7.1 vs Python 3.6.7 & 3.5.2 On Windows 10

2018-11-08 Thread Dragoljub


New submission from Dragoljub :

xref: https://github.com/pandas-dev/pandas/issues/23516

Example:
import io
import pandas as pd
import numpy as np
df = pd.DataFrame(np.random.randn(100, 10), columns=('COL{}'.format(i) for 
i in range(10)))
csv = io.StringIO(df.to_csv(index=False))
df2 = pd.read_csv(csv) #3.5X slower on Python 3.7.1

pd.read_csv() reads data at 30MB/sec on Python 3.7.1 while at 100MB/sec on 
Python 3.6.7.

This issue seems to be only present on Windows 10 Builds both x86 & x64. 

Possibly some IO changes in Python 3.7 could have contributed to this slowdown 
on Windows but not on Linux?

--
components: IO
messages: 329490
nosy: Dragoljub
priority: normal
severity: normal
status: open
title: Pandas read_csv() is 3.5X Slower on Python 3.7.1 vs Python 3.6.7 & 3.5.2 
On Windows 10
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



[issue35194] A typo in a constant in cp932 codec

2018-11-08 Thread Alexey Izbyshev


Change by Alexey Izbyshev :


--
keywords: +patch
pull_requests: +9700
stage:  -> patch review

___
Python tracker 

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



[issue33196] SEGV in mp.synchronize.Lock.__repr__ in spawn'ed proc if ctx mismatched

2018-11-08 Thread Gus Goulart


Gus Goulart  added the comment:

I couldn't reproduce the error on Debian 9 nor OSX, although I tried tweaking 
the test script a little bit to force the error. Arcadiy, did you tried 
reproducing the same issue in a different platform? Did someone report 
something similar in recent issues on gevent?

--
nosy: +gus.goulart, vstinner

___
Python tracker 

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



[issue33196] SEGV in mp.synchronize.Lock.__repr__ in spawn'ed proc if ctx mismatched

2018-11-08 Thread Gus Goulart


Change by Gus Goulart :


--
nosy: +taleinat

___
Python tracker 

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



[issue35193] Off by one error in peephole call to find_op on case RETURN_VALUE

2018-11-08 Thread miss-islington


Change by miss-islington :


--
pull_requests: +9701

___
Python tracker 

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



[issue35193] Off by one error in peephole call to find_op on case RETURN_VALUE

2018-11-08 Thread Gregory P. Smith


Gregory P. Smith  added the comment:


New changeset 49fa4a9f1ef387e16596f271414c855339eadf09 by Gregory P. Smith in 
branch 'master':
bpo-35193: Fix an off by one error in the RETURN_VALUE case. (GH-10418)
https://github.com/python/cpython/commit/49fa4a9f1ef387e16596f271414c855339eadf09


--

___
Python tracker 

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



[issue35193] Off by one error in peephole call to find_op on case RETURN_VALUE

2018-11-08 Thread miss-islington


miss-islington  added the comment:


New changeset f16ebcd460aaeb8d6b31db317d22f5ed68afbcc8 by Miss Islington (bot) 
in branch '3.7':
bpo-35193: Fix an off by one error in the RETURN_VALUE case. (GH-10418)
https://github.com/python/cpython/commit/f16ebcd460aaeb8d6b31db317d22f5ed68afbcc8


--
nosy: +miss-islington

___
Python tracker 

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



[issue32513] dataclasses: make it easier to use user-supplied special methods

2018-11-08 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
pull_requests: +9702

___
Python tracker 

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



[issue24412] setUpClass equivalent for addCleanup

2018-11-08 Thread Lisa Roach


Lisa Roach  added the comment:


New changeset 0f221d09cad46bee38d1b7a7822772df66c53028 by Lisa Roach in branch 
'master':
bpo-24412: Adds cleanUps for setUpClass and setUpModule. (GH-9190)
https://github.com/python/cpython/commit/0f221d09cad46bee38d1b7a7822772df66c53028


--
nosy: +lisroach

___
Python tracker 

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



[issue35195] Pandas read_csv() is 3.5X Slower on Python 3.7.1 vs Python 3.6.7 & 3.5.2 On Windows 10

2018-11-08 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +xtreak

___
Python tracker 

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



[issue35192] pathlib mkdir throws FileExistsError when not supposed to

2018-11-08 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

Thanks for the report. There was a related issue : issue29694 . This was fixed 
in 3.7 and was backported with 
https://github.com/python/cpython/commit/d7abeb7024b9755c291c29bdc8c4494246e975ad
 (3.5.4 and above) . Can you please specify the full version of Python 3.5 you 
are using and if the linked issue is related ? If possible please attach a 
reproducer so  that this can be tested on other versions.

--
nosy: +xtreak

___
Python tracker 

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



[issue35105] Document that CPython accepts "invalid" identifiers

2018-11-08 Thread Windson Yang


Windson Yang  added the comment:

I try to create a PR for it. Should we add 'CPython implementation detail' at 
the document? Because this happens at cpython as well as pypy. BTW, where 
should we add the document? I have two choices.

* https://docs.python.org/3/reference/datamodel.html#object.__setattr__
* https://docs.python.org/3/library/functions.html#setattr

--

___
Python tracker 

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



[issue35131] Cannot access to customized paths within .pth file

2018-11-08 Thread Valentin Zhao


Valentin Zhao  added the comment:

I am better just waiting you guys fixing that because it is not urgent.
On Sat, Nov 3, 2018 at 10:12 PM Jason R. Coombs 
wrote:

>
> Jason R. Coombs  added the comment:
>
> Also, I would argue that this is an enhancement request and not a bug -
> that the prior expectation was that the .pth file is encoded in whatever
> encoding the system expects by default, and that adding support for a
> standardized encoding for .pth files is a new feature.
>
> As another aside: Valentin, the technique you're using to manage packages
> is likely to run into issues with certain packages - in particular any
> packages that rely on their own `.pth` files to invoke behavior, such as
> future_fstrings (https://pypi.org/project/future-fstrings/). I learned
> about this issue in (https://github.com/jaraco/rwt/issues/29), which is
> why the rwt project adds a `sitecustomize.py` to the target directory that
> ensures .pth files are run. Just FYI.
>
> --
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

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



[issue35131] Cannot access to customized paths within .pth file

2018-11-08 Thread Windson Yang


Windson Yang  added the comment:

I tried to create a PR for it, However, I don't know how to handle the code at 
https://github.com/python/cpython/blob/d4c76d960b/Lib/site.py#L159

So how to check UnicodeDecodeError when we just open the file, I use 
readlines() but it may use too many memory than before (I'm not sure it's 
important in this case).

try:
f = open(fullname, "r")
data = f.readlines()
except UnicodeDecodeError:
f = open(fullname, "r", encoding="utf-8")
data = f.readlines()

--

___
Python tracker 

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



[issue35193] Off by one error in peephole call to find_op on case RETURN_VALUE

2018-11-08 Thread Gregory P. Smith


Change by Gregory P. Smith :


--
pull_requests: +9703

___
Python tracker 

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



[issue35193] Off by one error in peephole call to find_op on case RETURN_VALUE

2018-11-08 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Thank you for catching and fixing this error Gregory!

--

___
Python tracker 

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



[issue35194] A typo in a constant in cp932 codec

2018-11-08 Thread miss-islington


miss-islington  added the comment:


New changeset 7a69cf47a9bbc95f95fd67c982bff121b2a903cb by Miss Islington (bot) 
(Alexey Izbyshev) in branch 'master':
bpo-35194: Fix a wrong constant in cp932 codec (GH-10420)
https://github.com/python/cpython/commit/7a69cf47a9bbc95f95fd67c982bff121b2a903cb


--
nosy: +miss-islington

___
Python tracker 

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



[issue35194] A typo in a constant in cp932 codec

2018-11-08 Thread miss-islington


Change by miss-islington :


--
pull_requests: +9704

___
Python tracker 

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



[issue35194] A typo in a constant in cp932 codec

2018-11-08 Thread miss-islington


Change by miss-islington :


--
pull_requests: +9705

___
Python tracker 

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



[issue35194] A typo in a constant in cp932 codec

2018-11-08 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Maybe add asserts in OUTBYTE1() and similar macros to prevent similar errors in 
future?

--
versions: +Python 2.7, 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



[issue35193] Off by one error in peephole call to find_op on case RETURN_VALUE

2018-11-08 Thread Gregory P. Smith


Gregory P. Smith  added the comment:


New changeset 65e1a1fd311943866361fcb288c0df65dadbe092 by Gregory P. Smith in 
branch '3.6':
bpo-35193: Fix an off by one error in the RETURN_VALUE case. (GH-10418) 
(GH-10422)
https://github.com/python/cpython/commit/65e1a1fd311943866361fcb288c0df65dadbe092


--

___
Python tracker 

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



[issue35194] A typo in a constant in cp932 codec

2018-11-08 Thread miss-islington


miss-islington  added the comment:


New changeset 49ee41f1c3934aa095e32fa751cdf3ba641ae34b by Miss Islington (bot) 
in branch '3.6':
bpo-35194: Fix a wrong constant in cp932 codec (GH-10420)
https://github.com/python/cpython/commit/49ee41f1c3934aa095e32fa751cdf3ba641ae34b


--

___
Python tracker 

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



[issue35194] A typo in a constant in cp932 codec

2018-11-08 Thread miss-islington


miss-islington  added the comment:


New changeset 22234f1375d28803074405497ea61315fb37240d by Miss Islington (bot) 
in branch '3.7':
bpo-35194: Fix a wrong constant in cp932 codec (GH-10420)
https://github.com/python/cpython/commit/22234f1375d28803074405497ea61315fb37240d


--

___
Python tracker 

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