[issue32045] Does json.dumps have a memory leak?

2017-11-16 Thread Rohan D'Sa

Rohan D'Sa  added the comment:

you are right. i realized later i actually had a leak in a com instantiated 
object, assumed it was a leak in the python and tried to find it using the gc 
module. 

The gc documentation led me down the garden path.

QUOTE

gc.garbage
A list of objects which the collector found to be unreachable but could not be 
freed (uncollectable objects). 

UNQUOTE

i assumed:
- cyclic references are unreachable but can be freed and hence collectable.
- __del__ finalizer (with cyclic references?) objects are unreachable and 
cannot be freed and hence uncollectable.

--

___
Python tracker 

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



[issue32055] Reconsider comparison chaining for containment tests

2017-11-16 Thread Nick Coghlan

Nick Coghlan  added the comment:

https://bugs.python.org/issue14247 is another older issue related to this point 
(again related to a user finding the current behaviour genuinely unintuitive)

--

___
Python tracker 

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



[issue28617] Why isn't "in" called a comparison operation?

2017-11-16 Thread Nick Coghlan

Nick Coghlan  added the comment:

Also see https://bugs.python.org/issue32055 regarding the prospect of bringing 
the implementation into line with the intuitive semantics, and preventing 
implicit comparison chaining for containment tests.

--
nosy: +ncoghlan

___
Python tracker 

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



[issue32055] Reconsider comparison chaining for containment tests

2017-11-16 Thread Nick Coghlan

New submission from Nick Coghlan :

(I thought there was an open low priority issue for this, but I can't find it, 
so filing a new one)

Currently, "in" and "not in" are classified as comparison operations in the 
language grammar, even though they're not actually documented as such (see 
https://bugs.python.org/issue28617 in relation to the latter point).

Issue reports like https://bugs.python.org/issue30965, user questions like 
https://stackoverflow.com/questions/45180899/unexpected-result-from-in-operator-python/45180967,
 and behaviour puzzles like 
https://github.com/cosmologicon/pywat#operator-precedence suggest that the 
existing behaviour isn't particular intuitive to users.

At the language design level (as far as I am aware), the benefit of treating 
"in" and "not in" as comparison operators is to ensure they share a precedence 
level with the other comparisons.

While this is mostly a pretty harmless quirk, I think it's weird enough and 
useless enough for us to at least consider refining the Grammar such that "in" 
and "not in" live at the same level as other comparison operators, but *don't* 
participate in comparison chaining (i.e. "a == b in c" and "a in c == b" would 
both be syntax errors that required parentheses to disambiguate the desired 
associativity).

--
messages: 306411
nosy: ncoghlan
priority: low
severity: normal
status: open
title: Reconsider comparison chaining for containment tests
type: behavior
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



[issue31956] Add start and stop parameters to the array.index()

2017-11-16 Thread Roundup Robot

Change by Roundup Robot :


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

___
Python tracker 

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



[issue31822] Document that urllib.parse.{Defrag, Split, Parse}Result are namedtuples

2017-11-16 Thread Lisa Roach

Change by Lisa Roach :


--
keywords: +patch
pull_requests: +4378
stage: needs patch -> patch review

___
Python tracker 

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



[issue29753] Ctypes Packing Bitfields Incorrectly - Linux

2017-11-16 Thread Charles Machalow

Charles Machalow  added the comment:

Antti, is there a place in the ctypes documentation that explicitly says ctypes 
is not meant to be used cross-platform? If not, shouldn't that be mentioned?

I think ultimately ctypes should default to standard OS/compiler behavior, but 
should allow the flexibility for one to override for cross-platform 
interchangeability.

In the C++ code here, the code is explicitly checking if Windows (or GCC) to 
choose behavior. In theory, that could be changed to allow runtime-choice for 
packing behavior. 

Of course, that is probably best for a feature issue. For this one, I'd just 
like to have the behavior on Linux match GCC, as that is the definitive bug 
here as our example has shown.

--

___
Python tracker 

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



[issue32051] Possible issue in multiprocessing doc

2017-11-16 Thread jason

jason  added the comment:

Thank you for answering!
Yes, I would be very happy to do that, this is going to be my first 
contribution! :)

--

___
Python tracker 

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




[issue32051] Possible issue in multiprocessing doc

2017-11-16 Thread Berker Peksag

Berker Peksag  added the comment:

The example itself works fine, but I agree that it would be better to use a 
better name. We could replace ``('foo.bar.org', 5)`` in the following 
examples with ``('', 5)`` too.

Would you like to send a PR? The documentation file is located at 
Doc/library/multiprocessing.rst.

--
keywords: +easy
nosy: +berker.peksag
stage:  -> needs patch
type: enhancement -> behavior
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



[issue31691] Include missing info on required build steps and how to build installer

2017-11-16 Thread Steve Dower

Steve Dower  added the comment:


