[issue30811] A venv created and activated from within a virtualenv uses the outer virtualenv's site-packages rather than its own.

2017-11-22 Thread Vinay Sajip

Vinay Sajip  added the comment:

> I guess it's reasonable, I'll see whether we can use the workaround you 
> proposed.

OK, please post your findings here.

> (Could a fix on virtualenv's side help?)

Probably not, as it's not behaving unexpectedly. It might be worth asking the 
Travis devs for an enhancement to allow the choice of -m venv rather than 
virtualenv to create venvs for Python >= 3.3, via an option in .travis.yml.

--

___
Python tracker 

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



[issue30230] Move quick test in PyObject_IsSubClass outside of PyType_CheckExact guard

2017-11-22 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

Yes, please move this to Python-Dev.

--

___
Python tracker 

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



[issue10544] yield expression inside generator expression does nothing

2017-11-22 Thread Nick Coghlan

Nick Coghlan  added the comment:

"Just fix the issue" is easier said than done for the same reason that 
comprehensions were implemented the way they are now: lambda expressions still 
have to work.

That is, we need to maintain the invariant that:

[x for x in iterable]
{x for x in iterable}
(k:v for k, v in iterable)
(x for x in iterable)

give the same results (respectively) as:

[(lambda: x)() for x in iterable]
{(lambda: x)() for x in iterable}
((lambda: k)():(lambda: v)() for k, v in iterable)
((lambda: x)() for x in iterable)

Once you work through the implications of "We need the loop variable to visible 
to lexically nested scopes, but invisible in the containing scope", you're 
going to end up with something that looks enough like a nested function that 
the easiest to implement and explain option is to have it *be* a nested 
function.

I'd be fine with a resolution that forbade yield expressions directly inside 
implicit scopes, though.

--

___
Python tracker 

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



[issue32117] Tuple unpacking in return and yield statements

2017-11-22 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

Since this changes the grammar, it should be first discussed on Python-Dev and 
approved by BDFL.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue32117] Tuple unpacking in return and yield statements

2017-11-22 Thread Serhiy Storchaka

Change by Serhiy Storchaka :


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

___
Python tracker 

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



[issue32118] Docs: add note about sequence comparisons containing non-orderable elements

2017-11-22 Thread Dubslow

Dubslow  added the comment:

The PR includes an unrelated one word grammar fix in the same file, that can be 
removed (by me or by someone else, IDC).

This is possibly backportable but I wouldn't know, and leave such decisions for 
someone who do.

--
type:  -> enhancement

___
Python tracker 

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



[issue32118] Docs: add note about sequence comparisons containing non-orderable elements

2017-11-22 Thread Roundup Robot

Change by Roundup Robot :


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

___
Python tracker 

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



[issue32118] Docs: add note about sequence comparisons containing non-orderable elements

2017-11-22 Thread Dubslow

New submission from Dubslow :

In sequence comparisons, the enforcement of reflexivity of elements means that 
only non-identical elements are actually compared. The docs then note, with 
example, that non-reflexive elements thus always "compare" equal inside the 
sequence.

This patch adds a second corollary, that non-orderable singletons (e.g. 
None) will also not break sequence comparison.

Yes, the consequence is logically derivable from the statement "element 
identity is compared first, and element comparison is performed only for 
distinct elements", but the first example is given because "For non-reflexive 
elements, the result is different than for strict element comparison, and may 
be surprising", which also holds for the example I add here: different from 
strict element comparison, which may lead to otherwise surprising results (it 
sure was surprising to me when I expected a list with Nones to fail to compare, 
hence why I went trawling through the docs). In the manner of the first 
example, explicit is better than implicit, and (I believe) it will be helpful 
for readers to have this second consequence demonstrated.

--
assignee: docs@python
components: Documentation
messages: 306780
nosy: Dubslow, docs@python
priority: normal
severity: normal
status: open
title: Docs: add note about sequence comparisons containing non-orderable 
elements
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



[issue32109] Separated square brackets will generate a tuple instead of a list.

2017-11-22 Thread YCmove

YCmove  added the comment:

Yes, what Cheryl Sabella says is what I was misled to. 

