[issue12154] PyDoc Partial Functions

2018-11-05 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

Adding my analysis here which is also at related issue : issue30129. On the 
attached program written by @skip.montanaro both c.sum and Child.sum return 
None for inspect.getdocs thus docstrings in pydoc are empty which can be fixed 
in both functools and inspect module as below : 

1. When we do inspect.getdoc(c.sum) where c is a partialmethod it looks for 
obj.__doc__ (c.sum.__doc__) returning partialmethod.__doc__ ("new function with 
partial...") instead of checking if c.sum is a partial method and  returning 
obj.func.__doc__ which contains the relevant doc ("sum doc"). Thus getdoc needs 
to check before trying for obj.__doc__ if the obj is a partialmethod or partial 
object thus returning the original function object.

2. When we do inspect.getdoc(Child.sum) it looks for obj.__doc__ 
(Child.sum.__doc__) and since Child.sum is a partialmethod which has __get__ 
overridden it calls _make_unbound_method that returns a _method object with no 
doc and thus returning None. partialmethod object copies objects from the given 
function at [0] and the actual object is returned at [1] . Here self.func has 
the original function in this case Base.sum and _method._partialmethod has 
reference to Base.sum which contains the relevant docs but _method itself has 
no docs thus pydoc doesn't get any docs. So we can set _method.__doc__ = 
self.func.__doc__ and getdoc can pick up the docs.

[0] 
https://github.com/python/cpython/blob/f1b9ad3d38c11676b45edcbf2369239bae436e56/Lib/functools.py#L368
[1] 
https://github.com/python/cpython/blob/f1b9ad3d38c11676b45edcbf2369239bae436e56/Lib/functools.py#L401

Before patch partialmethod.__doc__ : 

$ ./python.exe
>>> import functools, inspect
>>> inspect.getdoc(functools.partial(int, base=2))
'partial(func, *args, **keywords) - new function with partial application\nof 
the given arguments and keywords.'

After patch returns int.__doc__ : 

./python.exe
>>> import functools, inspect
>>> inspect.getdoc(functools.partial(int, base=2))
"int([x]) -> integer\nint(x, base=10) -> integer\n\nConvert a number or string 
to an integer ..." # Trimmed

# Patch

diff --git a/Lib/functools.py b/Lib/functools.py
index ab7d71e126..751f67fcd0 100644
--- a/Lib/functools.py
+++ b/Lib/functools.py
@@ -398,6 +398,7 @@ class partialmethod(object):
 return self.func(*call_args, **call_keywords)
 _method.__isabstractmethod__ = self.__isabstractmethod__
 _method._partialmethod = self
+_method.__doc__ = self.func.__doc__ or self.__doc__
 return _method

 def __get__(self, obj, cls):
diff --git a/Lib/inspect.py b/Lib/inspect.py
index b8a142232b..2c796546b2 100644
--- a/Lib/inspect.py
+++ b/Lib/inspect.py
@@ -600,6 +600,9 @@ def getdoc(object):
 All tabs are expanded to spaces.  To clean up docstrings that are
 indented to line up with blocks of code, any whitespace than can be
 uniformly removed from the second line onwards is removed."""
+if isinstance(object, (functools.partialmethod, functools.partial)):
+return object.func.__doc__
+
 try:
 doc = object.__doc__
 except AttributeError:

--
nosy: +xtreak
Added file: https://bugs.python.org/file47910/bpo30129.py

___
Python tracker 

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



[issue30129] functools.partialmethod should look more like what it's impersonating.

2018-11-05 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

I did some analysis with the given example script. Related issue where Aaron 
has some analysis : issue12154 . The patch doesn't break anything since there 
are no tests for this that also could be added.

1. When we do inspect.getdoc(c.sum) it looks for obj.__doc__ (c.sum.__doc__) 
returning partialmethod.__doc__ ("new function with partial...") instead of 
checking if c.sum is a partial method and  returning obj.func.__doc__ which 
contains the relevant doc ("sum doc"). Thus getdoc needs to check before trying 
for obj.__doc__ if the obj is a partialmethod or partial object thus returning 
the original function object.

2. When we do inspect.getdoc(Child.sum) it looks for obj.__doc__ 
(Child.sum.__doc__) and since Child.sum is a partialmethod which has __get__ 
overridden it calls _make_unbound_method that returns a _method object with no 
doc and thus returning None. partialmethod object copies objects from the given 
function at 
https://github.com/python/cpython/blob/f1b9ad3d38c11676b45edcbf2369239bae436e56/Lib/functools.py#L368
 and the actual object is returned at 
https://github.com/python/cpython/blob/f1b9ad3d38c11676b45edcbf2369239bae436e56/Lib/functools.py#L401
 . Here self.func has the original function in this case Base.sum and 
_method._partialmethod has reference to Base.sum which contains the relevant 
docs but _method itself has no docs thus pydoc doesn't get any docs. So we can 
set _method.__doc__ = self.func.__doc__ and getdoc can pick up the docs.

sample script with

print(pydoc.render_doc(Child))
print(pydoc.render_doc(c))
print(inspect.getdoc(c.sum)) # Need to patch getdoc before it checks for 
obj.__doc__ to check if the c.sum is an instance of partialmethod or partial
print(inspect.getdoc(Child.sum)) # Need to patch 
functools.partialmethod._make_unbound_method to copy the docs to _method

Output :

```
Python Library Documentation: class Child in module __main__

class Child(builtins.object)
 |  Methods defined here:
 |
 |  diff(self, arg1, arg2)
 |  diff doc
 |
 |  sum = _method(self, arg2)
 |  sum doc
 |
 |  --
 |  Data descriptors defined here:
 |
 |  __dict__
 |  dictionary for instance variables (if defined)
 |
 |  __weakref__
 |  list of weak references to the object (if defined)

Python Library Documentation: Child in module __main__ object

class Child(builtins.object)
 |  Methods defined here:
 |
 |  diff(self, arg1, arg2)
 |  diff doc
 |
 |  sum = _method(self, arg2)
 |  sum doc
 |
 |  --
 |  Data descriptors defined here:
 |
 |  __dict__
 |  dictionary for instance variables (if defined)
 |
 |  __weakref__
 |  list of weak references to the object (if defined)

sum doc
sum doc

```

patch : 

diff --git a/Lib/functools.py b/Lib/functools.py
index ab7d71e126..751f67fcd0 100644
--- a/Lib/functools.py
+++ b/Lib/functools.py
@@ -398,6 +398,7 @@ class partialmethod(object):
 return self.func(*call_args, **call_keywords)
 _method.__isabstractmethod__ = self.__isabstractmethod__
 _method._partialmethod = self
+_method.__doc__ = self.func.__doc__ or self.__doc__
 return _method

 def __get__(self, obj, cls):
diff --git a/Lib/inspect.py b/Lib/inspect.py
index b8a142232b..2c796546b2 100644
--- a/Lib/inspect.py
+++ b/Lib/inspect.py
@@ -600,6 +600,9 @@ def getdoc(object):
 All tabs are expanded to spaces.  To clean up docstrings that are
 indented to line up with blocks of code, any whitespace than can be
 uniformly removed from the second line onwards is removed."""
+if isinstance(object, (functools.partialmethod, functools.partial)):
+return object.func.__doc__
+
 try:
 doc = object.__doc__
 except AttributeError:

--
nosy: +xtreak

___
Python tracker 

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



[issue35174] Calling for super().__str__ seems to call self.__repr__ in list subclass

2018-11-05 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

list inherits __str__ from object. object.__str__() calls __repr__() which can 
be overridden in subclasses. So if you want repr() and str() returned the same, 
you need to define only the __repr__() method. This is a feature, not a bug.

--
nosy: +serhiy.storchaka
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

___
Python tracker 

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



[issue35143] Annotations future requires unparse, but not accessible from Python

2018-11-05 Thread Eric V. Smith


Change by Eric V. Smith :


--
nosy: +eric.smith

___
Python tracker 

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



[issue34897] distutils test errors when CXX is not set

2018-11-05 Thread Tal Einat


Tal Einat  added the comment:

Michael, please read more about comparisons[1] and the None object[2].

[1] https://docs.python.org/3/library/stdtypes.html#comparisons
[2] https://docs.python.org/3/library/stdtypes.html#the-null-object

--

___
Python tracker 

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



[issue33578] cjkcodecs missing getstate and setstate implementations

2018-11-05 Thread INADA Naoki


Change by INADA Naoki :


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



[issue17185] unittest mock create_autospec doesn't correctly replace mocksignature

2018-11-05 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

Is this being worked on or can I try fixing this?

My analysis so far is as below : 

1. For functions : inspect.signature looks for attribute __signature__ for 
functions and while creating the mock for a function since we already have the 
signature we can set __signature__ attribute during _set_signature. I don't 
know why __signature__ was set. I downloaded mock from GitHub to look at the 
actual mocksignature implementation which uses lambda signature: 
_mock_signature to form a mock function which I hope is done here too with a 
function constructed and evald with sig.bind used for parameter checking. I am 
still new to the mocksignature internals so I couldn't understand how 
mocksignature worked.


2. For class and partial functions _check_signature is called and __call__ is 
overriden in the mock class to check for signature during initialization acting 
like a constructor. The actual signature will have self along with rest of the 
parameters but _get_signature_object checks for __init__ and skips the self 
thus the constructor signature skips self to return a partial function which 
makes comparing actual constructor call with self and the partial function 
signature without self to fail.


Attaching a sample patch with tests. Hope I am on the right track and guidance 
would help. I am changing the version to 3.8

diff --git a/Lib/unittest/mock.py b/Lib/unittest/mock.py
index a9c82dcb5d..8cbef0e514 100644
--- a/Lib/unittest/mock.py
+++ b/Lib/unittest/mock.py
@@ -103,6 +103,7 @@ def _check_signature(func, mock, skipfirst, instance=False):
 sig.bind(*args, **kwargs)
 _copy_func_details(func, checksig)
 type(mock)._mock_check_sig = checksig
+type(mock).__signature__ = sig


 def _copy_func_details(func, funcopy):
@@ -172,11 +173,11 @@ def _set_signature(mock, original, instance=False):
 return mock(*args, **kwargs)""" % name
 exec (src, context)
 funcopy = context[name]
-_setup_func(funcopy, mock)
+_setup_func(funcopy, mock, sig)
 return funcopy


-def _setup_func(funcopy, mock):
+def _setup_func(funcopy, mock, sig):
 funcopy.mock = mock

 # can't use isinstance with mocks
@@ -224,6 +225,7 @@ def _setup_func(funcopy, mock):
 funcopy.assert_called = assert_called
 funcopy.assert_not_called = assert_not_called
 funcopy.assert_called_once = assert_called_once
+funcopy.__signature__ = sig

 mock._mock_delegate = funcopy


Initial set of tests where partial function and class test fails : 

def test_spec_inspect_signature(self):
def foo(a: int, b: int=10, *, c:int) -> int:
return a  b  c

mock = create_autospec(foo)
assert inspect.getfullargspec(mock) == inspect.getfullargspec(foo)
self.assertRaises(TypeError, mock, 1)

def test_spec_inspect_signature_partial(self):
def foo(a: int, b: int=10, *, c:int) -> int:
return a  b  c

import functools

partial_object = functools.partial(foo, 1)
mock = create_autospec(partial_object)
assert inspect.getfullargspec(mock) == 
inspect.getfullargspec(partial_object) # Fails
self.assertRaises(TypeError, partial_object)

def test_spec_inspect_signature_class(self):
class Bar:
def __init__(self, a: int):
self.a = a

mock = create_autospec(Bar)
assert inspect.getfullargspec(mock) == inspect.getfullargspec(Bar) # Fails 
since mock signature has no self
self.assertRaises(TypeError, mock)
self._check_someclass_mock(mock)

--
versions: +Python 3.8 -Python 3.4, Python 3.5

___
Python tracker 

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



[issue35156] Consider revising documentation on Python Builds from source

2018-11-05 Thread Jorge Ramos


Jorge Ramos  added the comment:

Although I appreciate the confidence placed in me, I think I'm not exactly the 
most competent person to make changes to such an important project. I know what 
-probably- could be improved (from my very narrow point of view) but I don't 
even know where or how to start so to not screw things up. 

Don't get me wrong, participating in a project like this (no matter how minor 
the contribution) is an exciting thought but I ignore so many things that I'm 
afraid I would probably make it worse rather than making it better. Those 
things where written for a reason and I'm not even close to know or understand 
the context on why it was so, as to make a meaningful contribution.

--

___
Python tracker 

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



[issue35157] Missing pyconfig.h when building from source and pgo flag is enabled

2018-11-05 Thread Jorge Ramos


Jorge Ramos  added the comment:

Yes, my last message is a trimmed version of my next to last message (which 
itself is a trimmed version of all the verbose of the build, showing just after 
the PGO interpreter wakes up). Although, obviously they where run at different 
times (one run completed in 31 minutes while the other was in 35 minutes), 
because I no longer had the output of my next to last message available.

Other than that, the messages are 'identical'. The commands followed to get to 
this are:

git clone g...@github.com:neyuru/cpython.git
git remote add upstream g...@github.com:python/cpython.git
git remote -v
cd cpython
git checkout 3.6
PCBuild\get_externals.bat
Tools\msi\get_externals.bat
PCBuild\build.bat -d -p x64
PCBuild\build.bat --pgo -p x64

--

___
Python tracker 

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



[issue35171] test_TimeRE_recreation_timezone failure on systems with non-default posixrules

2018-11-05 Thread miss-islington


miss-islington  added the comment:


New changeset ffbce43c1aa457b5976665eb2e47771198c7af06 by Miss Islington (bot) 
in branch '2.7':
closes bpo-35171: Fix test_TimeRE_recreation_timezone failure on some systems. 
(GH-10347)
https://github.com/python/cpython/commit/ffbce43c1aa457b5976665eb2e47771198c7af06


--

___
Python tracker 

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



[issue35171] test_TimeRE_recreation_timezone failure on systems with non-default posixrules

2018-11-05 Thread miss-islington


miss-islington  added the comment:


New changeset d0e3105f7ca3fc54b167edc756ce545cbab0ce95 by Miss Islington (bot) 
in branch '3.6':
closes bpo-35171: Fix test_TimeRE_recreation_timezone failure on some systems. 
(GH-10347)
https://github.com/python/cpython/commit/d0e3105f7ca3fc54b167edc756ce545cbab0ce95


--

___
Python tracker 

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



[issue35171] test_TimeRE_recreation_timezone failure on systems with non-default posixrules

2018-11-05 Thread miss-islington


miss-islington  added the comment:


New changeset ca592bcf56fca9321033132fe20fdeff985a by Miss Islington (bot) 
in branch '3.7':
closes bpo-35171: Fix test_TimeRE_recreation_timezone failure on some systems. 
(GH-10347)
https://github.com/python/cpython/commit/ca592bcf56fca9321033132fe20fdeff985a


--
nosy: +miss-islington

___
Python tracker 

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



[issue35174] Calling for super().__str__ seems to call self.__repr__ in list subclass

2018-11-05 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

Adding the related StackOverflow question here for some context : 
https://stackoverflow.com/questions/53156623/calling-for-super-str-seem-to-call-self-repr-in-list-subclass

Thanks

--
nosy: +xtreak

___
Python tracker 

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



[issue35171] test_TimeRE_recreation_timezone failure on systems with non-default posixrules

2018-11-05 Thread miss-islington


Change by miss-islington :


--
pull_requests: +9658

___
Python tracker 

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



[issue35171] test_TimeRE_recreation_timezone failure on systems with non-default posixrules

2018-11-05 Thread miss-islington


Change by miss-islington :


--
pull_requests: +9659

___
Python tracker 

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



[issue35171] test_TimeRE_recreation_timezone failure on systems with non-default posixrules

2018-11-05 Thread miss-islington


Change by miss-islington :


--
pull_requests: +9657

___
Python tracker 

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



[issue35171] test_TimeRE_recreation_timezone failure on systems with non-default posixrules

2018-11-05 Thread Benjamin Peterson


Benjamin Peterson  added the comment:


New changeset f1b9ad3d38c11676b45edcbf2369239bae436e56 by Benjamin Peterson 
(Alexey Izbyshev) in branch 'master':
closes bpo-35171: Fix test_TimeRE_recreation_timezone failure on some systems. 
(GH-10347)
https://github.com/python/cpython/commit/f1b9ad3d38c11676b45edcbf2369239bae436e56


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



[issue23220] IDLE: Document how Shell displays user code output

2018-11-05 Thread Terry J. Reedy


Change by Terry J. Reedy :


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



[issue35099] Improve the IDLE - console differences doc

2018-11-05 Thread miss-islington


miss-islington  added the comment:


New changeset 54bcb6c0f185be29b2a626d2f1430c110c823a7d by Miss Islington (bot) 
in branch '3.6':
bpo-35099: Update idlelib/help.html (GH-10353)
https://github.com/python/cpython/commit/54bcb6c0f185be29b2a626d2f1430c110c823a7d


--

___
Python tracker 

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



[issue35099] Improve the IDLE - console differences doc

2018-11-05 Thread miss-islington


miss-islington  added the comment:


New changeset 4a46295a95bc2e7a93bcf0ce4cdaeeeb48729069 by Miss Islington (bot) 
in branch '3.7':
bpo-35099: Update idlelib/help.html (GH-10353)
https://github.com/python/cpython/commit/4a46295a95bc2e7a93bcf0ce4cdaeeeb48729069


--

___
Python tracker 

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



[issue35099] Improve the IDLE - console differences doc

2018-11-05 Thread miss-islington


Change by miss-islington :


--
pull_requests: +9655

___
Python tracker 

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



[issue35099] Improve the IDLE - console differences doc

2018-11-05 Thread miss-islington


Change by miss-islington :


--
pull_requests: +9654

___
Python tracker 

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



[issue35099] Improve the IDLE - console differences doc

2018-11-05 Thread Terry J. Reedy


Terry J. Reedy  added the comment:


New changeset f1d3efc2fba704692d539acc3cb0376a1dd9d98f by Terry Jan Reedy in 
branch 'master':
bpo-35099: Update idlelib/help.html (#10353)
https://github.com/python/cpython/commit/f1d3efc2fba704692d539acc3cb0376a1dd9d98f


--

___
Python tracker 

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



[issue35156] Consider revising documentation on Python Builds from source

2018-11-05 Thread Steve Dower


Steve Dower  added the comment:

If you're able, you might be the best person to do some of those updates right 
now :) The rest of us will have to set aside time to get back up to speed on 
some of the details, and while we'll likely have to do that to review changes 
anyway, at least that's one less person to wait for.

--

___
Python tracker 

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



[issue35157] Missing pyconfig.h when building from source and pgo flag is enabled

2018-11-05 Thread Steve Dower


Steve Dower  added the comment:

How much have you edited the error messages you are posting? Those two build 
commands shouldn't be next to each other (the tests should be in between), so 
perhaps something is wrong in that script? Or maybe you trimmed the output 
before pasting it?

--

___
Python tracker 

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



[issue35099] Improve the IDLE - console differences doc

2018-11-05 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
pull_requests: +9653

___
Python tracker 

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



[issue9731] Add ABCMeta.has_methods and tests that use it

2018-11-05 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
pull_requests:  -9633

___
Python tracker 

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



[issue35099] Improve the IDLE - console differences doc

2018-11-05 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

I either removed or augmented occurrences of 'console' in the renamed section.

--
dependencies:  -IDLE Doc: Text consumes unlimited RAM, consoles likely not, 
IDLE: Document how Shell displays user code output
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



[issue35174] Calling for super().__str__ seems to call self.__repr__ in list subclass

2018-11-05 Thread Camion


New submission from Camion :

I don't know if this is by design (for what reason ?) or if it is a bug, but I 
have noticed this quite counter-intuitive behaviour :

Doing that, it seems that the logical way to make the __repr__ and __str__ 
methods, would be to override respectively the parent __repr__ and _str__ 
methods, and calling them from the inherited versions, but for some reason, it 
seems that calling super().__str__ leads to call self.__repr__.

I have written the following piece of python-3 code in which I subclass the 
list class in order to make a class which supports storing names and unnamed 
fields the same way you can have variable named and unnamed parameters in a 
function call :

class struct(list):
def __init__(self, *args, **kwargs):
super().__init__(args)
for key, value in kwargs.items():
setattr(self, key, value)

def __repr__(self):
s = super().__repr__()[1:-1]
for key, val in self.__dict__.items():
s += ', '+key+'='+repr(val)
return 'struct('+s+')'

def __str__(self):
s = super().__str__()[1:-1]
print('Debug : super().__str__() = "'+super().__str__()+'"')
print('Debug : list(self).__str__() = "'+list(self).__str__()+'"')
print('Debug : s = "'+s+'"')
for key, val in self.__dict__.items():
s += ', '+key+'='+str(val)
return '{'+s+'}'

a = struct(1, 2, 3, a="akeja", b=21, c=True, d="lkj")
print('repr(a)="'+repr(a)+'"\n')
print('str(a)="'+str(a)+'"\n')

Executing this code in idle-3.5.2 will yield the following result :

>>> 
 RESTART: struct.py 
repr(a)="struct(1, 2, 3, b=21, d='lkj', a='akeja', c=True)"

Debug : super().__str__() = "struct(1, 2, 3, b=21, d='lkj', a='akeja', 
c=True)"
Debug : list(self).__str__() = "[1, 2, 3]"
Debug : s = "truct(1, 2, 3, b=21, d='lkj', a='akeja', c=True"
str(a)="{truct(1, 2, 3, b=21, d='lkj', a='akeja', c=True, b=21, d=lkj, 
a=akeja, c=True}"

>>> 

As one can see in the second debug lines, the call to `super().__str__()` which 
I expect to return the result from a call to the `__str__` function from my 
super class (`list`), will in fact return something which looks very much like 
the expected return from `self.__repr__()`

It seems that `super().__str__()` calls `self.__repr__()` instead of 
`list(self).__str__()` or even `super().__repr__()`.

--
components: Interpreter Core
messages: 329331
nosy: Camion
priority: normal
severity: normal
status: open
title: Calling for super().__str__ seems to call self.__repr__ in list subclass
type: behavior
versions: Python 3.5

___
Python tracker 

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



[issue35099] Improve the IDLE - console differences doc

2018-11-05 Thread miss-islington


miss-islington  added the comment:


New changeset 927a113ae2be33a9dd929569930f28948aa5c965 by Miss Islington (bot) 
in branch '3.6':
bpo-35099: Improve the doc about IDLE running user code. (GH-10350)
https://github.com/python/cpython/commit/927a113ae2be33a9dd929569930f28948aa5c965


--

___
Python tracker 

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



[issue35099] Improve the IDLE - console differences doc

2018-11-05 Thread miss-islington


miss-islington  added the comment:


New changeset a437c285fa4f21720802e7a91770b2281d576554 by Miss Islington (bot) 
in branch '3.7':
bpo-35099: Improve the doc about IDLE running user code. (GH-10350)
https://github.com/python/cpython/commit/a437c285fa4f21720802e7a91770b2281d576554


--
nosy: +miss-islington

___
Python tracker 

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



[issue35099] Improve the IDLE - console differences doc

2018-11-05 Thread miss-islington


Change by miss-islington :


--
pull_requests: +9652

___
Python tracker 

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



[issue35099] Improve the IDLE - console differences doc

2018-11-05 Thread miss-islington


Change by miss-islington :


--
pull_requests: +9651

___
Python tracker 

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



[issue35099] Improve the IDLE - console differences doc

2018-11-05 Thread Terry J. Reedy


Terry J. Reedy  added the comment:


New changeset 5e7909032491cef17754a3208872655fe350e9be by Terry Jan Reedy in 
branch 'master':
 bpo-35099: Improve the doc about IDLE running user code. (#10350)
https://github.com/python/cpython/commit/5e7909032491cef17754a3208872655fe350e9be


--

___
Python tracker 

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



[issue35099] Improve the IDLE - console differences doc

2018-11-05 Thread Terry J. Reedy


Change by Terry J. Reedy :


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



[issue35119] Customizing module attribute access example raises RecursionError

2018-11-05 Thread Ivan Levkivskyi


Change by Ivan Levkivskyi :


--
nosy:  -miss-islington
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



[issue35119] Customizing module attribute access example raises RecursionError

2018-11-05 Thread miss-islington


miss-islington  added the comment:


New changeset 558dc8adbec0b85e0ff257fcedc85c5d89cd2825 by Miss Islington (bot) 
in branch '3.7':
bpo-35119: Fix RecursionError in example of customizing module attribute 
access. (GH-10323)
https://github.com/python/cpython/commit/558dc8adbec0b85e0ff257fcedc85c5d89cd2825


--
nosy: +miss-islington

___
Python tracker 

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



[issue22276] pathlib glob ignores trailing slash in pattern

2018-11-05 Thread E Kawashima


Change by E Kawashima :


--
keywords: +patch
pull_requests: +9649
stage: test needed -> patch review

___
Python tracker 

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



[issue22021] shutil.make_archive() root_dir do not work

2018-11-05 Thread Lysandros Nikolaou


Lysandros Nikolaou  added the comment:

Is anybody working on this or can I submit a PR?

--
nosy: +lys.nikolaou

___
Python tracker 

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



[issue35119] Customizing module attribute access example raises RecursionError

2018-11-05 Thread miss-islington


Change by miss-islington :


--
pull_requests: +9648

___
Python tracker 

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



[issue35119] Customizing module attribute access example raises RecursionError

2018-11-05 Thread Ivan Levkivskyi


Ivan Levkivskyi  added the comment:


New changeset 0bee3c36d406e47fa9f99cfc1e07b701512c4f3f by Ivan Levkivskyi 
(Denis Osipov) in branch 'master':
bpo-35119: Fix RecursionError in example of customizing module attribute 
access. (GH-10323)
https://github.com/python/cpython/commit/0bee3c36d406e47fa9f99cfc1e07b701512c4f3f


--

___
Python tracker 

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



[issue35168] shlex punctuation_chars inconsistency

2018-11-05 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

It makes sense to me that information used in an expensive one-time setup 
should be specified in advance where other parameters that are more easily 
changed are specified downstream.  The API reflects the a sensible way to use 
the tool.  Making it to easy to change later increases the risk of misuse.

--
nosy: +rhettinger

___
Python tracker 

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



[issue35171] test_TimeRE_recreation_timezone failure on systems with non-default posixrules

2018-11-05 Thread Paul Ganssle


Change by Paul Ganssle :


--
nosy: +p-ganssle

___
Python tracker 

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



[issue33462] reversible dict

2018-11-05 Thread INADA Naoki


Change by INADA Naoki :


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



[issue33462] reversible dict

2018-11-05 Thread INADA Naoki

INADA Naoki  added the comment:


New changeset 6531bf6309c8fda1954060a0fb5ea930b1efb656 by INADA Naoki (RĆ©mi 
Lapeyre) in branch 'master':
bpo-33462: Add __reversed__ to dict and dict views (GH-6827)
https://github.com/python/cpython/commit/6531bf6309c8fda1954060a0fb5ea930b1efb656


--

___
Python tracker 

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



[issue35173] Re-use already existing functionality to allow Python 2.7.x (both embedded and standalone) to locate the module path according to the shared library

2018-11-05 Thread Ali Rizvi-Santiago


Change by Ali Rizvi-Santiago :


--
title: Re-use already existing functionality to allow Python 2.7.x (both 
embedded and standalone) to locate the module path -> Re-use already existing 
functionality to allow Python 2.7.x (both embedded and standalone) to locate 
the module path according to the shared library

___
Python tracker 

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



[issue35173] Re-use already existing functionality to allow Python 2.7.x (both embedded and standalone) to locate the module path

2018-11-05 Thread Ali Rizvi-Santiago


New submission from Ali Rizvi-Santiago :

This is specific to the Windows platform as it's the only platform that uses 
the registry and other path hacks to identify the default module path. This 
patch is mostly intended for embedded Python, but is also applicable to a 
stand-alone Python.

A few years ago, I was looking at relocating my Python interpreter so that an 
embedded application (that I didn't have control over) would use the correct 
module path. While merging my code into CPython, I quickly noticed that Python 
already supported doing this with Py_ENABLE_SHARED but due to the 
implementation wasn't actually using it for some reason. The code that 
implements this is 10+ years old, so perhaps it was just an oversight or some 
other reason that I didn't know about.

Inside PC/getpathp.c there's a static variable, "dllpath", that is initialized 
with the path to the DLL that is being dynamically loaded when Py_ENABLE_SHARED 
is specified. Normally arg0 is used to locate the module path, but when 
embedding Python the .exe and thus arg0 is not involved. So, this patch uses 
"dllpath" by adding a final case to the calculation of the path by assigning it 
to "pythonhome" if the home was not able to be determined by any other means. 
This is done in 2 places within "calculatepath()".

This allows one to have multiple versions of Python (32-bit, 64-bit, older 
versions, etc) on the same Windows system and so a user should not need to copy 
the Python library into their System path or explicitly set any environment 
variables (unless truly desired of course). This should greatly simplify 
relocation of Python as the DLL and executable can be moved around without 
being dependant on any external invariants.

--
components: Interpreter Core
files: relocate-with-dllpath.patch
keywords: patch
messages: 329322
nosy: Ali Rizvi-Santiago
priority: normal
severity: normal
status: open
title: Re-use already existing functionality to allow Python 2.7.x (both 
embedded and standalone) to locate the module path
type: enhancement
versions: Python 2.7
Added file: https://bugs.python.org/file47909/relocate-with-dllpath.patch

___
Python tracker 

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



[issue35172] Add support for other MSVC compiler versions to distutils. distutils makes two incorrect assumption that MSVC compiler versions scale linearly and that the crt's are the same.

2018-11-05 Thread Ali Rizvi-Santiago


New submission from Ali Rizvi-Santiago :

Distutils makes a few incorrect assumptions that prevent it from supporting the 
newer Microsoft-y C compilers. This patch fixes it up till MSVC 14.0. There are 
2 assumptions that are made by distutils and they are as follows.

The first one is that MSVC's versions scale linearly (subtracting 6). This 
assumption breaks when encountering major version 13.0 as VS2013 (12.0) uses 
1800 and VS2015 (14.0) uses 1900 and so the calculation for version 13.0 does 
not actually exist. This was fixed in the patch for both msvc9compiler.py and 
msvccompiler.py by skipping the major version 13.

The second assumption is in the get_msvcr() function in cygwinccompiler.py and 
is responsible for identifying the CRT name. The newer versions of MSVC aren't 
listed, so these were added in the patch. However, for version 1900 (MSVC 14.0) 
the crt is now named "vcruntime140" which was included. It might be better to 
to make this table-based if there is long-term interest in supporting these 
other compilers.

These are the only issues that I've ever encountered over the years with 
building CPython 2.7.x with the newer VS compilers.

--
components: Distutils
files: distutils.patch
keywords: patch
messages: 329321
nosy: Ali Rizvi-Santiago, dstufft, eric.araujo
priority: normal
severity: normal
status: open
title: Add support for other MSVC compiler versions to distutils. distutils 
makes two incorrect assumption that MSVC compiler versions scale linearly and 
that the crt's are the same.
type: enhancement
versions: Python 2.7
Added file: https://bugs.python.org/file47908/distutils.patch

___
Python tracker 

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



[issue30533] missing feature in inspect module: getmembers_static

2018-11-05 Thread Lysandros Nikolaou


Change by Lysandros Nikolaou :


--
nosy: +lys.nikolaou

___
Python tracker 

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



[issue35171] test_TimeRE_recreation_timezone failure on systems with non-default posixrules

2018-11-05 Thread Alexey Izbyshev


Change by Alexey Izbyshev :


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

___
Python tracker 

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



[issue35171] test_TimeRE_recreation_timezone failure on systems with non-default posixrules

2018-11-05 Thread Alexey Izbyshev


New submission from Alexey Izbyshev :

I've got the following on OpenSUSE Tumbleweed (glibc 2.27):

==
FAIL: test_TimeRE_recreation_timezone (test.test_strptime.CacheTests)
--
Traceback (most recent call last):
  File "/scratch2/izbyshev/cpython/Lib/test/support/__init__.py", line 1683, in 
inner
return func(*args, **kwds)
  File "/scratch2/izbyshev/cpython/Lib/test/test_strptime.py", line 702, in 
test_TimeRE_recreation_timezone
self.assertEqual(tm.tm_isdst, 1)
AssertionError: 0 != 1

This test sets TZ environment variable to 'STD-1DST' and calls time.tzset() 
(inside support.run_with_tz decorator). This TZ value lacks rules that specify 
when DST transitions happen. POSIX seems to be silent what should be done if 
the rule is missing, thought it does specify that the rule is optional[1].

What actually happens at least on Linux/glibc[2] and FreeBSD[3] is that those 
rules are taken from 'posixrules' file. On OpenSUSE, it's linked to 
'/etc/localtime', which is linked to 'Europe/Moscow' in my case. DST 
transitions were cancelled in Russia in 2011, so when Python tries to get 
timezone names for two points of the year 
(https://github.com/python/cpython/blob/570e371fd6e8615ece9b9e21fbe77149ebeb172e/Modules/timemodule.c#L1603),
 it gets unexpected values instead. The actual values depend on the bugginess 
of the libc used:

* Glibc seems to be confused by having 'posixrules' file with DST cancelled but 
a specification which includes the DST timezone part, so localtime() returns 
'MSK' in tm_zone (both for January and July).

* musl doesn't implement 'posixrules' fallback, so it uses "all-zero" rules 
instead which cause it return 'DST' in both cases.

* FreeBSD 11.1 (with 'posixrules' linked to 'Europe/Moscow') returns 'STD' in 
both cases.

With any of the above, the test fails because strptime is called with the same 
timezone name two times.

Note that even if PyInit_timezone() didn't probe January/July and used 'tzname' 
global instead, it wouldn't work as expected at least on FreeBSD: it sets 
tzname[1] to the empty string in the test above.

ISTM the best way to fix this is to remove dependence on 'posixrules' file by 
specifying the rules in TZ.

[1] 
http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap08.html#tag_08
[2] http://man7.org/linux/man-pages/man3/tzset.3.html
[3] https://www.freebsd.org/cgi/man.cgi?query=tzset=3

--
components: Tests
messages: 329320
nosy: benjamin.peterson, izbyshev, serhiy.storchaka, vstinner
priority: normal
severity: normal
status: open
title: test_TimeRE_recreation_timezone failure on systems with non-default 
posixrules
type: behavior
versions: Python 2.7, Python 3.6, Python 3.7, Python 3.8

___
Python tracker 

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



[issue35145] sqlite3: "select *" should optionally sniff and autoconvert TEXT datetime fields

2018-11-05 Thread Robert Pollak


Robert Pollak  added the comment:

Paul, the sniffing would be only active for people who explicitly add a 
connect() argument like detect_types=DETECT_DATETIME, which can have the 
appropriate warning in the docs. You can also extend the sniffing to all 
values, not just the first non-missing one. (I'd gladly pay the computational 
price.) How many cases are there where a column is full of `-MM-DD 
HH:MM:SS.SSS` data, DETECT_DATETIME is switched on, and the user _doesn't_ want 
this column to be interpreted as datetime?

(I'm of course not suggesting to try detecting REAL as Julian day, or INTEGER 
as Unix Time.)

Forget about my test file, by the way:
I have now found out that I can extract the DATETIME type information from my 
test file SQLiteStudio-3449.sqlite in the following two ways:
```
In [3]: pd.read_sql_query('pragma table_info("t")', con)
Out[3]: 
   cid name  type  notnull dflt_value  pk
00x  TEXT0   None   0
11y  DATETIME0   None   0

In [4]: pd.read_sql_query('SELECT SQL FROM sqlite_master WHERE name = "t"', con)
Out[4]: 
   sql
0  CREATE TABLE t (x TEXT, y DATETIME)
```
For my real use case however, those two statements yield empty results :-(

--

___
Python tracker 

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



[issue34897] distutils test errors when CXX is not set

2018-11-05 Thread Michael Felt


Michael Felt  added the comment:

Thx.

So, while "" is not None (i.e., "" is not False), it does test as a Boolean 
expression as 'False' so the test for None or "" is the same as testing for "" 
(but not the same as testing for None).

I accept your logic - and shall make the change in the test in 
Lib/test/support/__init__.py rather than in the assignment in  
Lib/distutils/ccompiler.py

--

___
Python tracker 

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



[issue31793] Allow to specialize smart quotes in documentation translations

2018-11-05 Thread Julien Palard


Change by Julien Palard :


--
status: open -> closed

___
Python tracker 

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



[issue35170] 3.7.1 compile failure on CentOS 6.10; _ctypes did not build

2018-11-05 Thread lana.deere

New submission from lana.deere :

When I try to compile 3.7.1 on CentOS6.10 it fails to build _ctypes, but I 
can't find any indication of why.  There are several mentions of _ctypes during 
compiles,

building '_ctypes_test' extension
creating 
build/temp.linux-x86_64-3.7/home/twk/twkpers/opensrc/python-3.7.1/Python-3.7.1/Modules/_ctypes
/usr/bin/gcc -pthread -fPIC -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall 
-std=c99 -Wextra -Wno-unused-parameter -Wno-missing-field-initializers 
-Werror=implicit-function-declaration -I./Include -I. -I/usr/local/include 
-I/home/twk/twkpers/opensrc/python-3.7.1/Python-3.7.1/Include 
-I/home/twk/twkpers/opensrc/python-3.7.1/Python-3.7.1 -c 
/home/twk/twkpers/opensrc/python-3.7.1/Python-3.7.1/Modules/_ctypes/_ctypes_test.c
 -o 
build/temp.linux-x86_64-3.7/home/twk/twkpers/opensrc/python-3.7.1/Python-3.7.1/Modules/_ctypes/_ctypes_test.o
/usr/bin/gcc -pthread -shared 
build/temp.linux-x86_64-3.7/home/twk/twkpers/opensrc/python-3.7.1/Python-3.7.1/Modules/_ctypes/_ctypes_test.o
 -L/usr/local/lib -lm -o 
build/lib.linux-x86_64-3.7/_ctypes_test.cpython-37m-x86_64-linux-gnu.so

After that, it gets to listing modules later and says:

INFO: Could not locate ffi libs and/or headers

Python build finished successfully!
The necessary bits to build these optional modules were not found:
_ssl
To find the necessary bits, look in setup.py in detect_modules() for the 
module's name.


The following modules found by detect_modules() in setup.py, have been
built by the Makefile instead, as configured by the Setup files:
_abc  atexitpwd
time


Failed to build these modules:
_ctypes   _uuid


Could not build the ssl module!
Python requires an OpenSSL 1.0.2 or 1.1 compatible libssl with 
X509_VERIFY_PARAM_set1_host().
LibreSSL 2.6.4 and earlier do not provide the necessary APIs, 
https://github.com/libressl-portable/portable/issues/381


I can see the problem with _uuid, it's a conflict between headers.


In file included from 
/home/twk/twkpers/opensrc/python-3.7.1/Python-3.7.1/Modules/_uuidmodule.c:8:
/usr/include/uuid.h:94: error: conflicting types for ā€˜uuid_tā€™
/usr/include/uuid/uuid.h:44: note: previous declaration of ā€˜uuid_tā€™ was here
/usr/include/uuid.h:107: error: conflicting types for ā€˜uuid_compareā€™
/usr/include/uuid/uuid.h:73: note: previous declaration of ā€˜uuid_compareā€™ was 
here
/home/twk/twkpers/opensrc/python-3.7.1/Python-3.7.1/Modules/_uuidmodule.c: In 
function ā€˜py_uuid_generate_time_safeā€™:
/home/twk/twkpers/opensrc/python-3.7.1/Python-3.7.1/Modules/_uuidmodule.c:15: 
error: storage size of ā€˜uuidā€™ isnā€™t known
/home/twk/twkpers/opensrc/python-3.7.1/Python-3.7.1/Modules/_uuidmodule.c:15: 
warning: unused variable ā€˜uuidā€™


However, I see nothing indicating building the _ctypes extension other than the 
ctypes_test I mentioned already above.  Eventually the build aborts because of 
the missing _ctypes.


Generating grammar tables from 
/home/twk/twkpers/opensrc/python-3.7.1/Python-3.7.1-install/lib/python3.7/lib2to3/PatternGrammar.txt
Writing grammar tables to 
/home/twk/twkpers/opensrc/python-3.7.1/Python-3.7.1-install/lib/python3.7/lib2to3/PatternGrammar3.7.1.final.0.pickle
if test "xupgrade" != "xno"  ; then \
case upgrade in \
upgrade) ensurepip="--upgrade" ;; \
install|*) ensurepip="" ;; \
esac; \
 ./python -E -m ensurepip \
$ensurepip --root=/ ; \
fi
Traceback (most recent call last):
  File "/home/twk/twkpers/opensrc/python-3.7.1/Python-3.7.1/Lib/runpy.py", line 
193, in _run_module_as_main
"__main__", mod_spec)
  File "/home/twk/twkpers/opensrc/python-3.7.1/Python-3.7.1/Lib/runpy.py", line 
85, in _run_code
exec(code, run_globals)
  File 
"/home/twk/twkpers/opensrc/python-3.7.1/Python-3.7.1/Lib/ensurepip/__main__.py",
 line 5, in 
sys.exit(ensurepip._main())
  File 
"/home/twk/twkpers/opensrc/python-3.7.1/Python-3.7.1/Lib/ensurepip/__init__.py",
 line 204, in _main
default_pip=args.default_pip,
  File 
"/home/twk/twkpers/opensrc/python-3.7.1/Python-3.7.1/Lib/ensurepip/__init__.py",
 line 117, in _bootstrap
return _run_pip(args + [p[0] for p in _PROJECTS], additional_paths)
  File 
"/home/twk/twkpers/opensrc/python-3.7.1/Python-3.7.1/Lib/ensurepip/__init__.py",
 line 27, in _run_pip
import pip._internal
  File 
"/tmp/tmpz6ocn29e/pip-10.0.1-py2.py3-none-any.whl/pip/_internal/__init__.py", 
line 42, in 
  File 
"/tmp/tmpz6ocn29e/pip-10.0.1-py2.py3-none-any.whl/pip/_internal/cmdoptions.py", 
line 16, in 
  File 
"/tmp/tmpz6ocn29e/pip-10.0.1-py2.py3-none-any.whl/pip/_internal/index.py", line 
25, in 
  File 
"/tmp/tmpz6ocn29e/pip-10.0.1-py2.py3-none-any.whl/pip/_internal/download.py", 
line 39, in 
  File 
"/tmp/tmpz6ocn29e/pip-10.0.1-py2.py3-none-any.whl/pip/_internal/utils/glibc.py",
 line 3, in 
  File 
"/home/twk/twkpers/opensrc/python-3.7.1/Python-3.7.1/Lib/ctypes/__init__.py", 
line 7, in 
from _ctypes import Union, Structure, Array

[issue23734] zipimport should not check pyc timestamps against zipped py files

2018-11-05 Thread Elvis Pranskevichus


Elvis Pranskevichus  added the comment:

I don't think that breaking the .pyc contract by assumption is a good thing.  
The desired behavior of never checking the .pyc freshness can be achieved by 
using unchecked hash-based compilation, or using hash-based compilation and 
--check-hash-based-pycs=never.  Perhaps we can go further and add a 
--check-timestamp-based-pycs=never, but IMO, this should be explicit in all 
cases, including zipimport.

--
nosy: +Elvis.Pranskevichus

___
Python tracker 

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



[issue35168] shlex punctuation_chars inconsistency

2018-11-05 Thread Vinay Sajip


Vinay Sajip  added the comment:

I agree that it's inconsistent, but quite a bit of setting up is done when 
punctuation_chars is provided, as per the link in msg329312. One could convert 
the attribute to a property and have a setter that does the equivalent set up, 
but some of the setup is one-time (removing things from wordchars, etc.), and 
would require additional work to handle the case where the property is 
reassigned multiple times. I have no problem updating the documentation to 
indicate in a note that it must be provided in the constructor and not later, 
but apart from the fact that it's inconsistent, is there a use case for 
supporting setting it later? That would mean setting it up so that you could 
set it several times, unset it, etc.

--

___
Python tracker 

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



[issue35154] subprocess.list2cmdline() does not allow running some commands.

2018-11-05 Thread Roffild


Roffild  added the comment:

Yes, my mistake.

3.6/Lib/subprocess.py:970

--
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

___
Python tracker 

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



[issue17560] problem using multiprocessing with really big objects?

2018-11-05 Thread Oleksandr Buchkovskyi


Change by Oleksandr Buchkovskyi :


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

___
Python tracker 

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



[issue35169] Improve error messages for assignment

2018-11-05 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


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

___
Python tracker 

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



[issue35169] Improve error messages for assignment

2018-11-05 Thread Serhiy Storchaka


New submission from Serhiy Storchaka :

This is a follow up of issue34641.

>>> f(lambda x: x = 1)
  File "", line 1
SyntaxError: lambda cannot contain assignment
>>> f(x.y = 1)
  File "", line 1
SyntaxError: keyword can't be an expression

The error message "keyword can't be an expression" still looks confusing to me. 
This is because the term "keyword" is ambiguous. Usually it means reserved 
identifier like "if" or "def". Some keywords, like "None" and "True" can be 
expressions. Perhaps "keyword name can't be an expression" would be better.

But I think that in these cases it is most likely that "=" was used instead of 
"==". And it would be better to generalize the error message for lambdas and 
point on a possible typo.

>>> f(x.y = 1)
  File "", line 1
SyntaxError: expression cannot contain assignment, perhaps you meant "=="?

The proposed PR changes this error message. It makes also an error message for 
forbidden assignment more concrete: "cannot assign to __debug__" instead of 
"assignment to keyword" (the latter is actually incorrect, because __debug__ is 
not true keyword in tokenizer). This restores Python 2 error messages. Improved 
also other error messages for forbidden assigning: dict and set displays, 
f-string expressions are not literals.

--
components: Interpreter Core
messages: 329313
nosy: benjamin.peterson, brett.cannon, gvanrossum, serhiy.storchaka, yselivanov
priority: normal
severity: normal
status: open
title: Improve error messages for assignment
type: 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



[issue35167] Specify program for gzip and json.tool command line options

2018-11-05 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


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

___
Python tracker 

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



[issue35168] shlex punctuation_chars inconsistency

2018-11-05 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

Thanks for the report. The code was added with 
c1f974c944a3e73cbc9102356d8700a190dcafb3 and self._pushback_chars is declared 
only when punctuation_chars is passed to shlex.shlex in the constructor as you 
have mentioned in 
https://github.com/python/cpython/blob/master/Lib/shlex.py#L59 . Adding Vinay 
for thoughts on the usage.

--
nosy: +vinay.sajip, xtreak

___
Python tracker 

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



[issue35167] Specify program for gzip and json.tool command line options

2018-11-05 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset 8c5f14d9c137fbffbb9de7c62ca834df2e9fbf2a by Serhiy Storchaka 
(Miss Islington (bot)) in branch '3.6':
[3.6] bpo-35167: Specify program for json.tool command line options. (GH-10332) 
(GH-10338) (GH-10339)
https://github.com/python/cpython/commit/8c5f14d9c137fbffbb9de7c62ca834df2e9fbf2a


--

___
Python tracker 

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



[issue35168] shlex punctuation_chars inconsistency

2018-11-05 Thread tphh


New submission from tphh :

The newly added shlex.punctuation_chars is special compared to the other public 
instance variables: It can ONLY be used when constructing a shlex instance, 
unlike other public instance variables, such as commenters, which can ONLY be 
set later.

>>> s = shlex.shlex('abc // def')
>>> s.commenters = '/'
>>> list(s)
['abc', '', '']

>>> s = shlex.shlex('abc // def', punctuation_chars = '/')
>>> list(s)
['abc', '//', 'def']

However, setting punctuation_chars later shows this rather useless error 
message:

>>> s = shlex.shlex('abc // def')
>>> s.punctuation_chars = '/'
>>> list(s)
Traceback (most recent call last):
  File "", line 1, in 
  File "/opt/python/3.7.1/lib/python3.7/shlex.py", line 295, in __next__
token = self.get_token()
  File "/opt/python/3.7.1/lib/python3.7/shlex.py", line 105, in get_token
raw = self.read_token()
  File "/opt/python/3.7.1/lib/python3.7/shlex.py", line 133, in read_token
if self.punctuation_chars and self._pushback_chars:
AttributeError: 'shlex' object has no attribute '_pushback_chars'

--
components: Library (Lib)
messages: 329310
nosy: tphh
priority: normal
severity: normal
status: open
title: shlex punctuation_chars inconsistency
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



[issue35125] asyncio shield: remove inner callback on outer cancellation

2018-11-05 Thread Roundup Robot


Change by Roundup Robot :


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

___
Python tracker 

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



[issue35145] sqlite3: "select *" should optionally sniff and autoconvert TEXT datetime fields

2018-11-05 Thread Paul Ganssle


Paul Ganssle  added the comment:

With regards to automatically deducing column types, I am -1 on that. It has 
way too many dangerous edge cases, and I know of countless bugs in software 
that are the direct result of stringly-typed data being coerced into a specific 
data type based on its form. For example, if you have an excel column of 
alphanumeric strings and happen to get one that looks like "13943E1", that will 
be coerced (lossily) into the number 139430.0, because it happens to take the 
form of exponential notation.

> I contains a table `t` with a TEXT column `x` and a DATETIME (according to 
> SQLiteStudio) column `y`.

It sounds to me like SQLiteStudio is doing the same thing that Python is doing, 
by extending the "types" available to include a DATETIME. Presumably they do it 
the same way, with "datetime" in the column name. If that's the case then it's 
just a mismatch between what they call their datetime adapter and what python 
does, and you just need to rename the relevant columns to say "timestamp" 
instead of "datetime".

As an aside, this is what we get from people not offering real datetime types 
in their standards. JSON has the exact same problem - people need to transmit 
datetimes but there's no way to do it in the standard, so everyone extends the 
standard in a sightly different way and you end up with a bunch of incompatible 
ways of storing datetimes as strings. Bah humbug.

--

___
Python tracker 

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



[issue35167] Specify program for gzip and json.tool command line options

2018-11-05 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset 6ad277b2592cfac0f138e9adca4374dd1f354bdf by Serhiy Storchaka in 
branch '3.7':
[3.7] bpo-35167: Specify program for json.tool command line options. (GH-10332) 
(GH-10338)
https://github.com/python/cpython/commit/6ad277b2592cfac0f138e9adca4374dd1f354bdf


--

___
Python tracker 

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



[issue35167] Specify program for gzip and json.tool command line options

2018-11-05 Thread miss-islington


Change by miss-islington :


--
pull_requests: +9643

___
Python tracker 

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



[issue35156] Consider revising documentation on Python Builds from source

2018-11-05 Thread Jorge Ramos


Jorge Ramos  added the comment:

One more thing: point in case #6 does credit a revision IMO. The build_pgo.bat 
file does not exist.

--

___
Python tracker 

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



[issue35156] Consider revising documentation on Python Builds from source

2018-11-05 Thread Jorge Ramos


Jorge Ramos  added the comment:

Thank you, I think that will suffice. At least guide folks like myself who want 
to build from source and with optimizations in the right direction (on which 
folder to work on and which commands to issue to the terminal)

Please keep me posted.

--

___
Python tracker 

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



[issue35167] Specify program for gzip and json.tool command line options

2018-11-05 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
pull_requests: +9642

___
Python tracker 

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



[issue35157] Missing pyconfig.h when building from source and pgo flag is enabled

2018-11-05 Thread Jorge Ramos

Jorge Ramos  added the comment:

Hi:

Hmm.. but the installation does fail ("PGO run did not succeed (no 
python36!*.pgc files) and there is no data to merge"):

*
Total duration: 35 min 2 sec
Tests result: FAILURE

E:\repogit\cpython>"C:\Program Files (x86)\Microsoft Visual 
Studio\2017\Community\\MSBuild\15.0\Bin\msbuild.exe" 
"E:\RepoGiT\cpython\PCbuild\\pythoncore.vcxproj" /t:KillPython /nologo /v:m 
/p:Configuration=PGInstrument /p:Platform=x64 /p:KillPython=true
  Killing any running python.exe instances...

E:\repogit\cpython>"C:\Program Files (x86)\Microsoft Visual 
Studio\2017\Community\\MSBuild\15.0\Bin\msbuild.exe" 
"E:\RepoGiT\cpython\PCbuild\pcbuild.proj" /t:Build /m /nologo /v:m 
/p:Configuration=PGUpdate /p:Platform=x64 /p:IncludeExternals=true 
/p:IncludeSSL=true /p:IncludeTkinter=true /p:UseTestMarker= /p:GIT="C:\Program 
Files\Git\cmd\git.exe"
  Killing any running python.exe instances...
E:\RepoGiT\cpython\PCbuild\pyproject.props(173,5): error : PGO run did not 
succeed (no python36!*.pgc files) and there is no data to merge 
[E:\RepoGiT\cpython\PCbuild\pythoncore.vcxproj]




So I canĀ“t omit these issues and call it a day. =(

--

___
Python tracker 

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



[issue35133] Bugs in concatenating string literals on different lines

2018-11-05 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


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

___
Python tracker 

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



[issue35133] Bugs in concatenating string literals on different lines

2018-11-05 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset 3e3e1a27f769b3385853fbcad6749e71ca7f3ce3 by Serhiy Storchaka in 
branch '2.7':
[2.7] bpo-35133: Fix mistakes when concatenate string literals on different 
lines. (GH-10284) (GH-10335) (GH-10336)
https://github.com/python/cpython/commit/3e3e1a27f769b3385853fbcad6749e71ca7f3ce3


--

___
Python tracker 

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



[issue35167] Specify program for gzip and json.tool command line options

2018-11-05 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset 083a7a172b8c252d72031f21dcfea3c0d73f by Serhiy Storchaka in 
branch 'master':
bpo-35167: Specify program for gzip and json.tool command line options. 
(GH-10332)
https://github.com/python/cpython/commit/083a7a172b8c252d72031f21dcfea3c0d73f


--

___
Python tracker 

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



[issue35133] Bugs in concatenating string literals on different lines

2018-11-05 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
pull_requests: +9641

___
Python tracker 

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



[issue9731] Add ABCMeta.has_methods and tests that use it

2018-11-05 Thread Mark Lawrence


Change by Mark Lawrence :


--
nosy:  -BreamoreBoy

___
Python tracker 

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



[issue35133] Bugs in concatenating string literals on different lines

2018-11-05 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset 7054e5c80b6e98cd44e22d1bc2d7f0a94343089d by Serhiy Storchaka in 
branch '3.6':
[3.6] bpo-35133: Fix mistakes when concatenate string literals on different 
lines. (GH-10284) (GH-10335)
https://github.com/python/cpython/commit/7054e5c80b6e98cd44e22d1bc2d7f0a94343089d


--

___
Python tracker 

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



[issue35133] Bugs in concatenating string literals on different lines

2018-11-05 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
pull_requests: +9640

___
Python tracker 

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



[issue35133] Bugs in concatenating string literals on different lines

2018-11-05 Thread miss-islington


miss-islington  added the comment:


New changeset 7beb8c54ede7669a59bb9b912ba0ffd8aa3998c6 by Miss Islington (bot) 
in branch '3.7':
bpo-35133: Fix mistakes when concatenate string literals on different lines. 
(GH-10284)
https://github.com/python/cpython/commit/7beb8c54ede7669a59bb9b912ba0ffd8aa3998c6


--
nosy: +miss-islington

___
Python tracker 

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



[issue35156] Consider revising documentation on Python Builds from source

2018-11-05 Thread Steve Dower


Steve Dower  added the comment:

Most people building Python from the devguide are doing it for contributions, 
so I'd be very hesitant to change the default recommendations. But we should 
highlight how to make a working installable build (including the extra 
dependencies) and the common options on our scripts, as well as their -h 
options.

I also have a "layout" script coming that will make it easier for people to 
produce their own custom installers by at least copying the files into the 
right place.

--
stage:  -> needs patch
versions: +Python 3.7, Python 3.8

___
Python tracker 

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



[issue35133] Bugs in concatenating string literals on different lines

2018-11-05 Thread miss-islington


Change by miss-islington :


--
pull_requests: +9639

___
Python tracker 

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



[issue35133] Bugs in concatenating string literals on different lines

2018-11-05 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset 34fd4c20198dea6ab2fe8dc6d32d744d9bde868d by Serhiy Storchaka in 
branch 'master':
bpo-35133: Fix mistakes when concatenate string literals on different lines. 
(GH-10284)
https://github.com/python/cpython/commit/34fd4c20198dea6ab2fe8dc6d32d744d9bde868d


--

___
Python tracker 

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



[issue35157] Missing pyconfig.h when building from source and pgo flag is enabled

2018-11-05 Thread Steve Dower


Steve Dower  added the comment:

Those are just the distutils tests failing, which probably means the extra 
environment variables or paths involved in the PGO profiling run are confusing 
the logic for detecting when it is running in a source tree.

We should fix it, but it won't affect either PGO or to resulting build.

--
components: +Distutils -Build
nosy: +dstufft, eric.araujo
type: compile error -> behavior

___
Python tracker 

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



[issue23734] zipimport should not check pyc timestamps against zipped py files

2018-11-05 Thread Elvis Pranskevichus


Change by Elvis Pranskevichus :


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

___
Python tracker 

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



[issue34726] Add support of checked hash-based pycs in zipimport

2018-11-05 Thread Elvis Pranskevichus


Change by Elvis Pranskevichus :


--
pull_requests: +9637
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



[issue25711] Rewrite zipimport from scratch

2018-11-05 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


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

___
Python tracker 

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



[issue35167] Specify program for gzip and json.tool command line options

2018-11-05 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


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

___
Python tracker 

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



[issue35167] Specify program for gzip and json.tool command line options

2018-11-05 Thread Serhiy Storchaka


New submission from Serhiy Storchaka :

Currently command line options for gzip and json.tool are listed as general 
command line options, together with other options for the Python interpreter. 
They should be listed as options of separate programs.

See "command line option" on https://docs.python.org/3/genindex-C.html.

--
assignee: serhiy.storchaka
components: Documentation
messages: 329297
nosy: serhiy.storchaka
priority: normal
severity: normal
status: open
title: Specify program for gzip and json.tool command line options
versions: Python 2.7, Python 3.6, Python 3.7, Python 3.8

___
Python tracker 

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



[issue9371] pulldom doesn't provide END_DOCUMENT or COMMENT nodes.

2018-11-05 Thread Jonathan Gossage


Change by Jonathan Gossage :


--
pull_requests: +9635

___
Python tracker 

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



[issue35133] Bugs in concatenating string literals on different lines

2018-11-05 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Here is a script used for searching and fixing such errors. It produces a large 
number of false detections, so it need manual work for clearing the result. In 
general this can't be automated, because the correctness depends on the context.

--
Added file: https://bugs.python.org/file47906/fixstringssplit.py

___
Python tracker 

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



[issue35164] socket.getfqdn and socket.gethostbyname fail on MacOS

2018-11-05 Thread Ronald Oussoren


Ronald Oussoren  added the comment:

I agree with Ned. The code fragment works for me as well on 10.14.1 and I've 
used simular code in the past on different versions of macOS as well.

@ssbarnea: 
- What is the hostname as shown in the "Sharing" preference pane? Does the name 
include special characters (anything but ASCII letters and digits)?
- What version of macOS do you use?
- How did you install Python? (Python.org installer, homebrew, self built, ...)

--

___
Python tracker 

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



[issue25711] Rewrite zipimport from scratch

2018-11-05 Thread Nick Coghlan


Nick Coghlan  added the comment:

Noticed this was still open when reviewing Elvis's zipimport patch for issue 
34022.

Given the Python implementation has been merged, should we close this as 
resolved, and open new issues for any further changes (performance or 
otherwise)?

--
nosy: +ncoghlan

___
Python tracker 

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



[issue32512] Add an option to profile to run library module as a script

2018-11-05 Thread Mario Corchero


Change by Mario Corchero :


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



[issue32512] Add an option to profile to run library module as a script

2018-11-05 Thread Nick Coghlan


Nick Coghlan  added the comment:


New changeset ad1a25f499362eaf9cbfcafa0b8e2454eb43dcf1 by Nick Coghlan (Mario 
Corchero) in branch 'master':
bpo-32512: Add -m option to profile for profiling modules (#5132)
https://github.com/python/cpython/commit/ad1a25f499362eaf9cbfcafa0b8e2454eb43dcf1


--
nosy: +ncoghlan

___
Python tracker 

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



[issue35134] Move !Py_LIMITED_API to Include/pycapi/

2018-11-05 Thread Nick Coghlan


Nick Coghlan  added the comment:

On actually looking at the initial changes in the PR:

* declarations that aren't part of the stable ABI in any version (i.e. "#ifndef 
PY_LIMITED_API", "#if !defined(PY_LIMITED_API)") should move to the new 
directory

* declarations that are part of the stable ABI in *some* version should remain 
where they are (i.e. in "Include/*.h")

In your initial PR, the only API that subtle distinction affects is 
PyObject_Calloc (since that's a new addition to the stable ABI in 3.5+), and 
moving that back to the public header means you can add the desired 
"Py_LIMITED_API is not defined" check to the header in the new directory.

--

___
Python tracker 

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



[issue35145] sqlite3: "select *" should optionally sniff and autoconvert TEXT datetime fields

2018-11-05 Thread Robert Pollak


Robert Pollak  added the comment:

I have created the attached sqlite database file (with SQLiteStudio) for 
testing. I contains a table `t` with a TEXT column `x` and a DATETIME 
(according to SQLiteStudio) column `y`. The table contains a single row with 
the value `2018-11-05 12:20:30` for both columns.

For some reason SQLiteStudio manages to know these types (although the columns 
contain the same value, and even after renaming the file and reconnecting to 
it), so sqlite3 should also be able to detect them.

--
Added file: https://bugs.python.org/file47905/SQLiteStudio-3449.sqlite

___
Python tracker 

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



[issue35134] Move !Py_LIMITED_API to Include/pycapi/

2018-11-05 Thread Nick Coghlan


Nick Coghlan  added the comment:

> To be honest, I'm not sure that I understand how "Py_LIMITED_API+0 >= 
> 0x0305" works and should be used.


It's described here: https://docs.python.org/3/c-api/stable.html

If a stable ABI consumer just declares "#define PY_LIMITED_API 1", then they'll 
get the original stable ABI as defined in Python 3.2.

If they don't care about versions prior to 3.6, they can instead declare 
"#define PY_LIMITED_API 0x0306", and get access to the functions added to 
the stable ABI in 3.3, 3.4, 3.5, and 3.6.

For this PR though, I think it's OK to ignore that detail, as once all the 
internal APIs are in "Include/internal", and all the APIs that don't offer ABI 
stability guarantees are in "Include/TBD" (see note below), then the general 
rule to follow is that everything added to the headers directly in "Include/" 
needs a Py_LIMITED_API guard that matches the upcoming release.


Note: I wrote "TBD" rather than "pycapi" above, as "pycapi" sounds like the 
name of a preferred public API to me, rather than "code compiled against this 
API is not portable to later versions, and may not be portable to other 
implementations". Given the name of the macro, "Include/unlimited/*.h" may make 
sense, especially if those header files are all written to error out at compile 
time if PY_LIMITED_API is defined. "Include/unstable_abi/*.h" would be another 
self-describing name.

--

___
Python tracker 

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



[issue35134] Move !Py_LIMITED_API to Include/pycapi/

2018-11-05 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



  1   2   >