New changeset c69611990365ae2f2efffd191de0aba9ee98d95c by Steve Dower 
(native-api) in branch '3.6':
bpo-31691: Specify where to find installer build instructions for Windows 
(#4427)
https://github.com/python/cpython/commit/c69611990365ae2f2efffd191de0aba9ee98d95c


--

___
Python tracker 

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



[issue31691] Include missing info on required build steps and how to build installer

2017-11-16 Thread Steve Dower

Steve Dower  added the comment:

Thanks for the PR!

--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
type:  -> crash

___
Python tracker 

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



[issue31691] Include missing info on required build steps and how to build installer

2017-11-16 Thread Steve Dower

Steve Dower  added the comment:


New changeset 0a6158ca392adfdfbeb7eb43d8d8109c02b00d23 by Steve Dower (Miss 
Islington (bot)) in branch '3.6':
bpo-31691: Specify where to find build instructions for the Windows installer 
(GH-4426) (#4431)
https://github.com/python/cpython/commit/0a6158ca392adfdfbeb7eb43d8d8109c02b00d23


--

___
Python tracker 

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



[issue31691] Include missing info on required build steps and how to build installer

2017-11-16 Thread Steve Dower

Steve Dower  added the comment:


New changeset c02307e9634583d3f2660e46b5200bf0b282695a by Steve Dower 
(native-api) in branch '2.7':
bpo-31691: Specify how to build installer in Windows (#4430)
https://github.com/python/cpython/commit/c02307e9634583d3f2660e46b5200bf0b282695a


--

___
Python tracker 

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



[issue31691] Include missing info on required build steps and how to build installer

2017-11-16 Thread Roundup Robot

Change by Roundup Robot :


--
pull_requests: +4377

___
Python tracker 

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



[issue31691] Include missing info on required build steps and how to build installer

2017-11-16 Thread Roundup Robot

Change by Roundup Robot :


--
pull_requests: +4376

___
Python tracker 

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



[issue31691] Include missing info on required build steps and how to build installer

2017-11-16 Thread Steve Dower

Steve Dower  added the comment:


New changeset fd0fa67464f75cebca67cd14d050476a0c73bd53 by Steve Dower 
(native-api) in branch 'master':
bpo-31691: Specify where to find build instructions for the Windows installer 
(#4426)
https://github.com/python/cpython/commit/fd0fa67464f75cebca67cd14d050476a0c73bd53


--
nosy: +steve.dower

___
Python tracker 

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



[issue31691] Include missing info on required build steps and how to build installer

2017-11-16 Thread Roundup Robot

Change by Roundup Robot :


--
pull_requests: +4375

___
Python tracker 

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



[issue31691] Include missing info on required build steps and how to build installer

2017-11-16 Thread Roundup Robot

Change by Roundup Robot :


--
pull_requests: +4374

___
Python tracker 

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



[issue31691] Include missing info on required build steps and how to build installer

2017-11-16 Thread Roundup Robot

Change by Roundup Robot :


--
pull_requests: +4373

___
Python tracker 

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



[issue31691] Include missing info on required build steps and how to build installer

2017-11-16 Thread Roundup Robot

Change by Roundup Robot :


--
pull_requests: +4372
stage:  -> patch review

___
Python tracker 

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



[issue31911] Use malloc_usable_size() in pymalloc for realloc

2017-11-16 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

What would be the point of this?  This would complicate the code with 
platform-specific code and it's not obvious that it would change runtime 
performance in any significant way.

--
nosy: +pitrou

___
Python tracker 

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



[issue31701] faulthandler dumps 'Windows fatal exception: code 0xe06d7363'

2017-11-16 Thread Ilya Kulakov

Ilya Kulakov  added the comment:

Another option is to use AddVectoredContinueHandler [1]. It seems to be called 
if both VEH and SEH failed to handle the error.

1: 
https://msdn.microsoft.com/en-us/library/windows/desktop/ms679273(v=vs.85).aspx

--

___
Python tracker 

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



[issue32054] Creating RPM on Python 2 works, but Python 3 fails because of sys.implementation.cache_tag

2017-11-16 Thread Pedro

New submission from Pedro :

I am trying to create an RPM on SLES12 SP2. (I think that corresponds to 
OpenSUSE 42.2.) This is my setup.py file, nothing special:

import setuptools
setuptools.setup(name='MyApp',
 version='1.2.3',
 options={'bdist_rpm': {'post_install': 'post_install.sh',
'post_uninstall': 
'post_uninstall.sh'}})

Running `python setup.py bdist_rpm` with Python 2 works. However, running 
`python3 setup.py bdist_rpm` outputs the following:

running bdist_rpm
running egg_info
writing top-level names to MyApp.egg-info/top_level.txt

...

byte-compiling 
/home/pedro/MyApp/build/bdist.linux-x86_64/rpm/BUILDROOT/MyApp-1.2.3-1.x86_64/usr/lib/python3.4/site-packages/MyApp/my_file.py
 to my_file.cpython-34.pyc

...

Processing files: MyApp-1.2.3-1.noarch
error: File not found: 
/home/pedro/MyApp/build/bdist.linux-x86_64/rpm/BUILDROOT/MyApp-1.2.3-1.x86_64/usr/lib/python3.4/site-packages/MyApp/my_file.py

RPM build errors:
File not found: 
/home/pedro/MyApp/build/bdist.linux-x86_64/rpm/BUILDROOT/MyApp-1.2.3-1.x86_64/usr/lib/python3.4/site-packages/MyApp/my_file.py
error: command 'rpmbuild' failed with exit status 1

The problem appears to be that setuptools is generating a file that ends in 
`.cpython-34.pyc`, and later looks for a file without the `.cpython-34` but 
can't find it.

The RPM generation process on Python 3 goes through 
`distutils.util.byte_compile()`, which in turn calls 
`importlib.util.cache_from_source(path)`, where `path` is the file to be 
byte-compiled. `cache_from_source()` injects the value of 
`sys.implementation.cache_tag` (which is equal to 'cpython-34' on SLES12 SP2) 
into the filename of the compiled file. This attribute of `sys` does not exist 
in Python 2. So it looks like `setuptools` alters the filename with that tag 
during byte compilation, but later forgets that it modified the filename and 
fails because it's looking for the original name.

I ended up working around this by patching `distutils.file_util.write_file` to 
eliminate the .pyc entries from INSTALLED_FILES:

orig_bytecode_var = os.environ.get('PYTHONDONTWRITEBYTECODE', '')
os.environ['PYTHONDONTWRITEBYTECODE'] = '1'
orig_write_file = distutils.file_util.write_file

def my_patch(*args, **kwargs):
new_args = list(args)
if args[0] == 'INSTALLED_FILES':
new_args[1] = [fname for fname in args[1] if fname[-4:] not in 
('.pyc', '.pyo')]
orig_write_file(*new_args, **kwargs)
distutils.file_util.write_file = my_patch

setuptools.setup(name='MyApp',
 version='1.2.3',
 options={'bdist_rpm': {'post_install': 'post_install.sh',
'post_uninstall': 
'post_uninstall.sh'}})

os.environ['PYTHONDONTWRITEBYTECODE'] = orig_bytecode_var
distutils.file_util.write_file = orig_write_file


But I don't think I should have to do anything special to build an RPM on 
Python 3 vs. Python 2. Is this expected behavior?

--
components: Distutils
messages: 306400
nosy: dstufft, eric.araujo, pgacv2
priority: normal
severity: normal
status: open
title: Creating RPM on Python 2 works, but Python 3 fails because of 
sys.implementation.cache_tag
type: behavior
versions: Python 3.4

___
Python tracker 

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



[issue29753] Ctypes Packing Bitfields Incorrectly - Linux

2017-11-16 Thread Marc Le Roy

Change by Marc Le Roy :


--
nosy: +mleroy003

___
Python tracker 

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



[issue32053] Inconsistent use of tabs and spaces in indentation not always detected

2017-11-16 Thread Serhiy Storchaka

New submission from Serhiy Storchaka :

>>> exec('''if 1:
... print(1)
...\tprint(2)
... ''')
1
2

The first indented line uses 8 spaces. The second indented line uses 7 spaces + 
tabulation. Indentations are different, but TabError is not raised.

--
components: Interpreter Core
messages: 306399
nosy: haypo, serhiy.storchaka
priority: normal
severity: normal
status: open
title: Inconsistent use of tabs and spaces in indentation not always detected
type: behavior
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



[issue32025] Add time.thread_time()

2017-11-16 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Should I leave this open for you to work on the macOS implementation, Victor?

--

___
Python tracker 

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



[issue32052] Provide access to buffer of asyncio.StreamReader

2017-11-16 Thread Bruce Merry

New submission from Bruce Merry :

While asyncio.StreamReader.readuntil is an improvement on only having readline, 
it is still quite limited e.g. you cannot have multiple possible terminators. 
The real problem is that it's not possible to roll your own without accessing 
_underscore fields (other than by reading one byte at a time, which I'm 
guessing would be bad for performance). I'm not sure exactly what a public API 
to assist would look like, but I think the following would be a good start:

1. A get_buffer method, that returns (self._buffer, self._eof); the caller must 
treat the buffer as readonly.
2. A wait_for_data method to wait for the return value of get_buffer to change 
(basically like current _wait_for_data)
3. Access to the _limit attribute.

With that available, I think readuntil or more complex variants of it could be 
implemented externally using only the public interface (consumption of data 
from the buffer would be via readexactly rather than by messing with the buffer 
array directly).

--
components: asyncio
messages: 306397
nosy: Bruce Merry, yselivanov
priority: normal
severity: normal
status: open
title: Provide access to buffer of asyncio.StreamReader
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



[issue31701] faulthandler dumps 'Windows fatal exception: code 0xe06d7363'

2017-11-16 Thread Ilya Kulakov

Ilya Kulakov  added the comment:

I think faulthandler should use both. E.g. in [1] you can read about an 
exception that can be handled by AddVectoredExceptionHandler but not 
SetUnhandledExceptionFilter.

Perhaps implementation should use SetUnhandledExceptionFilter for everything 
and AddVectoredExceptionHandler only for those exceptions that cannot be 
handled by the former, like c374.

I couldn't find a list, so guess it will be an ongoing WIP.

1: 
https://stackoverflow.com/questions/19656946/why-setunhandledexceptionfilter-cannot-capture-some-exception-but-addvectoredexc

--

___
Python tracker 

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



[issue32040] Sorting pahtlib.Paths does give the same order as sorting the (string) filenames of that pathlib.Paths

2017-11-16 Thread R. David Murray

R. David Murray  added the comment:

To put it another way, think about sorting a list of tuples.  Same behavior.

--

___
Python tracker 

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



[issue32040] Sorting pahtlib.Paths does give the same order as sorting the (string) filenames of that pathlib.Paths

2017-11-16 Thread R. David Murray

R. David Murray  added the comment:

It is "obvious by inspection".  Paths are paths instead of strings because they 
are formed out of discrete path components instead of strings.  If you sorted 
each directory in the paths from the top down, and then sorted the 
subdirectories, and then sorted the filenames, you get that sorting by 
component.  It's the same order you would get out of an ls -R.

--
nosy: +r.david.murray
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



[issue32046] 2to3 fix for operator.isCallable()

2017-11-16 Thread Éric Araujo

Change by Éric Araujo :


--
Removed message: https://bugs.python.org/msg306393

___
Python tracker 

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



[issue32046] 2to3 fix for operator.isCallable()

2017-11-16 Thread Éric Araujo

Éric Araujo  added the comment:

Why about just removing the check, now that callable has been back in 3.x for a 
few releases?

--
nosy: +eric.araujo

___
Python tracker 

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



[issue32038] Add API to intercept socket.close()

2017-11-16 Thread Yury Selivanov

Yury Selivanov  added the comment:

> Note that a guard on socket objects can only solve part of the problem: in 
> the case where i've seen this bug, it was with raw file descriptors from 
> libcurl, and there's nothing python can do about that because there are no 
> (python) socket objects.

Well, in this case 'dup' is the only option.

--

___
Python tracker 

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



[issue32038] Add API to intercept socket.close()

2017-11-16 Thread Ben Darnell

Ben Darnell  added the comment:

Note that a guard on socket objects can only solve part of the problem: in the 
case where i've seen this bug, it was with raw file descriptors from libcurl, 
and there's nothing python can do about that because there are no (python) 
socket objects.

--

___
Python tracker 

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



[issue26752] Mock(2.0.0).assert_has_calls() raise AssertionError in two same calls

2017-11-16 Thread Guillaume Boily

Guillaume Boily  added the comment:

As pointed here: https://github.com/testing-cabal/mock/issues/353,

this issue is related to the method assert_has_calls or probably any calls that 
use the method _call_matcher to match calls. Given that you mock a class and 
spec it, since we always bind to the _spec_signature (e.g. the constructor 
signature), when it is a method call then it bind() throws a TypeError looking 
like `missing a require argument`. A possible solution would be to include 
method signatures into the spec.

--
components: +Tests
nosy: +guboi72
versions: +Python 3.6 -Python 2.7, Python 3.4

___
Python tracker 

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



[issue32051] Possible issue in multiprocessing doc

2017-11-16 Thread jason

New submission from jason :

in multiprocessing doc https://docs.python.org/3.6/library/multiprocessing.html

under 17.2.2.7.2. Using a remote manager, 
>>> from multiprocessing.managers import BaseManager
>>> import queue
>>> queue = queue.Queue()
>>> class QueueManager(BaseManager): pass
>>> QueueManager.register('get_queue', callable=lambda:queue)
>>> m = QueueManager(address=('', 5), authkey=b'abracadabra')
>>> s = m.get_server()
>>> s.serve_forever()


queue is used as both module name and variable name, should this be avoided?

--
assignee: docs@python
components: Documentation
messages: 306389
nosy: 1a1a11a, docs@python
priority: normal
severity: normal
status: open
title: Possible issue in multiprocessing doc
type: enhancement
versions: Python 3.6

___
Python tracker 

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



[issue32038] Add API to intercept socket.close()

2017-11-16 Thread Yury Selivanov

Yury Selivanov  added the comment:

> OK, then maybe socket objects should get a dup() method that just
increments the ref counter, and that would be the public API you're looking
for?

"dup()" returns a new socket object, but here we only want to protect the 
original one.

Maybe just 'sock.inc_io_ref()' and 'sock.dec_io_ref()'?  OTOH using the current 
private socket API in asyncio and uvloop doesn't really scare me as long as it 
works, so keeping the status quo is also OK.

--

___
Python tracker 

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



[issue31324] support._match_test() used by test.bisect is very inefficient

2017-11-16 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

I know :-)

Unfortunately it is not obviously that these optimization actually optimize 
regular expressions. Due to the implementation particularities sometimes 
"unoptimized" code is faster than "optimized". I'm going to implement these 
optimizations in the re module, but it needs to be very careful, and may need 
changing the matching engine.

--

___
Python tracker 

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



[issue32038] Add API to intercept socket.close()

2017-11-16 Thread Guido van Rossum

Guido van Rossum  added the comment:

OK, then maybe socket objects should get a dup() method that just
increments the ref counter, and that would be the public API you're looking
for?

--

___
Python tracker 

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



[issue32038] Add API to intercept socket.close()

2017-11-16 Thread Yury Selivanov

Yury Selivanov  added the comment:

> Perhaps you can just dup() the socket? That's what the ref counter is for 
> IIRC.

I already dup them for loop.create_server(sock=sock) and 
loop.create_connection(sock=sock) cases.  Duping for sock_recv & friends will 
add too much overhead (they are relatively short operations).  Another argument 
against duping is that the number of open FDs is a limited OS resource.

So far Victor's idea of using '_io_refs' sounds like a perfect fit for both 
asyncio and uvloop.  After all, asyncio use case is very similar to 
`socket.makefile()` -- keep the socket object alive while another API relies on 
it.

--

___
Python tracker 

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



[issue32038] Add API to intercept socket.close()

2017-11-16 Thread STINNER Victor

STINNER Victor  added the comment:

> Perhaps you can just dup() the socket? That's what the ref counter is for 
> IIRC.

Sure. That's another option.

But for asyncio with a lot of concurrent users, I'm not sure that it's ok to 
create a temporary file descriptor, since there is a risk of hitting the 
maximum number of open file descriptors :-(

Depending on the platform and the event loop implementation, the limit may be 
low.

--

___
Python tracker 

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



[issue32038] Add API to intercept socket.close()

2017-11-16 Thread Guido van Rossum

Guido van Rossum  added the comment:

Perhaps you can just dup() the socket? That's what the ref counter is for
IIRC.

--

___
Python tracker 

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



[issue31324] support._match_test() used by test.bisect is very inefficient

2017-11-16 Thread STINNER Victor

STINNER Victor  added the comment:

> There is good opportunity for optimizing the regular expression. All cases 
> have the literal 'test.test_asyncio.' prefix, and even longer literal 
> prefixes are common for tens cases.

I implemented such code long time ago :-)

https://github.com/haypo/hachoir3/blob/master/hachoir/regex/regex.py

I'm not sure that this code works on Python 3, it was written for Python 2 but 
not only ported to Python 3 partially.

It only supports a subset of regular expressions.

--

___
Python tracker 

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



[issue32050] Deprecated python3 -x option

2017-11-16 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

Yes, of course. The py launcher is not an alternative to this "hack". It just 
allows you to specify just "py" (with possible options -2, -3, -3.6) instead of 
hardcoding the full name to the Python binary or add the path to directory 
containing the Python binary to your PATH.

--

___
Python tracker 

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



[issue32038] Add API to intercept socket.close()

2017-11-16 Thread Yury Selivanov

Yury Selivanov  added the comment:

> Hmm... _decref_socketios() is not really a public API.  I think it would be 
> nice to have an official way to deal with this, and a socket close callback 
> sounds reasonable to me.


We can just make it public (after some renames) :)  My first idea was to add a 
refcounting API to sockets, I just didn't know it's already there (I assumed 
that socketmodule.c implements the actual 'socket' object, and never even 
looked in socket.py module).

I'll experiment with this stuff in asyncio/uvloop and report back to this issue.

--

___
Python tracker 

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



[issue32038] Add API to intercept socket.close()

2017-11-16 Thread STINNER Victor

STINNER Victor  added the comment:

> Hmm... _decref_socketios() is not really a public API.  I think it would be 
> nice to have an official way to deal with this, and a socket close callback 
> sounds reasonable to me.

I dislike the idea of an event when a socket is closed. It doesn't prevent a 
crash if you are using the socket with the GIL released.

I prefer to "hold" the socket while using it.

--

___
Python tracker 

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



[issue32038] Add API to intercept socket.close()

2017-11-16 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Hmm... _decref_socketios() is not really a public API.  I think it would be 
nice to have an official way to deal with this, and a socket close callback 
sounds reasonable to me.

--

___
Python tracker 

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



[issue32050] Deprecated python3 -x option

2017-11-16 Thread STINNER Victor

STINNER Victor  added the comment:

> @path\to\python -x %0 %1 %2 %3 %4 %5 %6 %7 %8 %9

Oh wow, I never saw that before.

There is now a "py" launcher on Windows, do we still need such "hack"?

--
components: +Windows -Interpreter Core
nosy: +paul.moore, steve.dower, tim.golden, zach.ware

___
Python tracker 

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



[issue32038] Add API to intercept socket.close()

2017-11-16 Thread Yury Selivanov

Yury Selivanov  added the comment:

> Oh, sock._decref_socketios() must be uesd here to really close the socket if 
> it was closed in the meanwhile:

There's also 'sock._closed' attribute that sock.close() and sock. 
_decref_socketios() interact with.. Alright, let me play with this in uvloop.  
So far it looks like we don't need any new APIs :)

--

___
Python tracker 

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



[issue32050] Deprecated python3 -x option

2017-11-16 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

The same as on DOS.

Change the extension of the Python script from .py to .bat, and insert the 
following first line:

@path\to\python -x %0 %1 %2 %3 %4 %5 %6 %7 %8 %9

Now you can run it as a bat-file. The command in the first line will run 
Python, passing the name of this file and up to 9 arguments (you can make it 
passing more than 9 arguments, but I don't remember the syntax). "@" disables 
printing this command itself. The first line is not valid Python syntax, but 
due to the -x option it will be skipped.

--

___
Python tracker 

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



[issue32038] Add API to intercept socket.close()

2017-11-16 Thread Yury Selivanov

Change by Yury Selivanov :


--
Removed message: https://bugs.python.org/msg306374

___
Python tracker 

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



[issue32038] Add API to intercept socket.close()

2017-11-16 Thread Yury Selivanov

Yury Selivanov  added the comment:

> Oh, sock._decref_socketios() must be uesd here to really close the socket if 
> it was closed in the meanwhile:

For it to work correctly, socket objects should be initialized with 
"self._io_refs = 1".

--

___
Python tracker 

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



[issue32038] Add API to intercept socket.close()

2017-11-16 Thread STINNER Victor

STINNER Victor  added the comment:

>From my example: "finally: sock._io_refs -= 1"

Oh, sock._decref_socketios() must be uesd here to really close the socket if it 
was closed in the meanwhile:

def _decref_socketios(self):
if self._io_refs > 0:
self._io_refs -= 1
if self._closed:
self.close()

--

___
Python tracker 

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



[issue32038] Add API to intercept socket.close()

2017-11-16 Thread Yury Selivanov

Yury Selivanov  added the comment:

> The socket.socket (Python type) has a private _io_refs counter. close() does 
> nothing until _io_refs reachs zero.

I didn't know about this.  Looks like I can use '_io_refs' to fix some problems 
in uvloop, thanks Victor!

The only problem with '_io_refs' and `dont_close_socket` approach is that the 
original intent to close the socket is "lost".  Consider this example:

  fut = loop.sock_recv(sock)
  sock.close()
  await fut

Ideally, I'd expect `sock` to be closed right after `await fut` is completed.  
One way to make that possible is to initialize socket object with 
'self._io_refs = 1', not 0.  Whenever it goes to 0, the socket gets closed.  
This is a slight change to the existing machinery, but it would make 
sock.close() more predictable.

--

___
Python tracker 

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



[issue32050] Deprecated python3 -x option

2017-11-16 Thread STINNER Victor

STINNER Victor  added the comment:

> Python still supports Windows.

What is the use case for this option on Windows?

On Unix, the first line is usually used for the shebang, a line like:

   #!/usr/bin/env python3

But this shebang is seen as a comment in Python and Python simply ignore the 
shebang, seen as a comment.

--

___
Python tracker 

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



[issue32050] Deprecated python3 -x option

2017-11-16 Thread STINNER Victor

Change by STINNER Victor :


--
pull_requests: +4371

___
Python tracker 

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



[issue32038] Add API to intercept socket.close()

2017-11-16 Thread STINNER Victor

STINNER Victor  added the comment:

The socket.socket (Python type) has a private _io_refs counter. close() does 
nothing until _io_refs reachs zero.

Maybe we can develop an API to temporary increase the _io_refs counter to 
prevent a real close?

Pseudo-code:

@contextlib.contextmanager
def dont_close_socket(sock):
assert not sock._closed
sock._io_refs += 1
try:
yield sock
finally:
sock._io_refs -= 1

It may be a context manager or a new object. It would probably be better to put 
in the socket.socke type, since it uses private attributes.

--
nosy: +haypo

___
Python tracker 

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



[issue32050] Deprecated python3 -x option

2017-11-16 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

Python still supports Windows.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue32038] Add API to intercept socket.close()

2017-11-16 Thread Yury Selivanov

Yury Selivanov  added the comment:

> It's worse than a resource leak - the same file descriptor number could be 
> reused for a different file/socket, and then depending on the selector in 
> use, you could see the data from a completely different connection. 

I actually debugged a bug like this in asyncio code once.  Took me quite a bit 
of time to figure it out.

> I did see a bug like this years ago (in libcurl), although it's not a common 
> problem. I'd use the proposed hook if it existed, but it seems like an 
> intrusive solution to a rare issue.

I don't think the proposed solution is too intrusive.  If we don't like the 
"set a callback to intercept all socket.close()" idea, we can change it to: 
"add socket.add_close_callback() method to the socket object."

--

___
Python tracker 

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



[issue32040] Sorting pahtlib.Paths does give the same order as sorting the (string) filenames of that pathlib.Paths

2017-11-16 Thread QbLearningPython

QbLearningPython  added the comment:

Thanks, serhiy.storchaka, for your answer.

I am not fully convinced.

You have described the current behaviour of the pathlib package.

But let me ask: should be this the desired behaviour?

Since string filenames and pathlib.Paths are different ways to refer to the 
same object (a path in a filesystem), should not be they behaved in the same 
way when sorting?

You pointed out that the current behaviour is "more natural order" for 
pathlib.Paths. I am not truly sure about that. Can you please provide any 
citation or additional information about that?

Thank you.

--

___
Python tracker 

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



[issue32050] Deprecated python3 -x option

2017-11-16 Thread STINNER Victor

STINNER Victor  added the comment:

The note in the documentation is wrong: the line number is correct when using 
the -x option, even if the first line is skipped.

Example with Python 2.7:
---
$ cat x.py 
print(1)
print(2)
x

$ python2 x.py 
1
2
Traceback (most recent call last):
  File "x.py", line 3, in 
x
NameError: name 'x' is not defined

$ python2 -x x.py 
2
Traceback (most recent call last):
  File "x.py", line 3, in 
x
NameError: name 'x' is not defined
---

Attached PR 4423 fixes Python 2.7 documentation.

--

___
Python tracker 

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



[issue32050] Deprecated python3 -x option

2017-11-16 Thread STINNER Victor

Change by STINNER Victor :


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

___
Python tracker 

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



[issue32050] Deprecated python3 -x option

2017-11-16 Thread STINNER Victor

New submission from STINNER Victor :

Python has a -x option documented as a "DOS specific hack only":
https://docs.python.org/dev/using/cmdline.html#cmdoption-x

Python doesn't support MS-DOS since Python 2.1:
https://www.python.org/dev/peps/pep-0011/#no-longer-supported-platforms

I propose to deprecate the option in Python 3.7: using it emits a 
DeprecationWarning, option deprecated in the documentation; and remove the 
option in Python 3.8.

--
components: Interpreter Core
messages: 306365
nosy: haypo
priority: normal
severity: normal
status: open
title: Deprecated python3 -x option
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



[issue31324] support._match_test() used by test.bisect is very inefficient

2017-11-16 Thread STINNER Victor

Change by STINNER Victor :


--
pull_requests: +4369

___
Python tracker 

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



[issue28450] Misleading/inaccurate documentation about unknown escape sequences in regular expressions

2017-11-16 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

Barry, could you please improve the documentation about unknown escape 
sequences in regular expressions? My skills is not enough for this.

--

___
Python tracker 

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



[issue30148] Pathological regex behaviour

2017-11-16 Thread Serhiy Storchaka

Change by Serhiy Storchaka :


--
nosy: +serhiy.storchaka
resolution:  -> wont fix
stage:  -> resolved
status: open -> closed

___
Python tracker 

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



[issue32046] 2to3 fix for operator.isCallable()

2017-11-16 Thread Dong-hee Na

Change by Dong-hee Na :


--
nosy: +corona10

___
Python tracker 

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



[issue31324] support._match_test() used by test.bisect is very inefficient

2017-11-16 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

$ time ./python -m test.bisect --fail-env-changed -o bisect test_asyncio -N1
...
Bisection failed after 2 iterations and 0:00:11

real0m10,441s
user0m8,726s
sys 0m0,292s

There is good opportunity for optimizing the regular expression. All cases have 
the literal 'test.test_asyncio.' prefix, and even longer literal prefixes are 
common for tens cases.

--

___
Python tracker 

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



[issue31324] support._match_test() used by test.bisect is very inefficient

2017-11-16 Thread STINNER Victor

STINNER Victor  added the comment:

I tested manually Serhiy's PR 4420: it works as expected!

haypo@selma$ ./python -m test test_os --list-cases -m 
test.test_os.FileTests.test_access
test.test_os.FileTests.test_access

haypo@selma$ ./python -m test test_os --list-cases -m test_access
test.test_os.FileTests.test_access

haypo@selma$ ./python -m test test_os --list-cases -m FileTests
test.test_os.FileTests.test_access
test.test_os.FileTests.test_closerange
test.test_os.FileTests.test_fdopen
test.test_os.FileTests.test_large_read
test.test_os.FileTests.test_open_keywords
test.test_os.FileTests.test_read
test.test_os.FileTests.test_rename
test.test_os.FileTests.test_replace
test.test_os.FileTests.test_symlink_keywords
test.test_os.FileTests.test_write
test.test_os.FileTests.test_write_windows_console

haypo@selma$ ./python -m test test_os --list-cases -m 'FileTest*'
test.test_os.FileTests.test_access
test.test_os.FileTests.test_closerange
test.test_os.FileTests.test_fdopen
test.test_os.FileTests.test_large_read
test.test_os.FileTests.test_open_keywords
test.test_os.FileTests.test_read
test.test_os.FileTests.test_rename
test.test_os.FileTests.test_replace
test.test_os.FileTests.test_symlink_keywords
test.test_os.FileTests.test_write
test.test_os.FileTests.test_write_windows_console

haypo@selma$ ./python -m test test_os --list-cases -m 'test_acc*'
test.test_os.FileTests.test_access
test.test_os.StatAttributeTests.test_access_denied

haypo@selma$ ./python -m test test_os --list-cases -m '*FileTests.test_access'
test.test_os.FileTests.test_access

--

___
Python tracker 

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



[issue31324] support._match_test() used by test.bisect is very inefficient

2017-11-16 Thread Serhiy Storchaka

Change by Serhiy Storchaka :


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

___
Python tracker 

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



[issue28951] re.flags not documented in Module Contents as promised.

2017-11-16 Thread Serhiy Storchaka

Change by Serhiy Storchaka :


Removed file: https://bugs.python.org/file45934/unnamed

___
Python tracker 

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



[issue28951] re.flags not documented in Module Contents as promised.

2017-11-16 Thread Serhiy Storchaka

Change by Serhiy Storchaka :


Removed file: https://bugs.python.org/file45940/unnamed

___
Python tracker 

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



[issue28951] re.flags not documented in Module Contents as promised.

2017-11-16 Thread Serhiy Storchaka

Change by Serhiy Storchaka :


--
components: +Regular Expressions
nosy: +ezio.melotti, mrabarnett
stage:  -> needs patch
versions: +Python 2.7, Python 3.6, Python 3.7 -Python 3.5

___
Python tracker 

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



[issue28951] re.flags not documented in Module Contents as promised.

2017-11-16 Thread Serhiy Storchaka

Change by Serhiy Storchaka :


Removed file: https://bugs.python.org/file45941/unnamed

___
Python tracker 

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



[issue30004] in regex-howto, improve example on grouping

2017-11-16 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

Do you mind to create a pull request on GitHub Cristian?

--
components: +Regular Expressions
nosy: +ezio.melotti, mrabarnett, serhiy.storchaka
stage:  -> needs patch
versions:  -Python 3.3, Python 3.4, Python 3.5

___
Python tracker 

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



[issue32047] asyncio: enable debug mode when -X dev is used

2017-11-16 Thread STINNER Victor

STINNER Victor  added the comment:

I sent an email about this change to python-dev: 
https://mail.python.org/pipermail/python-dev/2017-November/150572.html

--

___
Python tracker 

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



[issue25054] Capturing start of line '^'

2017-11-16 Thread Serhiy Storchaka

Change by Serhiy Storchaka :


--
assignee:  -> serhiy.storchaka
nosy: +serhiy.storchaka
versions: +Python 2.7, Python 3.7 -Python 3.5

___
Python tracker 

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



[issue24555] Python logic error when deal with re and muti-threading

2017-11-16 Thread Serhiy Storchaka

Change by Serhiy Storchaka :


--
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> re functions never release GIL

___
Python tracker 

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



[issue32049] 2.7.14 does not uninstall cleanly if installation was run as SYSTEM account (SCCM)

2017-11-16 Thread Sven Pagel

New submission from Sven Pagel :

If I install Python 2.7.14 on Windows (using the MSI) using the SYSTEM account, 
as is done by SCCM, uninstalling fails to clean up the registry so Python is 
still showing up as installed in the control panel (and still detected by SCCM).

SCCM runs the following command line to install Python:
msiexec /i "python-2.7.14.amd64.msi" ADDLOCAL=ALL /qn

For uninstallation I use the following command line:
msiexec /x {0398A685-FD8D-46B3-9816-C47319B0CF5F}

Both are run as the SYSTEM account.

--
components: Installation, Windows
messages: 306359
nosy: niemalsnever, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: 2.7.14 does not uninstall cleanly if installation was run as SYSTEM 
account (SCCM)
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



[issue9134] sre bug: lastmark_save/restore

2017-11-16 Thread Serhiy Storchaka

Change by Serhiy Storchaka :


--
assignee:  -> serhiy.storchaka
versions: +Python 3.6, Python 3.7 -Python 3.4, Python 3.5

___
Python tracker 

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



[issue23691] re.finditer iterator is not reentrant, but doesn't protect against nested calls to __next__

2017-11-16 Thread Serhiy Storchaka

Change by Serhiy Storchaka :


--
assignee:  -> serhiy.storchaka
nosy: +serhiy.storchaka
stage:  -> needs patch
versions: +Python 2.7, Python 3.6, Python 3.7 -Python 3.4

___
Python tracker 

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



[issue23689] Memory leak in Modules/sre_lib.h

2017-11-16 Thread Serhiy Storchaka

Change by Serhiy Storchaka :


--
versions: +Python 3.6, Python 3.7 -Python 3.4, Python 3.5

___
Python tracker 

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



[issue30133] Strings that end with properly escaped backslashes cause error to be thrown in re.search/sub/etc. functions.

2017-11-16 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

The proper way of escaping the replacement string has been documented by 
issue31714.

--
resolution:  -> out of date
stage:  -> resolved
status: open -> closed
superseder:  -> Improve re documentation

___
Python tracker 

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



[issue32043] Add a new -X dev option: "developer mode"

2017-11-16 Thread STINNER Victor

STINNER Victor  added the comment:

Antoine Pitrou asked me to document the performance and memory overhead of -X 
dev:

https://mail.python.org/pipermail/python-dev/2017-November/150578.html

For example, I measured an increase of +50% on the peak memory usage (measured 
by tracemalloc) when running test_os.

Antoine proposed:

"""Currently, developer mode adds negligible CPU time overhead, but can
increase memory consumption significantly if many small objects are
allocated.  This is subject to change in the future."""

https://mail.python.org/pipermail/python-dev/2017-November/150579.html

--

___
Python tracker 

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



[issue32048] Misprint in the unittest.mock documentation.

2017-11-16 Thread Артемий Родионов

Change by Артемий Родионов :


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



[issue32048] Misprint in the unittest.mock documentation.

2017-11-16 Thread Артемий Родионов

Change by Артемий Родионов :


--
assignee: docs@python
components: Documentation
nosy: docs@python, Артемий Родионов
priority: normal
severity: normal
status: open
title: Misprint in the unittest.mock documentation.
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



[issue31701] faulthandler dumps 'Windows fatal exception: code 0xe06d7363'

2017-11-16 Thread STINNER Victor

STINNER Victor  added the comment:

I backported the fix to Python 3.6.

@Steve Dower: What do you think of using SetUnhandledExceptionFilter?

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



[issue31701] faulthandler dumps 'Windows fatal exception: code 0xe06d7363'

2017-11-16 Thread STINNER Victor

STINNER Victor  added the comment:


New changeset 33217d22131ab1ffaa09a6944bae704f722f25a9 by Victor Stinner in 
branch '3.6':
bpo-31701: faulthandler: ignore MSC and COM Windows exception (#3929) (#4416)
https://github.com/python/cpython/commit/33217d22131ab1ffaa09a6944bae704f722f25a9


--

___
Python tracker 

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



[issue31701] faulthandler dumps 'Windows fatal exception: code 0xe06d7363'

2017-11-16 Thread STINNER Victor

STINNER Victor  added the comment:

> May I ask why AddVectoredExceptionHandler is used instead of 
> SetUnhandledExceptionFilter?

Honestly, I don't know well Windows API and so I'm not sure which one is the 
best.

https://stackoverflow.com/questions/28629351/is-addvectoredexceptionhandler-a-replacement-for-setunhandledexceptionfilter

--

___
Python tracker 

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



[issue32047] asyncio: enable debug mode when -X dev is used

2017-11-16 Thread STINNER Victor

Change by STINNER Victor :


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

___
Python tracker 

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



[issue32047] asyncio: enable debug mode when -X dev is used

2017-11-16 Thread STINNER Victor

New submission from STINNER Victor :

The bpo-32043 added a new "developer mode" enabled with the new -X dev command 
line option.

I propose to enable asyncio debug mode with the global Python "developer mode".

If an asyncio application is correctly written, the single side effect of -X 
dev would be to log "Executing ... took ... seconds" if a handle took longer 
than 100 ms. Well, a handle should *not* take longer than 100 ms. So maybe it's 
ok to start logging such events in the "developer mode", no?


Example with attached block_loop.py script which blocks the event loop.

(1) This command doesn't display anything:

haypo@selma$ ./python block_loop.py 


(2) In developer mode, the warning a emitted to warn the developer about the 
bug:

$ ./python -X dev block_loop.py 
Executing  
result=None created at 
/home/haypo/prog/python/master/Lib/asyncio/base_events.py:444> took 1.002 
seconds

--
components: asyncio
files: block_loop.py
messages: 306353
nosy: haypo, yselivanov
priority: normal
severity: normal
status: open
title: asyncio: enable debug mode when -X dev is used
versions: Python 3.7
Added file: https://bugs.python.org/file47269/block_loop.py

___
Python tracker 

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



[issue31702] Allow to specify the number of rounds for SHA-* hashing in crypt

2017-11-16 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:


New changeset cede8c9edb408321b493d8d5e73be9e1018020e4 by Serhiy Storchaka in 
branch 'master':
bpo-31702: Allow to specify rounds for SHA-2 hashing in crypt.mksalt(). (#4110)
https://github.com/python/cpython/commit/cede8c9edb408321b493d8d5e73be9e1018020e4


--

___
Python tracker 

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



[issue31702] Allow to specify the number of rounds for SHA-* hashing in crypt

2017-11-16 Thread Serhiy Storchaka

Change by Serhiy Storchaka :


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



[issue32043] Add a new -X dev option: "developer mode"

2017-11-16 Thread STINNER Victor

STINNER Victor  added the comment:


New changeset ccb0442a338066bf40fe417455e5a374e5238afb by Victor Stinner in 
branch 'master':
bpo-32043: New "developer mode": "-X dev" option (#4413)
https://github.com/python/cpython/commit/ccb0442a338066bf40fe417455e5a374e5238afb


--

___
Python tracker 

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



[issue32046] 2to3 fix for operator.isCallable()

2017-11-16 Thread Dong-hee Na

Change by Dong-hee Na :


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

___
Python tracker 

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



[issue31701] faulthandler dumps 'Windows fatal exception: code 0xe06d7363'

2017-11-16 Thread STINNER Victor

Change by STINNER Victor :


--
pull_requests: +4365

___
Python tracker 

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



[issue24896] It is undocumented that re.UNICODE and re.LOCALE affect re.IGNORECASE

2017-11-16 Thread Serhiy Storchaka

Change by Serhiy Storchaka :


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

___
Python tracker 

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



[issue30349] Preparation for advanced set syntax in regular expressions

2017-11-16 Thread Serhiy Storchaka

Change by Serhiy Storchaka :


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



[issue31672] string.Template should use re.ASCII flag

2017-11-16 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

Is something left to do here?

In 3.7 r'(?-i:[_a-zA-Z][_a-zA-Z0-9]*)' can be replaced with 
r'(?a:[_a-z][_a-z0-9]*)' if it will add clarity.

--

___
Python tracker 

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



[issue30349] Preparation for advanced set syntax in regular expressions

2017-11-16 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:


New changeset 05cb728d68a278d11466f9a6c8258d914135c96c by Serhiy Storchaka in 
branch 'master':
bpo-30349: Raise FutureWarning for nested sets and set operations (#1553)
https://github.com/python/cpython/commit/05cb728d68a278d11466f9a6c8258d914135c96c


--

___
Python tracker 

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



  1   2   >