[issue38842] test_multiprocessing_spawn altered the execution environment in AMD64 FreeBSD Non-Debug 3.x

2019-11-18 Thread STINNER Victor


STINNER Victor  added the comment:

Pablo: Feel free to close this issue as duplicate, or leave it open to track 
the original "resource_tracker" warning.

--

___
Python tracker 

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



[issue38842] test_multiprocessing_spawn altered the execution environment in AMD64 FreeBSD Non-Debug 3.x

2019-11-18 Thread STINNER Victor


STINNER Victor  added the comment:

AMD64 RHEL7 3.8 was marked as failed because of:
https://buildbot.python.org/all/#/builders/279/builds/136

test_max_workers_too_large 
(test.test_concurrent_futures.ProcessPoolSpawnProcessPoolExecutorTest) ... 
skipped 'Windows-only process limit'
test_no_stale_references 
(test.test_concurrent_futures.ProcessPoolSpawnProcessPoolExecutorTest) ... 
0.57s ok
test_ressources_gced_in_workers 
(test.test_concurrent_futures.ProcessPoolSpawnProcessPoolExecutorTest) ... 
1.78s ok
test_shutdown_race_issue12456 
(test.test_concurrent_futures.ProcessPoolSpawnProcessPoolExecutorTest) ... 0.42s
Warning -- reap_children() reaped child process 11860
ok

The test_concurrent_futures reap_children() issue is tracked as bpo-38546.

--

___
Python tracker 

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



[issue38842] test_multiprocessing_spawn altered the execution environment in AMD64 FreeBSD Non-Debug 3.x

2019-11-18 Thread STINNER Victor


STINNER Victor  added the comment:

The build was marked as failed because of this warning:

https://buildbot.python.org/all/#/builders/368/builds/98

...
test_rlock (test.test_multiprocessing_spawn.WithProcessesTestLock) ... ok
test_enable_logging (test.test_multiprocessing_spawn.WithProcessesTestLogging) 
... ok
test_level (test.test_multiprocessing_spawn.WithProcessesTestLogging) ... ok
test_rapid_restart 
(test.test_multiprocessing_spawn.WithProcessesTestManagerRestart) ... ok
Warning -- Dangling processes: {}

This warning is tracked as bpo-38447.

--
nosy: +vstinner

___
Python tracker 

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



[issue38837] struct.pack: Unable to pack more than 256 bytes at a time

2019-11-18 Thread Mark Dickinson


Mark Dickinson  added the comment:

The error you're getting is because you're trying to pack a *value* that's 
larger than 255, not because you're trying to pack more than 256 bytes. Packing 
more than 256 bytes at a time works fine for me.