Took me a while to understand that ``[a]``, ``[a, b, c]`` is not ``[a], [a, b, 
c]``, how about replace comma to "or" for more clarity? just like it used in 
[tuple 
documention](https://github.com/python/cpython/blob/master/Doc/library/stdtypes.rst#tuples)

Here is my rephrased version, and I add one more example of comma separated 
lists in tuple according to R. David Murray.

--
hgrepos: +374

___
Python tracker 

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



[issue5710] ctypes should return composite types from callbacks

2017-11-22 Thread Russell Keith-Magee

Russell Keith-Magee  added the comment:

For those interested, we developed a workaround for this in Rubicon: 

https://github.com/pybee/rubicon-objc/pull/85/files

The fix involves using ctypes to access ctypes own internals, and build a 
modified version of the Structure data type that is able to perform a copy when 
used as returned value. 

Hopefully we'll be able to get this into the form of a patch for ctypes that is 
acceptable to Python core.

--
nosy: +freakboy3742

___
Python tracker 

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



[issue32030] PEP 432: Rewrite Py_Main()

2017-11-22 Thread STINNER Victor

Change by STINNER Victor :


--
pull_requests: +4450

___
Python tracker 

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



[issue10544] yield expression inside generator expression does nothing

2017-11-22 Thread Nick Coghlan

Change by Nick Coghlan :


--
nosy: +ncoghlan

___
Python tracker 

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



[issue32100] IDLE: PathBrowser isn't working

2017-11-22 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

Thanks for catching and fixing this.

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



[issue32100] IDLE: PathBrowser isn't working

2017-11-22 Thread Terry J. Reedy

Terry J. Reedy  added the comment:


New changeset ae3c5c7b9e5e5ba53213e12cc100e32415d5762c by Terry Jan Reedy in 
branch '3.6':
[3.6] bpo-32100: IDLE: Fix pathbrowser errors; improve tests. (GH-4484) (#4512)
https://github.com/python/cpython/commit/ae3c5c7b9e5e5ba53213e12cc100e32415d5762c


--

___
Python tracker 

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



[issue32030] PEP 432: Rewrite Py_Main()

2017-11-22 Thread STINNER Victor

STINNER Victor  added the comment:


New changeset e32e79f7d8216b78ac9e61bb1f2eee693108d4ee by Victor Stinner in 
branch 'master':
bpo-32030: Move PYTHONPATH to _PyMainInterpreterConfig (#4511)
https://github.com/python/cpython/commit/e32e79f7d8216b78ac9e61bb1f2eee693108d4ee


--

___
Python tracker 

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



[issue32096] Py_DecodeLocale() fails if used before the runtime is initialized.

2017-11-22 Thread Nick Coghlan

Nick Coghlan  added the comment:

Even the public implementation of PEP 432 is going to bound by the requirement 
to keep existing embedding logic working, and that's encapsulated in the new 
test Eric added in his PR:

wchar_t *program = Py_DecodeLocale("spam", NULL);
Py_SetProgramName(program);
Py_Initialize();
Py_Finalize();
PyMem_RawFree(program);

So even if we were to revert the _PyRuntime.mem change in 3.7, we'd still face 
the same problem in 3.8, because we'd still be exposing the traditional 
configuration API - the new multi-step configuration API would be *optional* 
for folks that wanted to override the default settings more easily, rather than 
a backwards compatibility break with the previously supported way of doing 
things.

As a result, my preferred option is now to make exactly the promises we need to 
ensure that the above code works correctly, and then have Py_Initialize and 
Py_Finalize enforce those constraints:

* the public Py_Initialize API should fail if the memory allocators have 
already been set to something other than the default
* Py_Finalize should revert the memory allocators to their default setting

--

___
Python tracker 

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



[issue27535] Ignored ResourceWarning warnings leak memory in warnings registries

2017-11-22 Thread STINNER Victor

STINNER Victor  added the comment:

My PR 4502 implements all optimizations, but also converts warnings.filters to 
a tuple, to detect when detect attempts to modify directly warnings.filters, 
rather than using function calls.

Problem: test.libregrtest module uses a pattern like this:

  old_filters = warnings.filters[:]  # in function 1
  (...)
  warnings.filters[:] = old_filters  # in function 2

While this pattern is perfectly fine when filters is a list, 
"warnings.filters[:] = old_filters" fails since a tuple is immutable.

Again, the question is if it's ok to break such code. I'm no more sure that 
catch_warnings() handles completly this use case, and a context manager is not 
convenient in the specific case of test.libregrest.

--

___
Python tracker 

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



[issue32096] Py_DecodeLocale() fails if used before the runtime is initialized.

2017-11-22 Thread STINNER Victor

STINNER Victor  added the comment:

"Victor, I think you're fundamentally misunderstanding the goals of PEP 432. 
The entire point is to let people have a *mostly working Python runtime* during 
CPython startup. (...)"

While the PEP 432 is nice, all changes are currently done in private APIs, 
symbols starting with _Py. I would prefer that nobody uses these new APIs 
before the conversion is complete. And from what I saw, I can say that the 
conversion just started, there are still a lot of changes that should be done.

While having _PyRuntime.mem is nice to have in the long term, it doesn't add 
any value *right now*, except of making the existing C API harder to use.

I would prefer to do things in this order:

* Revert _PyRutime.mem
* Finish PEP 432 implementation
* Recreate _PyRutime.mem

Maybe we can complete these 3 steps before Python 3.7, but I'm not sure about 
that.

--

___
Python tracker 

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



[issue10049] Add a "no-op" (null) context manager to contextlib

2017-11-22 Thread Nick Coghlan

Nick Coghlan  added the comment:

Thanks to Jesse Bakker for the PR implementing this for 3.7!

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

___
Python tracker 

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



[issue10049] Add a "no-op" (null) context manager to contextlib

2017-11-22 Thread Nick Coghlan

Nick Coghlan  added the comment:


New changeset 0784a2e5b174d2dbf7b144d480559e650c5cf64c by Nick Coghlan 
(Jesse-Bakker) in branch 'master':
bpo-10049: Add a "no-op" (null) context manager to contextlib (GH-4464)
https://github.com/python/cpython/commit/0784a2e5b174d2dbf7b144d480559e650c5cf64c


--

___
Python tracker 

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



[issue32096] Py_DecodeLocale() fails if used before the runtime is initialized.

2017-11-22 Thread Nick Coghlan

Nick Coghlan  added the comment:

Follow up: this also came up on https://bugs.python.org/issue32030#msg306763, 
and I think Victor and I are on the same page now :)

Since MainInterpreterConfig is currently still a private struct, we can store 
the existing C level config state directly in there for now, and then look at 
upgrading to Python types on a case by case basis.

Once they're all both consolidated *and* upgraded, then we can consider making 
the new incremental configuration API public.

--

___
Python tracker 

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



[issue32100] IDLE: PathBrowser isn't working

2017-11-22 Thread Terry J. Reedy

Change by Terry J. Reedy :


--
pull_requests: +4449

___
Python tracker 

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



[issue32030] PEP 432: Rewrite Py_Main()

2017-11-22 Thread Nick Coghlan

Nick Coghlan  added the comment:

Nice, thanks for that. Good call on keeping the current data types for now, so 
we can focus on consolidating the configuration settings first, and then look 
at upgrading from C level types to Python level types later.

--

___
Python tracker 

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



[issue32030] PEP 432: Rewrite Py_Main()

2017-11-22 Thread STINNER Victor

STINNER Victor  added the comment:

Nick: Ok, I created PR 4511.

--

___
Python tracker 

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



[issue32030] PEP 432: Rewrite Py_Main()

2017-11-22 Thread STINNER Victor

Change by STINNER Victor :


--
pull_requests: +4448

___
Python tracker 

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



[issue32096] Py_DecodeLocale() fails if used before the runtime is initialized.

2017-11-22 Thread Nick Coghlan

Nick Coghlan  added the comment:

Also, the basic rules of thumb I use for deciding whether or not a setting 
belongs in CoreConfig:

* does `PyUnicode_New` need this? (If yes, then include it)
* does the importlib bootstrapping need this? (If yes, then include it)

Everything else goes in MainInterpreterConfig as a real Python object.

We may need other structs internally to help manage the way Py_Main populates 
MainInterpreterConfig, but those should be made a required part of the future 
public initialization API (although we may decide to expose them as "use them 
if you want to better emulate CPython's default behaviour" helper APIs).

--

___
Python tracker 

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



[issue32114] The get_event_loop change in bpo28613 did not update the documentation

2017-11-22 Thread Pablo Galindo Salgado

Change by Pablo Galindo Salgado :


--
keywords: +patch
pull_requests: +4447
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



[issue32100] IDLE: PathBrowser isn't working

2017-11-22 Thread Terry J. Reedy

Terry J. Reedy  added the comment:


New changeset 20d48a44a54ed5e4a6df00e89ae27e3983128265 by Terry Jan Reedy 
(Cheryl Sabella) in branch 'master':
bpo-32100: IDLE: Fix pathbrowser errors; improve tests. (#4484)
https://github.com/python/cpython/commit/20d48a44a54ed5e4a6df00e89ae27e3983128265


--

___
Python tracker 

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



[issue32096] Py_DecodeLocale() fails if used before the runtime is initialized.

2017-11-22 Thread Nick Coghlan

Nick Coghlan  added the comment:

Victor, I think you're fundamentally misunderstanding the goals of PEP 432.

The entire point is to let people have a *mostly working Python runtime* during 
CPython startup. Moving everything that Py_Initialize needs to instead have to 
happen before Py_InitializeRuntime (aka _Py_CoreInitialize) defeats that point.

CoreConfig should thus contain *as little as possible*, with most of the 
environmental querying work moving into Py_ReadMainInterpreterConfig.

So could you please move everything you've added to CoreConfig (that isn't 
genuinely required to from the moment the runtime starts doing anything) out 
again, and either put it into the main interpreter config as Python objects (as 
described in PEP 432), or else into a new intermediate configuration struct?

--

___
Python tracker 

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



[issue32030] PEP 432: Rewrite Py_Main()

2017-11-22 Thread Nick Coghlan

Nick Coghlan  added the comment:

Victor, *please* don't add the external import settings to CoreConfig. That 
struct should only contain the absolute bare minimum of settings needed to get 
an interpreter that *can't* access the filesystem, such that builtin modules 
and frozen modules work, but nothing else does.

If you need some extra structures to hold command line and environment state, 
that's fine, but the full external import system attributes should go in the 
main interpreter config, as described in 
https://www.python.org/dev/peps/pep-0432/#supported-configuration-settings

--

___
Python tracker 

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



[issue31299] Add "ignore_modules" option to TracebackException.format()

2017-11-22 Thread Pablo Galindo Salgado

Pablo Galindo Salgado  added the comment:

I have prepared a patch (attached) with a possible implementation of the C 
function that can filter traceback objects modifying the traceback chain. I can 
make a PR if the patch looks good enough to start iterating over it. In case an 
alternative implementation is needed I am more than happy to prepare another 
patch/PR.

--
keywords: +patch
nosy: +pablogsal
Added file: https://bugs.python.org/file47284/traceback_filter.patch

___
Python tracker 

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



[issue32117] Tuple unpacking in return and yield statements

2017-11-22 Thread David Cuthbert

Change by David Cuthbert :


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

___
Python tracker 

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



[issue32117] Tuple unpacking in return and yield statements

2017-11-22 Thread David Cuthbert

New submission from David Cuthbert :

This stems from a query on StackOverflow: 
https://stackoverflow.com/questions/47272460/python-tuple-unpacking-in-return-statement/

Specifically, the following syntax is allowed:
def f():
rest = (4, 5, 6)
t = 1, 2, 3, *rest

While the following result in SyntaxError:
def g():
rest = (4, 5, 6)
return 1, 2, 3, *rest

def h():
rest = (4, 5, 6)
yield 1, 2, 3, *rest

Looking at the original commit that enabled tuple unpacking in assignment 
statements:
https://github.com/python/cpython/commit/4905e80c3d2f6abb613d212f0313d1dfe09475dc

I don't believe this difference is intentional.

My GitHub repo incorporates a fix for this; I'll file a pull request 
momentarily.

--
components: Interpreter Core
messages: 306761
nosy: dacut
priority: normal
severity: normal
status: open
title: Tuple unpacking in return and yield statements
type: behavior
versions: Python 3.4, Python 3.5, Python 3.6

___
Python tracker 

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



[issue32055] Reconsider comparison chaining for containment tests

2017-11-22 Thread Nick Coghlan

Nick Coghlan  added the comment:

If we do decide to do this, I'm inclined to eventually make the change at the 
Grammar level rather than the AST level.

Current:

comparison: expr (comp_op expr)*
comp_op: '<'|'>'|'=='|'>='|'<='|'<>'|'!='|'in'|'not' 'in'|'is'|'is' 'not'

Future:

comparison: expr (comp_op expr)* | (containment_check)
comp_op: '<'|'>'|'=='|'>='|'<='|'<>'|'!='|'is'|'is' 'not'
containment_check: ('in'|'not' 'in') expr

However, we'd still need an intermediate step like your PR in order to emit 
SyntaxWarning while still retaining the current semantics.

--

___
Python tracker 

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



[issue32030] PEP 432: Rewrite Py_Main()

2017-11-22 Thread STINNER Victor

STINNER Victor  added the comment:


New changeset d4341109746aa15e1909e63b30b93b6133ffe401 by Victor Stinner in 
branch 'master':
bpo-32030: Add _PyCoreConfig.module_search_path_env (#4504)
https://github.com/python/cpython/commit/d4341109746aa15e1909e63b30b93b6133ffe401


--

___
Python tracker 

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



[issue27535] Ignored ResourceWarning warnings leak memory in warnings registries

2017-11-22 Thread STINNER Victor

STINNER Victor  added the comment:


New changeset 82656276caf4cb889193572d2d14dbc5f3d2bdff by Victor Stinner in 
branch 'master':
bpo-27535: Optimize warnings.warn() (#4508)
https://github.com/python/cpython/commit/82656276caf4cb889193572d2d14dbc5f3d2bdff


--

___
Python tracker 

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



[issue27535] Ignored ResourceWarning warnings leak memory in warnings registries

2017-11-22 Thread STINNER Victor

Change by STINNER Victor :


--
pull_requests: +4445

___
Python tracker 

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



[issue26439] ctypes.util.find_library fails when ldconfig/glibc not available (e.g., AIX)

2017-11-22 Thread Roundup Robot

Change by Roundup Robot :


--
pull_requests: +

___
Python tracker 

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



[issue32100] IDLE: PathBrowser isn't working

2017-11-22 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

The reason double-clicking got worse from 3.6.3 to now is this.  Previously, 
browser.ModuleBrowserTreeItem.OnDoubleClick ignored the file_open global (set 
to pyshell.flist.open in .__init__) and called pyshell.flist.open.  The Class 
and Method OnDoubleClick called file_open.  So double-clicking a file name in 
pathbrowser opened the file, but expanding a file and double-clicking a class 
or function name raised "'NoneType' object is not callable".  I don't know if I 
ever tried the latter before.  We subsequently changed the Module DoubleClick 
to also use file_open, so double clicking a file name also raises. (I meant to 
submit this yesterday.)

--

___
Python tracker 

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



[issue10544] yield expression inside generator expression does nothing

2017-11-22 Thread Ivan Levkivskyi

Change by Ivan Levkivskyi :


--
assignee: levkivskyi -> 

___
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-22 Thread STINNER Victor

STINNER Victor  added the comment:


New changeset bb11c3c967afaf263e00844d4ab461b7fafd6d36 by Victor Stinner in 
branch 'master':
bpo-31324: Fix test.support.set_match_tests(None) (#4505)
https://github.com/python/cpython/commit/bb11c3c967afaf263e00844d4ab461b7fafd6d36


--

___
Python tracker 

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



[issue19610] Give clear error messages for invalid types used for setup.py params (e.g. tuple for classifiers)

2017-11-22 Thread Berker Peksag

Berker Peksag  added the comment:

Thanks for the ping and for the review! I will open a PR this week.

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



[issue28009] core logic of uuid.getnode() is broken for AIX - all versions

2017-11-22 Thread Michael Felt

Michael Felt  added the comment:

x064 is AIX 5.3, x071 is AIX 6.1, x072 is AIX 7.1 - in the following output

On 11/20/2017 9:01 PM, Serhiy Storchaka wrote:
> Serhiy Storchaka  added the comment:
>
> What return commands `ifconfig`, `ifconfig -a`, `ifconfig -av`, `ip link 
> list`, `arp -an`, `lanscan -ai` (if not error)?
ifconfig:

ichael@x071:[/home/michael]dsh -n x064,x071,x072 ifconfig
x071: usage: ifconfig -a [ -d ] [ -u ] [ af ]
x071:    ifconfig -l [ -d ] [ -u ]
x071:    ifconfig interface
x071: [ af [ address [ dest_addr ] ] [ netmask mask ] [ 
broadcast addr ]
x071:  [ alias ] [ delete ] ]
x071: [ up ] [ down ] [ detach ]
x071: [ af first[alias] address [ ... ] ]
x071: [ site6 site_number ]
x071: [ metric n ]
x071: [ mtu n ]
x071: [ arp | -arp ]
x071: [ link0 | -link0 ] [ link1 | -link1 ] [ link2 | -link2 ]
x071: [ tcp_low_rto n | -tcp_low_rto ]
x071: [ inet6 scope n zone n ]
x071: [[ inet4 | inet6 ][address transfer newinterface]]
x071:    ifconfig tap_interface [ create | destroy ]
x064: usage: ifconfig -a [ -m ] [ -d ] [ -u ] [ af ]
x064:    ifconfig -l [ -d ] [ -u ]
x064:    ifconfig [ -m ] interface
x064: [ af [ address [ dest_addr ] ] [ netmask mask ] [ 
broadcast addr ]
x064:  [ alias ] [ delete ] ]
x064: [ up ] [ down ] [ detach ]
x064: [ af first[alias] address [ ... ] ]
x064: [ site6 site_number ]
x064: [ metric n ]
x064: [ mtu n ]
x064: [ arp | -arp ]
x064: [ link0 | -link0 ] [ link1 | -link1 ] [ link2 | -link2 ]
x064: [ tcp_low_rto n | -tcp_low_rto ]
x072: usage: ifconfig -a [ -d ] [ -u ] [ af ]
x072:    ifconfig -l [ -d ] [ -u ]
x072:    ifconfig interface
x072: [ af [ address [ dest_addr ] ] [ netmask mask ] [ 
broadcast addr ]
x072:  [ alias ] [ delete ] ]
x072: [ up ] [ down ] [ detach ]
x072: [ af first[alias] address [ ... ] ]
x072: [ site6 site_number ]
x072: [ metric n ]
x072: [ mtu n ]
x072: [ arp | -arp ]
x072: [ link0 | -link0 ] [ link1 | -link1 ] [ link2 | -link2 ]
x072: [ tcp_low_rto n | -tcp_low_rto ]
x072: [ inet6 scope n zone n ]
x072:    ifconfig tap_interface [ create | destroy ]

ifconfig -a:

michael@x071:[/home/michael]dsh -n x064,x071,x072 "ifconfig -a"
x071: en0: 
flags=1e084863,14c0
x071:   inet 192.168.129.71 netmask 0xff00 broadcast 192.168.129.255
x071:   inet 192.168.90.71 netmask 0xff00 broadcast 192.168.90.255
x071:   inet6 fe80::f8d1:8cff:fef7:6204%2/64
x071:    tcp_sendspace 262144 tcp_recvspace 262144 tcp_nodelay 1 rfc1323 1
x071: en1: 
flags=1e084863,480
x071:   inet 192.168.2.1 netmask 0xff00 broadcast 192.168.2.255
x071:    tcp_sendspace 262144 tcp_recvspace 262144 rfc1323 1
x071: lo0: 
flags=e08084b,c0
x071:   inet 127.0.0.1 netmask 0xff00 broadcast 127.255.255.255
x071:   inet6 ::1%1/128
x071:    tcp_sendspace 131072 tcp_recvspace 131072 rfc1323 1
x064: en0: 
flags=1e080863,c0
x064:   inet 192.168.129.64 netmask 0xff00 broadcast 192.168.129.255
x064:    tcp_sendspace 131072 tcp_recvspace 65536
x064: lo0: 
flags=e08084b
x064:   inet 127.0.0.1 netmask 0xff00 broadcast 127.255.255.255
x064:   inet6 ::1/0
x064:    tcp_sendspace 131072 tcp_recvspace 131072 rfc1323 1
x072: en0: 
flags=1e084863,480
x072:   inet 192.168.129.72 netmask 0xff00 broadcast 192.168.129.255
x072:    tcp_sendspace 262144 tcp_recvspace 262144 rfc1323 1
x072: lo0: 
flags=e08084b,c0
x072:   inet 127.0.0.1 netmask 0xff00 broadcast 127.255.255.255
x072:   inet6 ::1%1/64
x072:    tcp_sendspace 131072 tcp_recvspace 131072 rfc1323 1

ifconfig -av:

michael@x071:[/home/michael]dsh -n x064,x071,x072 "ifconfig -av"
x071: ifconfig: illegal option -- v
x071: usage: ifconfig -a [ -d ] [ -u ] [ af ]
x071:    ifconfig -l [ -d ] [ -u ]
x071:    ifconfig interface
x071: [ af [ address [ dest_addr ] ] [ netmask mask ] [ 
broadcast addr ]
x071:  [ alias ] [ delete ] ]
x071: [ up ] [ down ] [ detach ]
x071: [ af first[alias] address [ ... ] ]
x071: [ site6 site_number ]
x071: [ metric n ]
x071: [ mtu n ]
x071: [ arp | -arp ]

[issue19610] Give clear error messages for invalid types used for setup.py params (e.g. tuple for classifiers)

2017-11-22 Thread Éric Araujo

Éric Araujo  added the comment:

Latest patch seems good.  Berker, would you have the time to adapt for 3.7 and 
submit as a PR?

--

___
Python tracker 

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



[issue32116] CSV import and export simplified

2017-11-22 Thread Paul Long

Paul Long  added the comment:

Thanks for your advice.  The reason it's not provided as a canned function is 
because different schools can use different programming languages, although the 
vast majority choose to use Python.

--

___
Python tracker 

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



[issue19610] Give clear error messages for invalid types used for setup.py params (e.g. tuple for classifiers)

2017-11-22 Thread Henk-Jaap Wagenaar

Henk-Jaap Wagenaar  added the comment:

This is still present, and also silently affects Python 2.7 as evidenced here: 
https://github.com/pypa/setuptools/issues/1163

I am happy to adapt Berker Peksags patch to a PR, if he is?

--
nosy: +Henk-Jaap Wagenaar
versions: +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



[issue32022] Python crashes with mutually recursive code

2017-11-22 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

I confirmed that increasing the recursion limit can change recursion behavior 
on Windows.

>>> def f(): g()
...
>>> def g(): f()
...
>>> f()

With the default limit or 1000 or increase to 3000, I get a recursion error.  
With the limit set to 1, I get 'MemoryError: stack overflow'.  It is not 
too surprising that the more complicated code prevents getting even that.

--

___
Python tracker 

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



[issue32116] CSV import and export simplified

2017-11-22 Thread R. David Murray

R. David Murray  added the comment:

Um.  If they aren't expected to understand how to write this code, why isn't it 
being provided to them as a canned function as part of the test environment?

To succeed in getting something like this added, I suspect you will need to 
show that it has more general utility, or there is something analogous that can 
be added that has more general utility.  I recommend starting a discussion on 
the python-ideas mailing list.

By the way, if I needed this in my code, I'd write:

  with open(file_name, newline="") as csvfile:
  my_list = list(csv.reader(csvfile))

  with open(file_name, 'w', newline="") as csvfile:
  csv.writer(csvfile).writerows(my_list)

Only if I needed it more than once would I bother wrapping it in a function.

--

___
Python tracker 

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



[issue32116] CSV import and export simplified

2017-11-22 Thread Paul Long

Paul Long  added the comment:

I should have added that there are thousands of 15 year old students completing 
GCSE Computer Science who would benefit massively from this.  All the exam 
boards in England require students to be able to read from and write to CSV 
files.  The complicated way of doing it in Python is making this quite 
inaccessible to most students and so although many programmers in general 
wouldn't need this very often, there are literally thousands of students who 
would benefit from this enhancement.

--

___
Python tracker 

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



[issue32116] CSV import and export simplified

2017-11-22 Thread R. David Murray

R. David Murray  added the comment:

Thanks for the suggestion, but I'm -0.5.  I don't think these are compelling 
enough to be worth adding to the module API.  The number of times I've done 
this kind of operation is far smaller than the number of times I've had other 
code in both the input and output loops.  *Far* smaller.

--
nosy: +r.david.murray

___
Python tracker 

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



[issue32116] CSV import and export simplified

2017-11-22 Thread Paul Long

New submission from Paul Long :

It would be helpful if the CSV module included standard functions that simplify 
the import of CSV files to a list and the export of CSV files to a list.  
Here's an example of what they could be:

def csv2list(file_name): 
list_name=[] 
with open(file_name) as csvfile:
readerfile = reader(csvfile)
for row in readerfile:
list_name.append(row)
return list_name

def list2csv(list_name,file_name):
with open(file_name, 'w', newline='') as csvfile:
writerfile = csv.writer(csvfile)
writerfile.writerows(list_name)

--
components: Library (Lib)
messages: 306746
nosy: paullongnet
priority: normal
severity: normal
status: open
title: CSV import and export simplified
type: enhancement

___
Python tracker 

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



[issue32115] Ignored SIGCHLD causes asyncio.Process.wait to hang forever

2017-11-22 Thread rogpeppe

New submission from rogpeppe :

If some parent process has disabled SIGCHLD, that signal is inherited and stops 
that signal being delivered, which means that asyncio.Process.wait will never 
complete.

As an example, the plan9port terminal window, 9term, 
(https://9fans.github.io/plan9port/man/man1/9term.html) does this, and hence 
causes async Python processes to hang forever.

Python should probably code defensively against this and ensure that SIGCHLD is 
enabled regardless. Attached is some C code that demonstrates the issue when 
the following python code is saved to "tst.py".

#!/usr/bin/env python3
import asyncio

async def do_exec():
cmd = ['echo', 'hello, world']
process = await asyncio.create_subprocess_exec(*cmd, env={})
await process.wait()

loop=asyncio.get_event_loop()
try:
loop.run_until_complete(do_exec())
finally:
loop.close()



demonstration of the issue.

--
components: asyncio
files: tst.c
messages: 306745
nosy: rogpeppe, yselivanov
priority: normal
severity: normal
status: open
title: Ignored SIGCHLD causes asyncio.Process.wait to hang forever
type: behavior
versions: Python 3.5
Added file: https://bugs.python.org/file47283/tst.c

___
Python tracker 

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



[issue32114] The get_event_loop change in bpo28613 did not update the documentation

2017-11-22 Thread R. David Murray

New submission from R. David Murray :

No changes were made to the documentation of get_event_loop when its behavior 
was modified to return the loop running the future/coroutine when called from 
that context.  The documentation still says it gets the loop associated with 
the thread unconditionally.

--
components: Demos and Tools
messages: 306744
nosy: r.david.murray, yselivanov
priority: normal
severity: normal
stage: needs patch
status: open
title: The get_event_loop change in bpo28613 did not update the documentation
type: behavior
versions: Python 3.6, Python 3.7, Python 3.8

___
Python tracker 

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



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

2017-11-22 Thread STINNER Victor

STINNER Victor  added the comment:

Oops, the commit 803ddd8ce22f0de3ab42fb98a225a704c000ef06 broke the GCC job on 
Travis CI:
---
Run tests sequentially

0:00:00 load avg: 48.91 [  1/404] test_grammar

0:00:00 load avg: 48.91 [  2/404] test_opcodes

0:00:00 load avg: 48.91 [  3/404] test_dict

0:00:00 load avg: 48.91 [  4/404] test_builtin

0:00:00 load avg: 48.91 [  5/404] test_exceptions

0:00:01 load avg: 48.91 [  6/404] test_types

0:00:01 load avg: 48.91 [  7/404] test_unittest

0:00:03 load avg: 48.91 [  8/404] test_doctest

0:00:04 load avg: 48.11 [  9/404] test_doctest2

0:00:04 load avg: 48.11 [ 10/404] test_support

0:00:07 load avg: 48.11 [ 11/404] test___all__

Traceback (most recent call last):

  File "/home/travis/build/python/cpython/Lib/test/__main__.py", line 2, in 


main()

  File "/home/travis/build/python/cpython/Lib/test/libregrtest/main.py", line 
585, in main

Regrtest().main(tests=tests, **kwargs)

  File "/home/travis/build/python/cpython/Lib/test/libregrtest/main.py", line 
510, in main

self._main(tests, kwargs)

  File "/home/travis/build/python/cpython/Lib/test/libregrtest/main.py", line 
536, in _main

self.run_tests()

  File "/home/travis/build/python/cpython/Lib/test/libregrtest/main.py", line 
458, in run_tests

self.run_tests_sequential()

  File "/home/travis/build/python/cpython/Lib/test/libregrtest/main.py", line 
379, in run_tests_sequential

result = runtest(self.ns, test)

  File "/home/travis/build/python/cpython/Lib/test/libregrtest/runtest.py", 
line 105, in runtest

support.set_match_tests(ns.match_tests)

  File "/home/travis/build/python/cpython/Lib/test/support/__init__.py", line 
1958, in set_match_tests

_match_test_patterns = tuple(patterns)

TypeError: 'NoneType' object is not iterable
---

Attached PR 4505 fixes it.

--

___
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-22 Thread STINNER Victor

Change by STINNER Victor :


--
pull_requests: +4443

___
Python tracker 

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



[issue32022] Python crashes with mutually recursive code

2017-11-22 Thread STINNER Victor

STINNER Victor  added the comment:

(Oops, must be closed as "wont fix".)

--
resolution: fixed -> wont fix

___
Python tracker 

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



[issue32022] Python crashes with mutually recursive code

2017-11-22 Thread STINNER Victor

STINNER Victor  added the comment:

I close the issue for the reasons given in the latest comments. Sorry!

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

___
Python tracker 

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



[issue32096] Py_DecodeLocale() fails if used before the runtime is initialized.

2017-11-22 Thread STINNER Victor

STINNER Victor  added the comment:

I created a new PR adding a a new _PyCoreConfig.pythonpath field:
https://github.com/python/cpython/pull/4504

Once it will be merged, I will work on a new PR for PYTHONHOME (add a new 
_PyCoreConfig.pythonhome field).

--

___
Python tracker 

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



[issue32030] PEP 432: Rewrite Py_Main()

2017-11-22 Thread STINNER Victor

Change by STINNER Victor :


--
pull_requests: +4442

___
Python tracker 

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



[issue32022] Python crashes with mutually recursive code

2017-11-22 Thread Mark Dickinson

Mark Dickinson  added the comment:

I was going to suggest that this might be a documentation issue, but the 
existing documentation already looks sufficient to me:

> A user may need to set the limit higher when they have a program that
> requires deep recursion and a platform that supports a higher limit.
> This should be done with care, because a too-high limit can lead to a
> crash.

>From https://docs.python.org/3/library/sys.html#sys.setrecursionlimit

--

___
Python tracker 

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



[issue32022] Python crashes with mutually recursive code

2017-11-22 Thread Mark Dickinson

Mark Dickinson  added the comment:

> I suggest to close it as WONTFIX.

Agreed. If you use sys.setrecursionlimit, you're deliberately bypassing 
Python's safety mechanisms. A crash due to stack overflow shouldn't be 
considered a bug under these circumstances.

--
nosy: +mark.dickinson

___
Python tracker 

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



[issue32096] Py_DecodeLocale() fails if used before the runtime is initialized.

2017-11-22 Thread STINNER Victor

STINNER Victor  added the comment:

>  We *don't* currently have anything like that for environment variables, not 
> even the ones which are "read once at startup, then never read them again".

I changed Py_Main() in bpo-32030. Now multiple environment variables are read 
once at startup and put into _PyCoreConfig:

https://github.com/python/cpython/blob/803ddd8ce22f0de3ab42fb98a225a704c000ef06/Modules/main.c#L1365-L1413

I added new fields to _PyCoreConfig:

https://github.com/python/cpython/blob/803ddd8ce22f0de3ab42fb98a225a704c000ef06/Include/pystate.h#L27-L39

I suggest to continue to add more fields to _PyCoreConfig to move all code to 
configure Python before Py_Initialize(), and later to let users embedding 
Python to configure Python as they want, without losing features. For example, 
to enable the new "development mode" (-X dev), now you "just" have to set 
_PyCoreConfig.dev_mode to 1.

--

___
Python tracker 

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



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

2017-11-22 Thread Xavier de Gaye

Change by Xavier de Gaye :


--
pull_requests: +4441

___
Python tracker 

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



[issue32113] Strange behavior with await in a generator expression

2017-11-22 Thread Ivan Levkivskyi

Ivan Levkivskyi  added the comment:

A first simple idea that comes to my mind is special-case async 
generators/iterators in PyObject_GetIter to say something like:

TypeError: asynchronous iterable can't be used where an iterable is expected

If it is possible to detect that an async generator is resulting from a 
generator expression, then we can say:

TypeError: asynchronous generator expression can't be used as an iterable

--

___
Python tracker 

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



[issue27535] Ignored ResourceWarning warnings leak memory in warnings registries

2017-11-22 Thread STINNER Victor

STINNER Victor  added the comment:

I published my WIP work on optimizing warnings: PR 4502, it's based on PR 4489. 
The code should be cleaned up, especially the "_PyRuntime" part. The default 
action caching should be fixed.

--

___
Python tracker 

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



[issue27535] Ignored ResourceWarning warnings leak memory in warnings registries

2017-11-22 Thread STINNER Victor

Change by STINNER Victor :


--
pull_requests: +4440

___
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-22 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

PR 4501 makes the parser emitting a SyntaxWarning for chained `in` and `not in` 
comparison operators. In future it can be turned into a SyntaxError.

But this should be first discussed on Python-Dev.

--

___
Python tracker 

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



[issue32113] Strange behavior with await in a generator expression

2017-11-22 Thread Yury Selivanov

Yury Selivanov  added the comment:

> ... result = list(await g(i) for i in range(3))

This is equivalent to this code:

  async def ait():
  for i in range(3):
  v = await g(i)
  yield v

  result = list(ait())

Where 'ait' is an async generator function.  You can't iterate it with the 
regular 'for x in ...' syntax, and you can't pass it to functions that expect a 
synchronous iterator (such as 'list').

Similarly, with synchronous code:

  a = (i for i in range(3))
  a[0]
  Traceback (most recent call last):
File "", line 1, in 
  TypeError: 'generator' object is not subscriptable

where '(' for ... ')' is another syntax for defining a synchronous generator.


> ... result = [await g(i) for i in range(3)]

This is equivalent to this code:

  result = []
  for i in range(3):
  v = await g(i)
  result.append(v)


I agree that PEP 530 is a bit vague about this and can be updated.  I'll take a 
look into that.

Perhaps we can make the "TypeError: 'async_generator' object is not iterable" 
error message a bit clearer.  Any ideas to improve it are welcome.

> I would say that the first case should either behave as a second one, or 
> raise a syntax error.

No, but we can improve error messages.

--

___
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-22 Thread Serhiy Storchaka

Change by Serhiy Storchaka :


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

___
Python tracker 

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



[issue32113] Strange behavior with await in a generator expression

2017-11-22 Thread Ivan Levkivskyi

New submission from Ivan Levkivskyi :

PEP 530 is not very clear about `await` in generator expressions. But when I 
try it, the error is a bit confusing:

>>> async def g(i):
... print(i)
... 
>>> async def f():
... result = list(await g(i) for i in range(3))
... print(result)
... 
>>> f().send(None)
Traceback (most recent call last):
  File "", line 1, in 
  File "", line 2, in f
TypeError: 'async_generator' object is not iterable

At the same time a (seemingly) equivalent list comprehension works fine:

>>> async def f():
... result = [await g(i) for i in range(3)]
... print(result)
... 
>>> f().send(None)
0
1
2
[None, None, None]
Traceback (most recent call last):
  File "", line 1, in 
StopIteration

I would say that the first case should either behave as a second one, or raise 
a syntax error.

Or is it actually an intended behavior?

--
components: Interpreter Core
messages: 306732
nosy: levkivskyi, yselivanov
priority: normal
severity: normal
status: open
title: Strange behavior with await in a generator expression
type: behavior
versions: Python 3.6, Python 3.7

___
Python tracker 

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



[issue10544] yield expression inside generator expression does nothing

2017-11-22 Thread Serhiy Storchaka

Change by Serhiy Storchaka :


--
nosy: +serhiy.storchaka
versions: +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



[issue5710] ctypes should return composite types from callbacks

2017-11-22 Thread Pam McA'Nulty

Pam McA'Nulty  added the comment:

oops - 
"In the example code, the 'result' variable is declared on the stack in the 
callback() function.  So it will be effectively when callback() returns." 
should be 
"In the example code, the 'result' variable is declared on the stack in the 
callback() function.  So it will be effectively DESTROYED when callback() 
returns."

I hate waking up at 4:15a.

--

___
Python tracker 

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



[issue5710] ctypes should return composite types from callbacks

2017-11-22 Thread Pam McA'Nulty

Pam McA'Nulty  added the comment:

In the example code, the 'result' variable is declared on the stack in the 
callback() function.  So it will be effectively when callback() returns.

Also the "result" variable in main() is never referenced.  A pointer main()'s 
"result" variable should be passed to callback() as an argument ("") and 
`callback(struct helloStruct *result)` should populate it (via `result->i = 
10;` etc)

```struct helloStruct callback () {
  struct helloStruct result;
  result.i = 10;
  result.f = 3.14159;
  return result;
}```

--
nosy: +Pam.McANulty

___
Python tracker 

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



[issue32033] The pwd module implementation incorrectly sets some attributes to None

2017-11-22 Thread STINNER Victor

STINNER Victor  added the comment:

> And at least for pw_shell the behavior for NULL and "" are different.

What is the difference between the two?

--

___
Python tracker 

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



[issue32112] Should uuid.UUID() accept another UUID() instance?

2017-11-22 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

Not always the constructor accept an instance of the same class. I'm sure that 
this is not true in the majority of cases.

The constructor of int accepts an instance of int and the constructor of tuple 
accepts an instance of tuple because the constructor of int accepts an 
arbitrary real number, and the constructor of tuple accepts an arbitrary 
iterable, and int and tuple are a real number and an iterable correspondingly. 
There is no reason to forbid accepting an instance of the same class in these 
cases.

In contrary, the UUID constructor accepts a hexadecimal string, but UUID itself 
is not a hexadecimal string. Similarly the range constructor doesn't accept a 
range instance, and the file constructor doesn't accept a file instance.

>>> range(range(3))
Traceback (most recent call last):
  File "", line 1, in 
TypeError: 'range' object cannot be interpreted as an integer
>>> io.FileIO(io.FileIO('/dev/null'))
Traceback (most recent call last):
  File "", line 1, in 
TypeError: expected str, bytes or os.PathLike object, not _io.FileIO

For converting an existing UUID instance to UUID you can can first convert it 
to str:

newvalue = uuid.UUID(str(oldvalue))

Or better avoid the conversion at all.

if isisnstance(oldvalue, uuid.UUID):
newvalue = oldvalue
else:
newvalue = uuid.UUID(oldvalue)

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue32109] Separated square brackets will generate a tuple instead of a list.

2017-11-22 Thread R. David Murray

R. David Murray  added the comment:

Yes, the markup (and therefore how the code is displayed in the docs) clearly 
indicates that the , between the lists is not part of the python syntax being 
discussed.

--
nosy: +r.david.murray

___
Python tracker 

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



[issue31841] Several methods of collections.UserString do not return instances of UserString or its subclasses

2017-11-22 Thread Dmitry Kazakov

Dmitry Kazakov  added the comment:

I added a PR.

FWIW, I still think it would make sense to change the return type of 
UserString.join, and maybe *split* and *partition methods (to return list/tuple 
of UserString objects) for the sake of consistency.

--

___
Python tracker 

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



[issue31841] Several methods of collections.UserString do not return instances of UserString or its subclasses

2017-11-22 Thread Dmitry Kazakov

Change by Dmitry Kazakov :


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

___
Python tracker 

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



[issue27535] Ignored ResourceWarning warnings leak memory in warnings registries

2017-11-22 Thread STINNER Victor

STINNER Victor  added the comment:

I implemented a cache for warnings.filters in C. With my WIP patch which 
doesn't touch the registry for the ignore action, warnings.warn() is now faster 
than the current code ;-)

haypo@selma$ ./python -m perf compare_to ref.json patch.json 
Mean +- std dev: [ref] 938 ns +- 72 ns -> [patch] 843 ns +- 57 ns: 1.11x faster 
(-10%)

There is a single test in test_warnings which modifies directly 
warnings.filters:

@support.cpython_only
def test_issue31416(self):
# warn_explicit() shouldn't cause an assertion failure in case of a
# bad warnings.filters or warnings.defaultaction.
wmod = self.module
with original_warnings.catch_warnings(module=wmod):
wmod.filters = [(None, None, Warning, None, 0)]
with self.assertRaises(TypeError):
wmod.warn_explicit('foo', Warning, 'bar', 1)

wmod.filters = []
with support.swap_attr(wmod, 'defaultaction', None), \
 self.assertRaises(TypeError):
wmod.warn_explicit('foo', Warning, 'bar', 1)

I don't think that it's common to modify warnings.filters directly. Maybe we 
can make this sequence immutable in the public API to prevent misuse of the 
warnings API? To force users to use warnings.simplefilter() and 
warnings.filterwarnings()?

IMHO the main usage of modifying directyl warnings.filters it to save/restore 
filters. But there is already an helper for that: warnings.catch_warnings().

--

___
Python tracker 

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



[issue32109] Separated square brackets will generate a tuple instead of a list.

2017-11-22 Thread Berker Peksag

Berker Peksag  added the comment:

That's why I mentioned ``[a], [a, b, c]`` in my earlier message.

--

___
Python tracker 

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



[issue27535] Ignored ResourceWarning warnings leak memory in warnings registries

2017-11-22 Thread STINNER Victor

STINNER Victor  added the comment:

The performance bottleneck of warnings.warn() is the dance between the C 
_warnings module and the Python warnings module. The C code retrieves many 
attributes, like warnings.filters, at each call, and does conversion from 
Python objects to C objects.

There is already a mecanism to invalidate a "cache" in the C module: 
warnings._filters_mutated() is called by warnings.filterwarnings() for example.

Maybe the C module could convert all filters at once into an efficient C 
structure, but throw this away once on cache invalidation.

The problem is that I'm not sure that it's ok to implement such deeper cache at 
C level. Is it part of the warnings "semantics" to allow users to modify 
directly warnings.filters? Must the C module always lookup in sys.modules if 
the 'warnings' modules didn't change?

Outside test_warnings, do you know an use case where lookup for the 'warnings' 
module and 'warnings.filters' must be done at *each* warnings.warn() call?

--

___
Python tracker 

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



[issue32112] Should uuid.UUID() accept another UUID() instance?

2017-11-22 Thread Antti Haapala

Antti Haapala  added the comment:

I've been hit by this too, in similar contexts, and several times. It is really 
annoying that it is easier to coerce an UUID or UUID-string to a string than to 
coerce to a UUID. Usually when the copy semantics are clear and the class is 
plain old data, Python lets you execute the constructor with an instance of the 
same class:

>>> bytes(bytes())
b''
>>> bytearray(bytearray())
bytearray(b'')
>>> int(int())
0
>>> complex(complex())
0j
>>> tuple(tuple())
()

I don't to see why this shouldn't be true with UUID as well.

--
nosy: +ztane

___
Python tracker 

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



[issue27535] Ignored ResourceWarning warnings leak memory in warnings registries

2017-11-22 Thread STINNER Victor

STINNER Victor  added the comment:

> $ ./python -m perf compare_to ref.json patch.json 
> Mean +- std dev: [ref] 903 ns +- 70 ns -> [patch] 1.06 us +- 0.06 us: 1.17x 
> slower (+17%)

We are talking about a difference of 157 nanoseconds. On the same laptop, a 
Python function call which does nothing already takes 76.6 ns +- 4.1 ns. So the 
overhead of my PR 4489 is the cost of two Python function calls which do 
nothing. Do you think that it's an inacceptable overhead?

--

___
Python tracker 

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



[issue32109] Separated square brackets will generate a tuple instead of a list.

2017-11-22 Thread Cheryl Sabella

Cheryl Sabella  added the comment:

Perhaps this is what the YCMove meant?

>>> a = [1], [2, 3, 4]
>>> a
([1], [2, 3, 4])
>>>

--
nosy: +csabella

___
Python tracker 

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



[issue32112] Should uuid.UUID() accept another UUID() instance?

2017-11-22 Thread Martijn Pieters

New submission from Martijn Pieters :

When someone accidentally passes in an existing uuid.UUID() instance into 
uuid.UUID(), an attribute error is thrown because it is not a hex string:

>>> import uuid
>>> value = uuid.uuid4()
>>> uuid.UUID(value)
Traceback (most recent call last):
  File "", line 1, in 
  File 
"/Users/mjpieters/Development/Library/buildout.python/parts/opt/lib/python2.7/uuid.py",
 line 133, in __init__
hex = hex.replace('urn:', '').replace('uuid:', '')
AttributeError: 'UUID' object has no attribute 'replace'

This happened in the Stack Overflow question at 
https://stackoverflow.com/q/47429929/100297, because the code there didn't take 
into account that some database drivers may already have mapped the PostgreSQL 
UUID column to a Python uuid.UUID() object.

The fix could be as simple as:

if hex is not None:
if isinstance(hex, uuid.UUID):
int = hex.int
else:
hex = hex.replace('urn:', '').replace('uuid:', '')
hex = hex.strip('{}').replace('-', '')
if len(hex) != 32:
raise ValueError('badly formed hexadecimal UUID string')
int = int_(hex, 16)

Or we could add a uuid=None keyword argument, and use 

if hex is not None:
if isinstance(hex, uuid.UUID):
uuid = hex
else:
hex = hex.replace('urn:', '').replace('uuid:', '')
hex = hex.strip('{}').replace('-', '')
if len(hex) != 32:
raise ValueError('badly formed hexadecimal UUID string')
int = int_(hex, 16)
if uuid is not None:
int = uuid.int

--
messages: 306719
nosy: mjpieters
priority: normal
severity: normal
status: open
title: Should uuid.UUID() accept another UUID() instance?

___
Python tracker 

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



[issue32096] Py_DecodeLocale() fails if used before the runtime is initialized.

2017-11-22 Thread Nick Coghlan

Nick Coghlan  added the comment:

Speaking of surprises with static initialization of the runtime allocations: 
both PRs are failing in CI, suggesting that the changes that Py_Initialize 
makes to the allocator settings aren't being reverted in Py_Finalize, so 
there's a mismatch between the allocation function and the deallocation 
function.

--

___
Python tracker 

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



[issue32096] Py_DecodeLocale() fails if used before the runtime is initialized.

2017-11-22 Thread Nick Coghlan

Nick Coghlan  added the comment:

Victor, please stop trying to conflate the two questions of "How should we fix 
the current Py_DecodeLocale regression before 3.7.0a3?" and "What do we want to 
do long term?".

They're far from being the same question, and answering the second one properly 
is going to be much harder and more involved than just doing the bare minimum 
needed to make the previously supported embedding logic work again (even if it 
means postponing some of the dynamic allocator changes we'd like to make).

Omitting PYTHONHOME and PYTHONPATH from the core config is deliberate, as the 
interpreter doesn't support external imports yet when just the core has been 
initialized - only builtin and frozen ones.

Anything related to external imports should ultimately end up in the main 
interpreter configuration: 
https://www.python.org/dev/peps/pep-0432/#supported-configuration-settings

Longer term, I also want to rewrite getpath.c in Python (or at least primarily 
using Python lists and strings via the C API instead of relaying C arrays and C 
string manipulation functions).

However, our work on refactoring Py_Main has also shown me that we're going to 
need some additional structs to hold the raw(ish) command line arguments and 
environment variables in order to easily pass them around to other internal 
configuration APIs.

Modules/main.c already defines _Py_CommandLineDetails for the command line 
settings: https://github.com/python/cpython/blob/master/Modules/main.c#L382

We *don't* currently have anything like that for environment variables, not 
even the ones which are "read once at startup, then never read them again".

--

___
Python tracker 

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



[issue27535] Ignored ResourceWarning warnings leak memory in warnings registries

2017-11-22 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

I think it is common if filters don't depend on the warning test. In this case 
we can test and set the key (None, category, lineno) before (text, category, 
lineno).

--

___
Python tracker 

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



[issue32033] The pwd module implementation incorrectly sets some attributes to None

2017-11-22 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

On your second link it is documented explicitly that pw_dir and pw_shell might 
be NULL. And at least for pw_shell the behavior for NULL and "" are different.

--

___
Python tracker 

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



[issue32111] ObjectListView crashes on python3.5

2017-11-22 Thread Christian Heimes

Change by Christian Heimes :


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



[issue32111] ObjectListView crashes on python3.5

2017-11-22 Thread Balakrishnan Unnithan

Balakrishnan Unnithan  added the comment:

Yes, I am using this 3rd party library. Okay, I shall withdraw the issue from 
here.
I'm new to Python and hence do not know the various groups and their purpose.
Apologies!
Thanks for the support.

Version info:
ObjectListView 1.3.1
Python 3.5.4 (v3.5.4:3f56838, Aug  8 2017, 02:07:06) [MSC v.1900 32 bit 
(Intel)] on win32

--

___
Python tracker 

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



[issue27535] Ignored ResourceWarning warnings leak memory in warnings registries

2017-11-22 Thread Nick Coghlan

Nick Coghlan  added the comment:

Touching the filesystem implicitly can have all sorts of unintentional side 
effects (especially in read-only environments), so we strongly prefer not to do 
that.

The most general solution here would be to turn the warnings registry into an 
LRU cache - short-lived applications wouldn't see any changes, while long-lived 
applications with changing warning messages would hit the upper bound and then 
stay there.

I also like Victor's change to have the "ignore" option skip touching the 
registry. If we decide we still want to optimise out the linear filter scan for 
those cases, then I'd suggest lazily building a dispatch table with separate 
per-category warnings filter lists (updating the dispatch table on the next 
emitted warning after the filter list changes), and then only falling back to 
scanning the full filter list for warning categories that aren't an exact match 
for anything in the dispatch table.

--
nosy: +ncoghlan

___
Python tracker 

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



[issue32111] ObjectListView crashes on python3.5

2017-11-22 Thread Ronald Oussoren

Ronald Oussoren  added the comment:

This appears to be an issue with a 3th-party library 
(https://pypi.python.org/pypi/ObjectListView), not CPython itself.

The repository (and issue tracker) for that library is at 
. 

@Balakrishnan: could you confirm that you are using this library? And if so, 
please file an issue with that project.

--
nosy: +ronaldoussoren

___
Python tracker 

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



[issue32110] Make codecs.StreamReader.read() more compatible with read() of other files

2017-11-22 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

> That's not true. .read(1) will at most read 1 byte from the stream
> and decode it. There's no way it will return 70 characters.

See the added tests. They are failed without changing the read() method.

.read(1) currently returns all characters from the characters buffer. And this 
buffer can be not empty after .readline().

I understand the reason of having two limitation parameters in 
StreamReader.read(). But currently its behavior does not completely match the 
expected behavior of the read() method with one argument.

Actually size already has been used instead of chars if chars < 0 for reading 
in a loop. The code can be simplified.

--

___
Python tracker 

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



[issue32111] ObjectListView crashes on python3.5

2017-11-22 Thread Balakrishnan Unnithan

Balakrishnan Unnithan  added the comment:

Issue:
On Python3.5, ObjectListView object crashes when double-clicked in cell to edit 
int type.
-
Traceback (most recent call last):
  File "C:\DevEnv\Python35\lib\site-packages\ObjectListView\ObjectListView.py", 
line 1726, in _HandleLeftClickOrDoubleClick
self._PossibleStartCellEdit(rowIndex, subItemIndex)
  File "C:\DevEnv\Python35\lib\site-packages\ObjectListView\ObjectListView.py", 
line 2048, in _PossibleStartCellEdit
self.StartCellEdit(rowIndex, subItemIndex)
  File "C:\DevEnv\Python35\lib\site-packages\ObjectListView\ObjectListView.py", 
line 2114, in StartCellEdit
self.cellEditor.SetValue(evt.cellValue)
  File "C:\DevEnv\Python35\lib\site-packages\ObjectListView\CellEditor.py", 
line 268, in SetValue
if isinstance(value, (long, int, float)):
NameError: name 'long' is not defined
-
On debugging, I found that the actual root-cause of this bug lies in below code:
File: ..lib\site-packages\ObjectListView\CellEditor.py
Line: 100
-
def __init__(self):
self.typeToFunctionMap = {}

# Standard types and their creator functions
self.typeToFunctionMap[str] = self._MakeStringEditor
self.typeToFunctionMap[six.text_type] = self._MakeStringEditor
self.typeToFunctionMap[bool] = self._MakeBoolEditor

if six.PY2:
self.typeToFunctionMap[int] = self._MakeIntegerEditor
self.typeToFunctionMap[long] = self._MakeLongEditor
else:
#Line:100   
self.typeToFunctionMap[int] = self._MakeLongEditor

self.typeToFunctionMap[float] = self._MakeFloatEditor
self.typeToFunctionMap[datetime.datetime] = self._MakeDateTimeEditor
self.typeToFunctionMap[datetime.date] = self._MakeDateEditor
self.typeToFunctionMap[datetime.time] = self._MakeTimeEditor
-
Modified code:
-
if six.PY2:
self.typeToFunctionMap[int] = self._MakeIntegerEditor
self.typeToFunctionMap[long] = self._MakeLongEditor
else:
#Line:100 
self.typeToFunctionMap[int] = self._MakeIntegerEditor
-
In place of integer type editor, long type editor is being created.
As Python3.x does not support long type, the programme crashes here.

--
status: pending -> open

___
Python tracker 

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



[issue32111] ObjectListView crashes on python3.5

2017-11-22 Thread Serhiy Storchaka

New submission from Serhiy Storchaka :

Could you provide more information Balakrishnan?

--
nosy: +serhiy.storchaka
status: open -> pending

___
Python tracker 

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



[issue32111] ObjectListView crashes on python3.5

2017-11-22 Thread Balakrishnan Unnithan

Change by Balakrishnan Unnithan :


--
components: Extension Modules
nosy: Balakrishnan Unnithan
priority: normal
severity: normal
status: open
title: ObjectListView crashes on python3.5
type: crash
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



[issue32096] Py_DecodeLocale() fails if used before the runtime is initialized.

2017-11-22 Thread STINNER Victor

STINNER Victor  added the comment:

> As an alternative to that, we could also deprecate using any of those 
> functions before initializing the runtime.   Instead of calling them, you 
> would set the relevant info on the runtime "config" struct that you pass to 
> the replacement for PyInitialize().

Currently, _PyCoreConfig is not complete: you cannot pass PYTHONPATH or 
PYTHONHOME. I'm working on patches to implement that.

Moreover, there is the question how to decode a bytes path (for PYTHONPATH) 
into a wchar_t* string.

Disallow calling Py_DecodeLocale() before Py_Initialize(): ok, but which 
alternative do you propose to decode OS data?

--

___
Python tracker 

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



[issue32033] The pwd module implementation incorrectly sets some attributes to None

2017-11-22 Thread Xavier de Gaye

Xavier de Gaye  added the comment:

Changing test_pwd does not correct the fact that the current implementation of 
the pwd module may break an existing Python application since this (old indeed) 
API states "The uid and gid items are integers, all others are strings".

> returning an empty string instead of None will make impossible to distinguish 
> NULL from "".

AFAIK in the 50 years since the creation of the unix operating system, there 
has never been an implementation of pwd that states that a string field may be 
either an empty string or NULL. And it is doubtful that there will ever be one, 
since this would break all (all, not just the Python applications) existing 
applications using pwd.

--

___
Python tracker 

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



[issue32107] test_uuid uses the incorrect bitmask

2017-11-22 Thread STINNER Victor

STINNER Victor  added the comment:

> https://travis-ci.org/python/cpython/jobs/305433725

AssertionError: 219902322 is not false : 0242ac110051
AssertionError: 219902322 is not false : 0242ac110051

So the Travis CI MAC address is 02:42:ac:11:00:51.

--
nosy: +vstinner

___
Python tracker 

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



  1   2   >