>>> packed = struct.pack("<512B", *[n//2 for n in range(512)])  # fine
>>> packed = struct.pack("2B", *[255, 256])
Traceback (most recent call last):
  File "", line 1, in 
struct.error: ubyte format requires 0 <= number <= 255

--
nosy: +mark.dickinson

___
Python tracker 

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



[issue38823] Improve stdlib module initialization error handling.

2019-11-18 Thread Brandt Bucher


Change by Brandt Bucher :


--
pull_requests: +16747
pull_request: https://github.com/python/cpython/pull/17250

___
Python tracker 

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



[issue38807] Better exception message in os.path.join

2019-11-18 Thread Raymond Hettinger


Raymond Hettinger  added the comment:


New changeset b5bb3b637c6b55f49d8979a5f489d01a67c4f917 by Raymond Hettinger 
(Miss Islington (bot)) in branch '3.8':
bpo-38807: Add os.PathLike to exception message raised by _check_arg_types 
(GH-17160) (GH-17249)
https://github.com/python/cpython/commit/b5bb3b637c6b55f49d8979a5f489d01a67c4f917


--

___
Python tracker 

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



[issue38807] Better exception message in os.path.join

2019-11-18 Thread Raymond Hettinger

Raymond Hettinger  added the comment:


New changeset fe75b62575bcfdf1c39be71c1e50257832a596db by Raymond Hettinger 
(Tomás Farías) in branch 'master':
bpo-38807: Add os.PathLike to exception message raised by _check_arg_types 
(#17160)
https://github.com/python/cpython/commit/fe75b62575bcfdf1c39be71c1e50257832a596db


--
nosy: +rhettinger

___
Python tracker 

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



[issue38807] Better exception message in os.path.join

2019-11-18 Thread miss-islington


Change by miss-islington :


--
pull_requests: +16746
pull_request: https://github.com/python/cpython/pull/17249

___
Python tracker 

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



[issue38807] Better exception message in os.path.join

2019-11-18 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

Thanks for the report and for the PR.

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



[issue38843] Document argparse behaviour when custom namespace object already has the field set

2019-11-18 Thread Ivan Kurnosov


Ivan Kurnosov  added the comment:

> I have not seen many questions about the use of a preexisting namespace 
> object (here or on StackOverflow)

as typing was added to the language natively - it should become more and more 
frequently used.

I personally see no reason anymore to NOT use a custom namespace: typed 
arguments object is x100 times better than untyped one.

--

___
Python tracker 

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



[issue38843] Document argparse behaviour when custom namespace object already has the field set

2019-11-18 Thread paul j3


paul j3  added the comment:

It doesn't have to be a special class. It can be a `argparse.Namespace` object. 
 If the preexisting namespace has an attribute set, the action default will not 
over write it.

In [85]: parser = argparse.ArgumentParser() 
...: parser.add_argument('--foo', default='bar') 
...: parser.parse_args([],
 namespace=argparse.Namespace(foo=123, baz=132))   
Out[85]: Namespace(baz=132, foo=123)

This is described in comments at the start of parse_known_args()


# add any action defaults that aren't present
for action in self._actions:
if action.dest is not SUPPRESS:
if not hasattr(namespace, action.dest):
if action.default is not SUPPRESS:
setattr(namespace, action.dest, action.default)

# add any parser defaults that aren't present
for dest in self._defaults:
if not hasattr(namespace, dest):
setattr(namespace, dest, self._defaults[dest])

There are many details about 'defaults' that are not documented.  This might 
not be the most significant omission.  

I have not seen many questions about the use of a preexisting namespace object 
(here or on StackOverflow).  While such a namespace can be used to set custom 
defaults (as shown here), I think it is more useful when using a custom 
Namespace class, one the defines special behavior.

Originally the main parser's namespace was passed to subparsers.  But a change 
in 2014, gave the subparser a fresh namespace, and then copied values from it 
back to the main namespace.  While that gave more power to the subparser's 
defaults, users lost some ability to use their own namespace class.

https://bugs.python.org/issue27859 - argparse - subparsers does not retain 
namespace

https://bugs.python.org/issue9351 - argparse set_defaults on subcommands should 
override top level set_defaults

https://bugs.python.org/issue34827 - Make argparse.NameSpace iterable (closed)

--

___
Python tracker 

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



[issue38789] difflib lacks a way to check if results are empty

2019-11-18 Thread Tim Peters


Tim Peters  added the comment:

I'm taking Raymond's advice to close this for now.  The issue tracker isn't the 
right place to work out ideas - python-ideas is far better for that 
(StackOverflow isn't a good place for that either - StackOverflow is best for 
when you have a very specific use case and get stuck).

While the issues with generators are common to all generators, in the context 
of difflib something else Raymond said should be taken to heart:  using any 
difflib facility is an extremely expensive way to find out that two things are 
equal.  That's a value of use cases!  That is, if you had asked about this on 
StackOverflow and asked for help instead of proposing "a (vague) solution", 
they would have told you at once to check whether `a == b` before dragging 
difflib into it.

Indeed, that's probably why what you're asking about never came up before.  
People generally use difflib only when they know in advance (via a cheap 
equality test) that there _are_ differences to be found.

In any case, if a "specific & actionable" suggestion comes out of pursuing 
this, feel encouraged to open this report again!

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

___
Python tracker 

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



[issue38844] test_multiprocessing_fork emit user warning

2019-11-18 Thread Dong-hee Na


Dong-hee Na  added the comment:

Duplicated with issue38842

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



[issue38844] test_multiprocessing_fork emit user warning

2019-11-18 Thread Dong-hee Na


New submission from Dong-hee Na :

https://travis-ci.org/python/cpython/jobs/613795145#L2020

Log detail:
0:01:44 load avg: 3.38 [ 73/419] test_multiprocessing_fork passed (1 min 42 
sec) -- running: test_capi (1 min 40 sec)
/home/travis/build/python/cpython/Lib/multiprocessing/resource_tracker.py:203: 
UserWarning: resource_tracker: There appear to be 1 leaked shared_memory 
objects to clean up at shutdown
  warnings.warn('resource_tracker: There appear to be %d '
/home/travis/build/python/cpython/Lib/multiprocessing/resource_tracker.py:216: 
UserWarning: resource_tracker: '/psm_83d846d5': [Errno 2] No such file or 
directory: '/psm_83d846d5'

--
components: Tests
messages: 356940
nosy: corona10
priority: normal
severity: normal
status: open
title: test_multiprocessing_fork emit user warning
versions: Python 3.9

___
Python tracker 

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



[issue38843] Document argparse behaviour when custom namespace object already has the field set

2019-11-18 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +paul.j3, rhettinger

___
Python tracker 

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



[issue38843] Document argparse behaviour when custom namespace object already has the field set

2019-11-18 Thread Ivan Kurnosov


New submission from Ivan Kurnosov :

At this moment it's impossible to explain the behaviour of this script using 
documentation.

Given it was explicitly coded to behave like that - it should be somehow noted 
in the documentation, that as long as a `CliArgs.foo` field has a default value 
set already - it won't be overwritten with a default argparse argument value.


```
import argparse

class CliArgs(object):
foo: str = 'not touched'


parser = argparse.ArgumentParser()
parser.add_argument('--foo', default='bar')

args = CliArgs()
parser.parse_args(namespace=args)
print(args.foo) # 'not touched'

print(parser.parse_args()) # 'bar'
```

--
assignee: docs@python
components: Documentation
messages: 356939
nosy: docs@python, zerkms
priority: normal
severity: normal
status: open
title: Document argparse behaviour when custom namespace object already has the 
field set

___
Python tracker 

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



[issue22367] Add open_file_descriptor parameter to fcntl.lockf() (use the new F_OFD_SETLK flag)

2019-11-18 Thread Dong-hee Na


Dong-hee Na  added the comment:

Steve approved this PR 17154 but we need one more reviewer to review this PR.
I hope we can reflect PR 17154 before alpha1 is released.

--

___
Python tracker 

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



[issue37195] test_utime fails on MacOS Mojave (Kernel Version 18.6.0:)

2019-11-18 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

I have not noticed it in a while, so I will close it for now unless I can 
reproduce it again.

--
resolution:  -> postponed
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



[issue34792] Tutorial doesn''t discuss / and * function arguments

2019-11-18 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

I don't think we should backport the changes or modify the file for the 3.7 
branch, so I close the issue. Feel free to reopen if you still think it makes 
sense :)

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

___
Python tracker 

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



[issue36287] Make ast.dump() not output optional default fields

2019-11-18 Thread Emmanuel Arias


Emmanuel Arias  added the comment:

Hi, 

Sorry sincerely I forgot this issue, if there are not any objection I can 
continue it.

--

___
Python tracker 

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



[issue37083] Document TYPE_COMMENT in documentation reference for compound statements

2019-11-18 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

I am convinced by Guido's reasoning, I think we can close the issue.

--
resolution:  -> rejected
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



[issue38446] Ambiguous signature for builtins.__build_class__

2019-11-18 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

>  @pablogsal can we close it?

Yup, thanks for the ping, Batuhan

--

___
Python tracker 

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



[issue38842] test_multiprocessing_spawn altered the execution environment in AMD64 FreeBSD Non-Debug 3.x

2019-11-18 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

The last test may have a different explanation, though

--

___
Python tracker 

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



[issue38842] test_multiprocessing_spawn altered the execution environment in AMD64 FreeBSD Non-Debug 3.x

2019-11-18 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

Another failure that seems related:

https://buildbot.python.org/all/#/builders/279/builds/136


Ran 168 tests in 154.704s
OK (skipped=3)
Warning -- multiprocessing.process._dangling was modified by 
test_concurrent_futures
  Before: set()
  After:  {}

--

___
Python tracker 

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



[issue38842] test_multiprocessing_spawn altered the execution environment in AMD64 FreeBSD Non-Debug 3.x

2019-11-18 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

https://buildbot.python.org/all/#builders/368/builds/98

--

___
Python tracker 

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



[issue38842] test_multiprocessing_spawn altered the execution environment in AMD64 FreeBSD Non-Debug 3.x

2019-11-18 Thread Pablo Galindo Salgado

New submission from Pablo Galindo Salgado :

Ran 352 tests in 243.972s
OK (skipped=34)
/usr/home/buildbot/python/3.x.koobs-freebsd-9e36.nondebug/build/Lib/multiprocessing/resource_tracker.py:203:
 UserWarning: resource_tracker: There appear to be 1 leaked shared_memory 
objects to clean up at shutdown
  warnings.warn('resource_tracker: There appear to be %d '
/usr/home/buildbot/python/3.x.koobs-freebsd-9e36.nondebug/build/Lib/multiprocessing/resource_tracker.py:216:
 UserWarning: resource_tracker: '/psm_5b8ca94b': [Errno 2] No such file or 
directory: '/psm_5b8ca94b'
  warnings.warn('resource_tracker: %r: %s' % (name, e))


1 test altered the execution environment:
    test_multiprocessing_spawn

It seems that the shared memory leaked is causing the test to fail. 

--
components: Tests
messages: 356929
nosy: pablogsal
priority: normal
severity: normal
status: open
title: test_multiprocessing_spawn altered the execution environment in AMD64 
FreeBSD Non-Debug 3.x
versions: Python 3.9

___
Python tracker 

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



[issue27724] PEP3119 inconsintent with actual CPython impl

2019-11-18 Thread Batuhan


Change by Batuhan :


--
nosy: +BTaskaya, gvanrossum
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



[issue37228] UDP sockets created by create_datagram_endpoint() allow by default multiple processes to bind the same port

2019-11-18 Thread David Cuthbert


David Cuthbert  added the comment:

How much harm would there be in bringing the DeprecationWarning into the next 
patch of existing (3.6, 3.7, 3.8) releases? The security implications are 
significant enough that I'd want to be notified of it in my software ASAP.

Users can (and should!) squelch the warning by passing the setting explicitly.

--
nosy: +dacut

___
Python tracker 

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



[issue19080] Enrich SyntaxError with additional information

2019-11-18 Thread Batuhan


Batuhan  added the comment:

I am not sure about how to implement this to the core, but you can combine 
tokenize with ast to reproduce this kind of messages in your projects. You can 
match tokens with SyntaxErrors by lineno and offset.

--
nosy: +BTaskaya

___
Python tracker 

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



[issue31521] segfault in PyBytes_AsString

2019-11-18 Thread Batuhan


Batuhan  added the comment:

Is there a simpler code for reproducing the issue?

--
nosy: +BTaskaya

___
Python tracker 

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



[issue36287] Make ast.dump() not output optional default fields

2019-11-18 Thread Batuhan


Batuhan  added the comment:

@eamanu are you still interested in this issue? (bumped to 3.9)

--
nosy: +BTaskaya
versions: +Python 3.9

___
Python tracker 

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



[issue38841] [asyncio] bind() on a unix socket raises PermissionError on Android for a non-root user

2019-11-18 Thread Xavier de Gaye


New submission from Xavier de Gaye :

This is the same kind of issue as reported in #28684.


python -m test -v test_asyncio -m 
test_create_datagram_endpoint_existing_sock_unix
== CPython 3.9.0a0 (heads/abifa-dirty:cf805c25e6, Nov 18 2019, 16:40:26) [Clang 
8.0.2 (https://andro
id.googlesource.com/toolchain/clang 40173bab62ec7462
== Linux-3.10.0+-x86_64-with-libc little-endian
== cwd: /data/local/tmp/python/tmp/test_python_6046
== CPU count: 2
== encodings: locale=UTF-8, FS=utf-8
0:00:00 Run tests sequentially
test_create_datagram_endpoint_existing_sock_unix 
(test.test_asyncio.test_base_events.BaseEventLoopWithSelectorTests) ... ERROR
/data/local/tmp/python/lib/python3.9/unittest/case.py:687: ResourceWarning: 
unclosed 
  outcome.errors.clear()
ResourceWarning: Enable tracemalloc to get the object allocation traceback
==
ERROR: test_create_datagram_endpoint_existing_sock_unix 
(test.test_asyncio.test_base_events.BaseEven
tLoopWithSelectorTests)
--
Traceback (most recent call last):
  File 
"/data/local/tmp/python/lib/python3.9/test/test_asyncio/test_base_events.py", 
line 1707, in t
est_create_datagram_endpoint_existing_sock_unix
sock.bind(path)
PermissionError: [Errno 13] Permission denied

--

Ran 1 test in 0.014s

FAILED (errors=1)
test test_asyncio failed
test_asyncio failed

== Tests result: FAILURE ==

1 test failed:
test_asyncio

Total duration: 542 ms
Tests result: FAILURE

--
components: asyncio
messages: 356924
nosy: asvetlov, xdegaye, yselivanov
priority: normal
severity: normal
stage: needs patch
status: open
title: [asyncio] bind() on a unix socket raises PermissionError on Android for 
a non-root user
type: behavior
versions: Python 3.9

___
Python tracker 

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



[issue22593] Automate update of doc references to UCD version when it changes.

2019-11-18 Thread Batuhan


Batuhan  added the comment:

I want to work on this. What do you think about using include directive and 
include a static file like UCD_VERSION.txt in the documents?

makeunicodedata.py can write the current version every run to UCD_VERSION.txt

--
nosy: +BTaskaya

___
Python tracker 

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



[issue38840] incorrect __all__ list in multiprocessing.managers module

2019-11-18 Thread Xavier de Gaye


New submission from Xavier de Gaye :

On android which is a platform that is missing the shared memory 
implementation, test___all__ fails because 'multiprocessing.managers' has no 
attribute 'SharedMemoryManager' which is listed in __all__.


2|generic_x86_64:/data/local/tmp/python $ python
Python 3.9.0a0 (heads/abifa-dirty:cf805c25e6, Nov 18 2019, 16:40:26) 
[Clang 8.0.2 (https://android.googlesource.com/toolchain/clang 40173bab62ec7462 
on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import multiprocessing.shared_memory
Traceback (most recent call last):
  File "", line 1, in 
  File "/data/local/tmp/python/lib/python3.9/multiprocessing/shared_memory.py", 
line 22, in 
import _posixshmem
ModuleNotFoundError: No module named '_posixshmem'
>>> 


2|generic_x86_64:/data/local/tmp/python $ python -m test test___all__
0:00:00 Run tests sequentially
0:00:00 [1/1] test___all__
test test___all__ failed -- Traceback (most recent call last):
  File "/data/local/tmp/python/lib/python3.9/test/test___all__.py", line 38, in 
check_all
exec("from %s import *" % modname, names)
AttributeError: module 'multiprocessing.managers' has no attribute 
'SharedMemoryManager'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/data/local/tmp/python/lib/python3.9/test/test___all__.py", line 41, in 
check_all
self.fail("__all__ failure in {}: {}: {}".format(
AssertionError: __all__ failure in multiprocessing.managers: AttributeError: 
module 'multiprocessing.managers' has no attribute 'SharedMemoryManager'

test___all__ failed

== Tests result: FAILURE ==

1 test failed:
test___all__

Total duration: 1.8 sec
Tests result: FAILURE

--
components: Library (Lib)
messages: 356922
nosy: xdegaye
priority: normal
severity: normal
stage: needs patch
status: open
title: incorrect __all__ list in multiprocessing.managers module
type: behavior
versions: Python 3.9

___
Python tracker 

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



[issue32371] Delay-loading of python dll is impossible when using some C macros

2019-11-18 Thread Batuhan


Batuhan  added the comment:

Can you give us a case where we can reproduce this locally?

--
nosy: +BTaskaya

___
Python tracker 

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



[issue35943] PyImport_GetModule() can return partially-initialized module

2019-11-18 Thread Valentyn Tymofieiev


Valentyn Tymofieiev  added the comment:

Do we plan to backport the change by nanjekyejoannah to 3.7 branch?

--
nosy: +Valentyn Tymofieiev

___
Python tracker 

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



[issue38839] Some unused functions in test suite

2019-11-18 Thread Adam Johnson


New submission from Adam Johnson :

Whilst developing a new unused function check for flake8 ( 
https://github.com/PyCQA/pyflakes/pull/485 ) I ran it against the CPython 
source code and found some uncalled functions.

--
messages: 356919
nosy: adamchainz
priority: normal
pull_requests: 16745
severity: normal
status: open
title: Some unused functions in test suite
type: enhancement

___
Python tracker 

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



[issue22229] wsgiref doesn't appear to ever set REMOTE_HOST in the environ

2019-11-18 Thread Batuhan


Batuhan  added the comment:

I didn't understand the issue. WSGIRequestHandler can be subclassed and 
address_string method may return something else.

--
nosy: +BTaskaya

___
Python tracker 

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



[issue38622] _ctypes.dlsym (py_dl_sym) does not trigger audit hooks

2019-11-18 Thread Steve Dower


Change by Steve Dower :


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



[issue38622] _ctypes.dlsym (py_dl_sym) does not trigger audit hooks

2019-11-18 Thread miss-islington


miss-islington  added the comment:


New changeset bec7015dcc421a68cde030c5e4ca8e28408ef52d by Miss Islington (bot) 
in branch '3.8':
bpo-38622: Ensure ctypes.PyObj_FromPtr audit event passes tuples as a single 
argument (GH-17243)
https://github.com/python/cpython/commit/bec7015dcc421a68cde030c5e4ca8e28408ef52d


--

___
Python tracker 

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



[issue38722] runpy should use io.open_code() instead of open()

2019-11-18 Thread miss-islington


miss-islington  added the comment:


New changeset e37767bee1f7f1940b30768d21bfe2ae68c20a5f by Miss Islington (bot) 
in branch '3.8':
bpo-38722: Runpy use io.open_code() (GH-17234)
https://github.com/python/cpython/commit/e37767bee1f7f1940b30768d21bfe2ae68c20a5f


--

___
Python tracker 

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



[issue38822] Inconsistent os.stat behavior for directory with Access Denied

2019-11-18 Thread Eryk Sun


Eryk Sun  added the comment:

In attributes_from_dir() in Modules/posixmodule.c, a trailing backslash or 
slash should be stripped from the lpFileName parameter of FindFirstFileW. 
Otherwise the call opens the directory via NtOpenFile, instead of opening its 
parent directory. Even if opening the directory is successful, which we don't 
expect in this case, FindFirstFileW forcibly fails the call with 
ERROR_FILE_NOT_FOUND (2) because it expects a filename filter (e.g. "*") for 
the internal NtQueryDirectoryFile[Ex] system call.

Care needs to be taken to not strip the trailing slash of the root directory of 
a DOS drive because that creates a drive-relative path (e.g. "C:"). It is 
expected that FindFirstFileW will fail for the root of a DOS drive or UNC 
share, since there's no parent directory to open.



"System Volume Information" explicitly grants access only to the SYSTEM 
account. Implicitly we have read-attributes access to this directory because we 
have read-data (i.e. list-directory) access to the root directory. Great, but 
even for 0 desired access, CreateFileW requests both read-attributes and 
synchronize access, even for overlapped I/O (i.e. kernel File objects created 
by CreateFileW can always be waited on). So even an elevated administrator 
normally can't open this directory to query information. However, backup and 
restore privileges are in effect when an open requests backup semantics, which 
we already do. We could extend os.stat to temporarily enable SeBackupPrivilege 
if the caller has it. 

It's also possible to open the directory with a native NtOpenFile or 
NtCreateFile system call, without the FILE_SYNCHRONOUS_IO_NONALERT option and 
without requesting SYNCHRONIZE access -- i.e. the File object will be 
asynchronous and not waitable.

--
nosy: +eryksun

___
Python tracker 

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



[issue25172] Unix-only crypt should not be present on Windows.

2019-11-18 Thread Xavier de Gaye


Xavier de Gaye  added the comment:

test_crypt fails on android following last changes made at 
243a73deee4ac61fe06602b7ed56b6df01e19f27.
The android libc does not have a crypt() function and the _crypt module is not 
built.


generic_x86_64:/data/local/tmp/python $ python
Python 3.9.0a0 (heads/abifa-dirty:cf805c25e6, Nov 18 2019, 16:40:26)
[Clang 8.0.2 (https://android.googlesource.com/toolchain/clang 40173bab62ec7462 
on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import crypt
Traceback (most recent call last):
  File "/data/local/tmp/python/lib/python3.9/crypt.py", line 6, in 
import _crypt
ModuleNotFoundError: No module named '_crypt'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "", line 1, in 
  File "/data/local/tmp/python/lib/python3.9/crypt.py", line 11, in 
raise ImportError("The required _crypt module was not built as part of 
CPython")
ImportError: The required _crypt module was not built as part of CPython
>>>


generic_x86_64:/data/local/tmp/python $ python -m test -v test_crypt
== CPython 3.9.0a0 (heads/abifa-dirty:cf805c25e6, Nov 18 2019, 16:40:26) [Clang 
8.0.2 (https://andro
id.googlesource.com/toolchain/clang 40173bab62ec7462
== Linux-3.10.0+-x86_64-with-libc little-endian
== cwd: /data/local/tmp/python/tmp/test_python_3523
== CPU count: 2
== encodings: locale=UTF-8, FS=utf-8
0:00:00 Run tests sequentially
0:00:00 [1/1] test_crypt
test_blowfish_rounds (test.test_crypt.CryptTestCase) ... skipped 'Not supported 
on Windows'
test_crypt (test.test_crypt.CryptTestCase) ... skipped 'Not supported on 
Windows'
test_invalid_rounds (test.test_crypt.CryptTestCase) ... skipped 'Not supported 
on Windows'
test_methods (test.test_crypt.CryptTestCase) ... skipped 'Not supported on 
Windows'
test_salt (test.test_crypt.CryptTestCase) ... skipped 'Not supported on Windows'
test_saltedcrypt (test.test_crypt.CryptTestCase) ... skipped 'Not supported on 
Windows'
test_sha2_rounds (test.test_crypt.CryptTestCase) ... skipped 'Not supported on 
Windows'
test_failure_only_for_windows (test.test_crypt.TestWhyCryptDidNotImport) ... 
FAIL
test_import_failure_message (test.test_crypt.TestWhyCryptDidNotImport) ... FAIL

==
FAIL: test_failure_only_for_windows (test.test_crypt.TestWhyCryptDidNotImport)
--
Traceback (most recent call last):
  File "/data/local/tmp/python/lib/python3.9/test/test_crypt.py", line 16, in 
test_failure_only_for_
windows
self.assertEqual(sys.platform, 'win32')
AssertionError: 'linux' != 'win32'
- linux
+ win32

==
FAIL: test_import_failure_message (test.test_crypt.TestWhyCryptDidNotImport)
--
Traceback (most recent call last):
  File "/data/local/tmp/python/lib/python3.9/test/test_crypt.py", line 19, in 
test_import_failure_message
self.assertIn('not supported', IMPORT_ERROR)
AssertionError: 'not supported' not found in 'The required _crypt module was 
not built as part of CPython'

--

Ran 9 tests in 0.008s

FAILED (failures=2, skipped=7)
test test_crypt failed
test_crypt failed

== Tests result: FAILURE ==

1 test failed:
test_crypt

Total duration: 165 ms
Tests result: FAILURE

--
nosy: +xdegaye

___
Python tracker 

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



[issue22367] Add open_file_descriptor parameter to fcntl.lockf() (use the new F_OFD_SETLK flag)

2019-11-18 Thread Łukasz Langa

Łukasz Langa  added the comment:

Note: this is affecting the release of Python 3.9.0a1.  I will be continuing 
with the release in 12 hours.  If the failing macOS test is not fixed by then, 
alpha1 will ship in this state.

However, I will be blocking alpha2 if this is still the case.

Please prioritize fixing this.

--
nosy: +lukasz.langa

___
Python tracker 

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



[issue38622] _ctypes.dlsym (py_dl_sym) does not trigger audit hooks

2019-11-18 Thread miss-islington


Change by miss-islington :


--
pull_requests: +16744
pull_request: https://github.com/python/cpython/pull/17245

___
Python tracker 

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



[issue38622] _ctypes.dlsym (py_dl_sym) does not trigger audit hooks

2019-11-18 Thread Steve Dower


Steve Dower  added the comment:


New changeset dcf1f83de8678b09df5bd7d04ca5f4ef1cd02aca by Steve Dower in branch 
'master':
bpo-38622: Ensure ctypes.PyObj_FromPtr audit event passes tuples as a single 
argument (GH-17243)
https://github.com/python/cpython/commit/dcf1f83de8678b09df5bd7d04ca5f4ef1cd02aca


--

___
Python tracker 

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



[issue38722] runpy should use io.open_code() instead of open()

2019-11-18 Thread miss-islington


Change by miss-islington :


--
pull_requests: +16743
pull_request: https://github.com/python/cpython/pull/17244

___
Python tracker 

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



[issue38789] difflib lacks a way to check if results are empty

2019-11-18 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

Simon, I think the conversation is starting to drift and would best be 
continued on python-ideas or StackOverflow.  Ideas like peekable generators 
have been discussed before but there was almost no uptake.

Several thoughts:

* For equal inputs, ndiff() is supposed to generate non-empty output.  It does 
not just give differences.

* To the extent that you care about empty results from some other iterator, the 
easiest thing to do is follow Tim's advice and just list() the iterator.

* The special case of equal inputs is easily handled before running the diff:

 if a == b:
 do_something_for_the_equal_case(a, b)
 else:
 d = ndiff(a, b)
 do_something_for_the_non_equal_case(a, b, d)

I recommend closing this issue because it hasn't elicted anything that is both 
actionable and desireable.

--
nosy: +rhettinger

___
Python tracker 

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



[issue37228] UDP sockets created by create_datagram_endpoint() allow by default multiple processes to bind the same port

2019-11-18 Thread Nathaniel Smith


Nathaniel Smith  added the comment:

Ouch, that's nasty. It also has security implications. For example, suppose you 
have a multi-user computer, where one user is has a video call going, which 
transfers packets over UDP. Another user could check what port they're using, 
bind to the same port, and steal half the packets, letting them effectively 
listen in on the first user's phone call.

Well, hopefully most conferencing tools use end-to-end encryption. But the 
point is that we don't normally let unprivileged users steal network traffic 
intended for other users.

--

___
Python tracker 

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



[issue37228] UDP sockets created by create_datagram_endpoint() allow by default multiple processes to bind the same port

2019-11-18 Thread Guido van Rossum


Guido van Rossum  added the comment:

I agree that this is a bad default (and whoever wrote it, probably me, didn't 
know what this does for UDP).  I think the right solution is to change the 
default, not to introduce a new method.

Maybe we can deprecate the default somehow? There currently is a line the 
computes the default based on platform:

if reuse_address is None:
reuse_address = os.name == 'posix' and sys.platform != 'cygwin'


We could change this to issue a deprecation warning stating that in the future 
the default will change to False everywhere. Then in the next release we could 
change the default to False and remove the warning.

--
nosy: +gvanrossum

___
Python tracker 

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



[issue38721] modulefinder should use import hooks properly

2019-11-18 Thread Dominic Littlewood


Dominic Littlewood <11dlittlew...@gmail.com> added the comment:

I now have a PR which - dare I say it - appears to be working as it should. 
I'll just write some tests for it and then I'll send it off for review.

--

___
Python tracker 

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



[issue38622] _ctypes.dlsym (py_dl_sym) does not trigger audit hooks

2019-11-18 Thread miss-islington


miss-islington  added the comment:


New changeset 47db7439dd858c3634212c71137eb130f811bda4 by Miss Islington (bot) 
in branch '3.8':
bpo-38622: Add missing audit events for ctypes module (GH-17158)
https://github.com/python/cpython/commit/47db7439dd858c3634212c71137eb130f811bda4


--
nosy: +miss-islington

___
Python tracker 

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



[issue38622] _ctypes.dlsym (py_dl_sym) does not trigger audit hooks

2019-11-18 Thread Steve Dower


Steve Dower  added the comment:

Typically, as soon as I merge, I spot an edge case issue.

PySys_Audit(n, "O", a) is deliberately going to treat 'a' as the tuple of 
arguments (when it is a tuple). This lets us simplify/optimise events where the 
event arguments match the function arguments exactly. If 'a' is not a tuple, it 
gets wrapped in one.

When 'a' is meant to be a single argument that _might_ be a tuple, such as in 
PyObj_FromPtr, the format string needs to be "(O)" to ensure it is treated as a 
one element tuple. This is just how Py_BuildValue works - multiple elements 
become a tuple and the parens are optional unless you want a one-element tuple.

--

___
Python tracker 

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



[issue38622] _ctypes.dlsym (py_dl_sym) does not trigger audit hooks

2019-11-18 Thread Steve Dower


Change by Steve Dower :


--
pull_requests: +16742
pull_request: https://github.com/python/cpython/pull/17243

___
Python tracker 

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



[issue38622] _ctypes.dlsym (py_dl_sym) does not trigger audit hooks

2019-11-18 Thread miss-islington


Change by miss-islington :


--
pull_requests: +16741
pull_request: https://github.com/python/cpython/pull/17242

___
Python tracker 

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



[issue38622] _ctypes.dlsym (py_dl_sym) does not trigger audit hooks

2019-11-18 Thread Steve Dower


Steve Dower  added the comment:


New changeset 00923c63995e34cdc25d699478f113de99a69df9 by Steve Dower in branch 
'master':
bpo-38622: Add missing audit events for ctypes module (GH-17158)
https://github.com/python/cpython/commit/00923c63995e34cdc25d699478f113de99a69df9


--

___
Python tracker 

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



[issue38722] runpy should use io.open_code() instead of open()

2019-11-18 Thread Steve Dower


Steve Dower  added the comment:

> I hadn't realized that we'd made such a declaration WRT opening of code files 
> in general.

It wasn't exactly a hugely publicised declaration :)

The relevant quote from PEP 578 is:

> All import and execution functionality involving code from a file will be 
> changed to use open_code() unconditionally.

Which I admit is a big claim, and one that was not completely followed through 
with before 3.8.0. Calling it a "security" fix is borderline, as it isn't 
really a vulnerability by default, but calling it incorrect behaviour (i.e. a 
regular bug) is fine by me.

--

___
Python tracker 

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



[issue38722] runpy should use io.open_code() instead of open()

2019-11-18 Thread Tal Einat


Change by Tal Einat :


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



[issue38722] runpy should use io.open_code() instead of open()

2019-11-18 Thread Tal Einat


Tal Einat  added the comment:

Thanks for reporting this, Dominic!

Thanks for the PR, Jason!

--

___
Python tracker 

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



[issue38722] runpy should use io.open_code() instead of open()

2019-11-18 Thread miss-islington


Change by miss-islington :


--
pull_requests: +16740
pull_request: https://github.com/python/cpython/pull/17241

___
Python tracker 

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



[issue38722] runpy should use io.open_code() instead of open()

2019-11-18 Thread Tal Einat


Tal Einat  added the comment:

Thanks Steve! I hadn't realized that we'd made such a declaration WRT opening 
of code files in general. In that case, this is certainly at least a bug fix, 
and should be backported.

--
type: enhancement -> security
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



[issue35004] Odd behavior when using datetime.timedelta under cProfile

2019-11-18 Thread Batuhan


Batuhan  added the comment:

This bug is fixed in both 3.8 and 3.7, @p-ganssle what do you think about 
closing this?

--
nosy: +BTaskaya

___
Python tracker 

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



[issue38722] runpy should use io.open_code() instead of open()

2019-11-18 Thread miss-islington


miss-islington  added the comment:


New changeset e243bae418859106328d9fce71815b7eb2fe by Miss Islington (bot) 
(jsnklln) in branch 'master':
bpo-38722: Runpy use io.open_code() (GH-17234)
https://github.com/python/cpython/commit/e243bae418859106328d9fce71815b7eb2fe


--
nosy: +miss-islington

___
Python tracker 

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



[issue38722] runpy should use io.open_code() instead of open()

2019-11-18 Thread Steve Dower


Steve Dower  added the comment:

It's a security issue because Python 3.8 says it will open files to be executed 
with io.open_code() instead of open(). This allows a way to bypass that.

That said, this appears to be a fallback case, so I'm not hugely concerned. I 
haven't quite figured out why it would fall back here (that involved reading 
the pkgutil sources ;) ).

I would vote for backporting to 3.8.1, but if Tal wants to push back and nobody 
else has an opinion then whatever.

--
nosy: +christian.heimes

___
Python tracker 

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



[issue38500] Provide a way to get/set PyInterpreterState.frame_eval without needing to access interpreter internals

2019-11-18 Thread STINNER Victor


Change by STINNER Victor :


--
keywords: +patch
pull_requests: +16739
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/17187

___
Python tracker 

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



[issue17013] Allow waiting on a mock

2019-11-18 Thread Ilya Kulakov


Ilya Kulakov  added the comment:

I have submitted an alternative implementation of this feature heavily inspired 
by _AwaitEvent I wrote for asynctest [0]. 

There was recently an interest from the community towards asynctest to the 
point that got some of its measures merged into CPython [1].

The key features of my implementation [2]:

- Gives meaning to the existing Mock.called property, otherwise not much useful
- Does not require end users to do anything: change is automatically available 
in every Mock (and any subclass of mock that does not override `called`)
- Use of conditionals provides API that allows much richer extension: instead 
of hardcoding conditions as events it allows to wait until arbitrary predicate 
becomes true
- Utilizes existing semantics of python conditionals (both asyncio and 
threading)

Accepting this PR will allow me to bring _AwaitEvent thereby completing mock.py 
with waiting mechanics with identical semantics for both threading-based and 
asyncio-based cases.


0: 
https://github.com/Martiusweb/asynctest/blob/4b1284d6bab1ae90a6e8d88b882413ebbb7e5dce/asynctest/mock.py#L428
1: https://github.com/python/cpython/pull/9296
2: https://github.com/python/cpython/pull/17133

--
nosy: +Kentzo

___
Python tracker 

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



[issue38722] runpy should use io.open_code() instead of open()

2019-11-18 Thread Zachary Ware


Change by Zachary Ware :


--
nosy: +steve.dower

___
Python tracker 

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



[issue37228] UDP sockets created by create_datagram_endpoint() allow by default multiple processes to bind the same port

2019-11-18 Thread Jukka Väisänen

Jukka Väisänen  added the comment:

Sure, I fully appreciate implications of changing default behaviour and will 
post on python-dev.

--

___
Python tracker 

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



[issue38722] runpy should use io.open_code() instead of open()

2019-11-18 Thread Tal Einat


Tal Einat  added the comment:

I don't see why this should be considered a security issue.

This should likely have been done when io.open_code() was initially added, but 
now that 3.8 is out, I don't think backporting this would be wise.

--
nosy: +taleinat
type: security -> enhancement
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



[issue38838] Exception ignored in: module 'threading' in _shutdown, _signal_handler

2019-11-18 Thread wesinator


wesinator <13hu...@gmail.com> added the comment:

didn't see this was a third party package.

disregard.

sorry

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



[issue38818] Modify PyInterpreterState.eval_frame to pass tstate (PyThreadState)

2019-11-18 Thread Brett Cannon


Brett Cannon  added the comment:

I think bpo-38500 needs to get resolved first before this as that will affect 
whether this is acceptable or not as an API-breaking change.

--

___
Python tracker 

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



[issue38838] Exception ignored in: module 'threading' in _shutdown, _signal_handler

2019-11-18 Thread wesinator


New submission from wesinator <13hu...@gmail.com>:

macOS 10.14.6
python 3.7.5 

Exception ignored in: 
Traceback (most recent call last):
  File 
"/usr/local/Cellar/python/3.7.5/Frameworks/Python.framework/Versions/3.7/lib/python3.7/threading.py",
 line 1274, in _shutdown
def _shutdown():
  File "/usr/local/lib/python3.7/site-packages/tcex/tcex.py", line 178, in 
_signal_handler
self.exit(1, 'The App received an interrupt signal and will now exit.')
  File "/usr/local/lib/python3.7/site-packages/tcex/tcex.py", line 303, in exit
sys.exit(code)
SystemExit: 1

--
components: Library (Lib)
messages: 356893
nosy: wesinator
priority: normal
severity: normal
status: open
title: Exception ignored in: module 'threading' in _shutdown, _signal_handler
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



[issue38809] On Windows, build scripts should prefer using python.exe from an active virtual env

2019-11-18 Thread Tal Einat


Change by Tal Einat :


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



[issue38597] C Extension import limit

2019-11-18 Thread Yurii Leonov


Yurii Leonov  added the comment:

Done:
.pyd files are added in 
https://github.com/Yuriy-Leonov/cython_imports_limit_issue/commit/2f9e7c02798fb52185dabfe6ce3811c439ca2839

folder with name "dist_example_with_error"

--
versions: +Python 3.6 -Python 3.7, Python 3.8, Python 3.9

___
Python tracker 

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



[issue38809] On Windows, build scripts should prefer using python.exe from an active virtual env

2019-11-18 Thread miss-islington


miss-islington  added the comment:


New changeset 2b928d9bf75d82b86dc3b4fcbc243d36a7958f4c by Miss Islington (bot) 
in branch '3.7':
bpo-38809: Windows build scripts use python.exe from virtual envs (GH-17164)
https://github.com/python/cpython/commit/2b928d9bf75d82b86dc3b4fcbc243d36a7958f4c


--

___
Python tracker 

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



[issue38809] On Windows, build scripts should prefer using python.exe from an active virtual env

2019-11-18 Thread miss-islington


miss-islington  added the comment:


New changeset cbbf1098f383e575d93841e555329eb66283c2f1 by Miss Islington (bot) 
in branch '3.8':
bpo-38809: Windows build scripts use python.exe from virtual envs (GH-17164)
https://github.com/python/cpython/commit/cbbf1098f383e575d93841e555329eb66283c2f1


--

___
Python tracker 

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



[issue38821] argparse calls ngettext with deprecated non-integer value

2019-11-18 Thread paul j3


Change by paul j3 :


--
nosy: +paul.j3

___
Python tracker 

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



[issue38722] runpy should use io.open_code() instead of open()

2019-11-18 Thread Tal Einat


Change by Tal Einat :


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



[issue38809] On Windows, build scripts should prefer using python.exe from an active virtual env

2019-11-18 Thread miss-islington


miss-islington  added the comment:


New changeset ee703cbb418b7458bebb1d26a5e19d6b55280b28 by Miss Islington (bot) 
(Tal Einat) in branch 'master':
bpo-38809: Windows build scripts use python.exe from virtual envs (GH-17164)
https://github.com/python/cpython/commit/ee703cbb418b7458bebb1d26a5e19d6b55280b28


--
nosy: +miss-islington

___
Python tracker 

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



[issue38809] On Windows, build scripts should prefer using python.exe from an active virtual env

2019-11-18 Thread miss-islington


Change by miss-islington :


--
pull_requests: +16737
pull_request: https://github.com/python/cpython/pull/17237

___
Python tracker 

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



[issue38809] On Windows, build scripts should prefer using python.exe from an active virtual env

2019-11-18 Thread miss-islington


Change by miss-islington :


--
pull_requests: +16738
pull_request: https://github.com/python/cpython/pull/17238

___
Python tracker 

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



[issue38453] ntpath.realpath() does not fully resolve relative paths

2019-11-18 Thread Steve Dower


Steve Dower  added the comment:

Closing this as I believe it's done, but happy to reopen if we find another 
edge case (or start a new issue).

--
assignee:  -> steve.dower
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



[issue38597] C Extension import limit

2019-11-18 Thread Steve Dower


Steve Dower  added the comment:

Could you share just one of your .pyd files?

Without being able to see whether they are compiled incorrectly, it's hard to 
be sure whether this is the same cause as before. It certainly looks like 
distutils is still going to link correctly.

--
versions: +Python 3.7, Python 3.8, Python 3.9 -Python 3.6

___
Python tracker 

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



[issue38837] struct.pack: Unable to pack more than 256 bytes at a time

2019-11-18 Thread Dave Lotton


New submission from Dave Lotton :

Using struct.pack it is not possible (Python 3.6.8 and 2.7.15) to pack more 
than 256 bytes at a time.  

This seems like an arbitrarily small number, and seems to be inconsistent with 
the capabilities of the unpack function, which is able to unpack a larger 
number of bytes.

Below demonstrates the issue...

>>> # Create large data set to be packed
>>> data = range(0,512)

>>> # Demonstrate format string for packing
>>> '<%dB' % len(data)
'<512B'

>>> # Try to pack large data set
>>> packed = pack('<%dB' % len(data), *data)
Traceback (most recent call last):
  File "", line 1, in 
struct.error: ubyte format requires 0 <= number <= 255

>>> # Make data set <= 256 bytes
>>> data = range(0,256)
>>> packed = pack('<%dB' % len(data), *data)
>>> # Data successfully packed


>>> # Append another 256 bytes to packed data
>>> packed += pack('<%dB' % len(data), *data)

>>> # Unpack all 512 bytes
>>> unpacked = unpack('<%dB' % len(packed), packed)
>>> 
>>> unpacked
(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 
22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 
42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 
62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 
82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 
101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 
117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 
133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 
149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 
165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 
181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 
197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 
213, 214, 215, 216, 217, 218, 219, 220, 22
 1, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 
237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 
253, 254, 255, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 
18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 
38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 
58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 
78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 
98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 
114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 
130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 
146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 
162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 
178, 179, 180, 181, 182, 183, 184, 185, 186,
  187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 19
7, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 
213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 
229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 
245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255)




The 256 byte limit on packing seems arbitrarily small and is inconsistent with 
the unpack function.  I'm wondering if there is a rationale for this limit, or 
it has simply been an oversight in the implementation.

I am using Mint Linux 19.2 64-bit (Ubuntu Bionic - based distro).  The problem 
is manifested on both Python 3.6.8 and 2.7.15 included in the distro.

--
components: Library (Lib)
messages: 356886
nosy: Dave Lotton
priority: normal
severity: normal
status: open
title: struct.pack: Unable to pack more than 256 bytes at a time
type: behavior
versions: Python 2.7, Python 3.6

___
Python tracker 

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



[issue38822] Inconsistent os.stat behavior for directory with Access Denied

2019-11-18 Thread Steve Dower


Steve Dower  added the comment:

I haven't debugged it, but I'm guessing we're not handling the trailing slash 
properly when falling back to asking the parent directory for information.

Looking at the actual stat result for "C:\System Volume Information" vs. 
"C:\Windows", most of the information is missing in the first case, which 
should mean that we can't access it but we know it's a directory because the 
entry in C:\ said so.

--

___
Python tracker 

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



[issue33125] Windows 10 ARM64 platform support

2019-11-18 Thread Steve Dower


Steve Dower  added the comment:

If the patches are for Tcl/Tk, then you should submit it to them.

I'm not a Tk maintainer, and I never want to be one, so frankly I'd be happier 
to say it's not supported on ARM :)

But if it builds fine with our PCbuild/prepare_tcltk.bat script and people want 
it then I'll keep it.

--

___
Python tracker 

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



[issue38836] Links are duplicated in documentation search result

2019-11-18 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +mdk

___
Python tracker 

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



[issue38823] Improve stdlib module initialization error handling.

2019-11-18 Thread Brandt Bucher


Change by Brandt Bucher :


--
pull_requests: +16736
pull_request: https://github.com/python/cpython/pull/17236

___
Python tracker 

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



[issue38836] Links are duplicated in documentation search result

2019-11-18 Thread MaT1g3R


New submission from MaT1g3R :

When I do a search in documentation, for example:

https://docs.python.org/3.9/search.html?q=os.walk

The links in the results are sometimes duplicated, for example this
link below shows up twice in the search result:

https://docs.python.org/3.9/library/os.html?highlight=os%20walk#os.walk

--
assignee: docs@python
components: Documentation
messages: 356883
nosy: MaT1g3R, docs@python
priority: normal
severity: normal
status: open
title: Links are duplicated in documentation search result
type: behavior
versions: Python 3.5, Python 3.6, Python 3.7, Python 3.8, Python 3.9

___
Python tracker 

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



[issue23407] os.walk always follows Windows junctions

2019-11-18 Thread Steve Dower


Steve Dower  added the comment:

At a minimum, it needs to be turned into a GitHub PR.

We've made some significant changes in this area in 3.8, so possibly the best 
available code is now in shutil.rmtree (or shutil.copytree) rather than the 
older patch files.

--

___
Python tracker 

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



[issue38823] Improve stdlib module initialization error handling.

2019-11-18 Thread Brandt Bucher


Change by Brandt Bucher :


--
pull_requests: +16735
pull_request: https://github.com/python/cpython/pull/17235

___
Python tracker 

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



[issue38812] Comparing datetime.time objects incorrect for TZ aware and unaware

2019-11-18 Thread Jason Killen


Jason Killen  added the comment:

Yep I wasn't seeing the forest for the trees.  Thanks for clearing that up.  
I'll swoop back in and see what I can do.

--

___
Python tracker 

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



[issue38631] Replace Py_FatalError() with regular Python exceptions

2019-11-18 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 04394df74b3d0783893da7dafa7803a003516402 by Victor Stinner in 
branch 'master':
bpo-38631: Avoid Py_FatalError() in float.__getformat__() (GH-17232)
https://github.com/python/cpython/commit/04394df74b3d0783893da7dafa7803a003516402


--

___
Python tracker 

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



[issue38631] Replace Py_FatalError() with regular Python exceptions

2019-11-18 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset bc7d3aa6d74b718699b7a6bced9b0dfdfbf95c13 by Victor Stinner in 
branch 'master':
bpo-38631: Avoid Py_FatalError() in _multibytecodec init (GH-17233)
https://github.com/python/cpython/commit/bc7d3aa6d74b718699b7a6bced9b0dfdfbf95c13


--

___
Python tracker 

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



[issue38644] Pass explicitly tstate to function calls

2019-11-18 Thread STINNER Victor


STINNER Victor  added the comment:

One further step would be to change the VECTORCALL/FASTCALL calling convention 
to pass tstate. But I am not sure what is the risk to do that in Python 3.9? 
Cython uses FASTCALL internally for example.

--

___
Python tracker 

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



[issue38722] runpy should use io.open_code() instead of open()

2019-11-18 Thread Jason Killen


Jason Killen  added the comment:

Tests working now.  PR submitted.

--

___
Python tracker 

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



[issue37228] UDP sockets created by create_datagram_endpoint() allow by default multiple processes to bind the same port

2019-11-18 Thread Yury Selivanov


Yury Selivanov  added the comment:

I'd be -1 on changing the default of an existing method, at least without 
consulting with a wider audience.  We can add a new method to the loop and 
deprecate create_datagram_endpoint.

I suggest to post to python-dev and discuss this before making any decisions.

--
nosy: +njs

___
Python tracker 

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



[issue38722] runpy should use io.open_code() instead of open()

2019-11-18 Thread Jason Killen


Change by Jason Killen :


--
keywords: +patch
pull_requests: +16734
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/17234

___
Python tracker 

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



[issue38631] Replace Py_FatalError() with regular Python exceptions

2019-11-18 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +16733
pull_request: https://github.com/python/cpython/pull/17233

___
Python tracker 

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



[issue38631] Replace Py_FatalError() with regular Python exceptions

2019-11-18 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +16732
pull_request: https://github.com/python/cpython/pull/17232

___
Python tracker 

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



  1   2   >