[issue34765] Update install-sh

2018-10-30 Thread Michael Felt


Michael Felt  added the comment:

The AIX build-bots thank you. Back to "failed-test" status.

1721...failed test (failure)

1720...failed compile (failure)

--

___
Python tracker 

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



[issue20397] distutils --record option does not validate existence of byte-compiled files

2018-10-30 Thread Kubilay Kocak


Change by Kubilay Kocak :


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



[issue35107] untokenize() fails on tokenize output when a newline is missing

2018-10-30 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

I am surprised, that removing the newline character adds a token:

>>> pprint.pprint(list(tokenize.generate_tokens(io.StringIO('#\n').readline)))
[TokenInfo(type=55 (COMMENT), string='#', start=(1, 0), end=(1, 1), line='#\n'),
 TokenInfo(type=56 (NL), string='\n', start=(1, 1), end=(1, 2), line='#\n'),
 TokenInfo(type=0 (ENDMARKER), string='', start=(2, 0), end=(2, 0), line='')]
>>> pprint.pprint(list(tokenize.generate_tokens(io.StringIO('#').readline)))
[TokenInfo(type=55 (COMMENT), string='#', start=(1, 0), end=(1, 1), line='#'),
 TokenInfo(type=56 (NL), string='', start=(1, 1), end=(1, 1), line='#'),
 TokenInfo(type=4 (NEWLINE), string='', start=(1, 1), end=(1, 2), line=''),
 TokenInfo(type=0 (ENDMARKER), string='', start=(2, 0), end=(2, 0), line='')]

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue35108] inspect.getmembers passes exceptions from object's properties through

2018-10-30 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

Sorry I misread your title stating it's about object getattr for a property has 
to execute the underlying code it seems as explained in 
https://stackoverflow.com/a/30143990/2610955 . I don't know if there is a way 
through which an attribute access in case of property can be verified without 
executing it. In case of catching the exception and returning the attributes 
that don't raise exception since it depends on the runtime execution of the 
property where the exception might occur at one point in time and doesn't occur 
in another point of time causing confusion during debugging.

--

___
Python tracker 

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



[issue32972] unittest.TestCase coroutine support

2018-10-30 Thread Dave Shawley


Dave Shawley  added the comment:

Hi all, I took a slightly different direction for adding async/await support to 
the unittest library.  I summarized the approach that I took in a message to 
python-ideas 
(https://mail.python.org/pipermail/python-ideas/2018-October/054331.html) and a 
branch is available for preview in my fork of cpython 
(https://github.com/dave-shawley/cpython/pull/1).

My question is whether I should reboot this bpo with my PR or create a new one 
since the implementation is different than what was already discussed?

--
nosy: +dave-shawley

___
Python tracker 

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



[issue34403] test_utf8_mode.test_cmd_line() fails on HP-UX due to false assumptions

2018-10-30 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +9547

___
Python tracker 

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



[issue35081] Rename Include/internals/ to Include/pycore/

2018-10-30 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +9551

___
Python tracker 

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



[issue35112] SpooledTemporaryFile and seekable() method

2018-10-30 Thread nubirstein


New submission from nubirstein :

Although seekable() method is implemented in the IOBase (which means it is 
callable in BytesIO and StringIO), SpooledTemporaryFile class from 
lib/tempfile.py still does not implement it.

--
components: Library (Lib)
messages: 328904
nosy: nubirstein
priority: normal
severity: normal
status: open
title: SpooledTemporaryFile and seekable() method
type: behavior
versions: Python 3.7

___
Python tracker 

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



[issue35052] Coverity scan: copy/paste error in Lib/xml/dom/minidom.py

2018-10-30 Thread Shivank Gautam


Shivank Gautam  added the comment:

I just want to update that i was not able to work more in last two days as i 
was busy in some personal work. now i am on it and will update something soon. 
Sorry for delay :)

--

___
Python tracker 

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



[issue35081] Rename Include/internals/ to Include/pycore/

2018-10-30 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +9552

___
Python tracker 

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



[issue19376] document that strptime() does not support the Feb 29 if the format does not contain the year

2018-10-30 Thread Felipe Rodrigues


Felipe Rodrigues  added the comment:

What about adding some more information in the exception message in addition to 
the docs? I mean, if we're raising an issue because someone inserted Feb 29, we 
add a note about leap year in the exception message

--
nosy: +fbidu

___
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()

2018-10-30 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset e1b29950bf751381538e3c8ea6a3e0a98d01dbfb by Victor Stinner in 
branch 'master':
bpo-32030: Make _PySys_AddXOptionWithError() private (GH-10236)
https://github.com/python/cpython/commit/e1b29950bf751381538e3c8ea6a3e0a98d01dbfb


--

___
Python tracker 

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



[issue34403] test_utf8_mode.test_cmd_line() fails on HP-UX due to false assumptions

2018-10-30 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 7d35f79012db89ce9a152a77ac6809eb9c34a35d by Victor Stinner in 
branch '3.7':
bpo-34403: Always implement _Py_GetForceASCII() (GH-10235)
https://github.com/python/cpython/commit/7d35f79012db89ce9a152a77ac6809eb9c34a35d


--

___
Python tracker 

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



[issue35081] Rename Include/internals/ to Include/pycore/

2018-10-30 Thread STINNER Victor


STINNER Victor  added the comment:

My changes move Py_BUILD_CORE to Include/internal/. I'm not sure of the effect 
on the backward compatibility.

Since Python 3.7, many "Py_BUILD_CORE" functions rely on Include/internal/, 
like PyThreadState_GET() which uses _PyRuntime.gilstate.tstate_current.

On my Fedora 28, the python3-devel package doesn't proide Include/internal/ 
headers, only Include/*.h in /usr/include/python3.7m/. It seems like 
Include/internal/ is not usable by 3rd party modules on Fedora at least.

I understand that even if a 3rd party C extension used the Py_BUILD_CORE API, 
Python 3.7 already broke these extensions.

I don't want C extensions to use Py_BUILD_CORE: Py_BUILD_CORE API is really 
designed to only be used inside Python. If this API is used outside Python, we 
cannot modify the API anymore since it would break extensions. But I want to 
make sure that we can break this API for different reasons.

In Python 3.7, pyatomic.h is included by Python.h. In Python 3.7.0, pyatomic.h 
content wasn't surrounded by Py_BUILD_CORE and this header file caused multiple 
compilation issues: see bpo-23644 and bpo-25150. The content is now restricted 
to Py_BUILD_CORE since Python 3.7.1. It allows us to more easily change the 
implementation.

--

___
Python tracker 

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



[issue35098] Deleting __new__ does not restore previous behavior

2018-10-30 Thread Josh Rosenberg


Change by Josh Rosenberg :


--
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> Assigning and deleting __new__ attr on the class does not allow 
to create instances of this class

___
Python tracker 

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



[issue35059] Convert Py_INCREF() and PyObject_INIT() to inlined functions

2018-10-30 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 3c09dca4b5de9fe8c8756251d02f49cf093b88c1 by Victor Stinner in 
branch 'master':
bpo-35059: Convert _Py_Dealloc() to static inline function (GH-10223)
https://github.com/python/cpython/commit/3c09dca4b5de9fe8c8756251d02f49cf093b88c1


--

___
Python tracker 

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



[issue35081] Rename Include/internals/ to Include/pycore/

2018-10-30 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 9204fb8623896cc5f68ae350784ee25e8a7b2184 by Victor Stinner in 
branch 'master':
bpo-35081: Cleanup pystate.c and pystate.h (GH-10240)
https://github.com/python/cpython/commit/9204fb8623896cc5f68ae350784ee25e8a7b2184


--

___
Python tracker 

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



[issue35115] UUID objects can't be casted by `hex()`

2018-10-30 Thread fcurella


New submission from fcurella :

Casting a UUID to an `int` or to a string works as expected:

```
import uuid

value = uuid.UUID()
str(value)
int(value)
```

but casting to an `hex()` raises an exception:

```
import uuid

value = uuid.UUID()

# uuid instances already have the correct value stored in the `.hex` attribute
value.hex

# this raises `TypeError: 'UUID' object cannot be interpreted as an integer`
hex(value)

# this behaves correctly
hex(value.int)

```

Adding support for `hex()` should be simple enough as adding the following to 
the UUID class in 
https://github.com/python/cpython/blob/54752533b2ed1c898ffe5ec2e795c6910ee46a39/Lib/uuid.py#L69:

```
def __index__(self):
return self.int
```

--
components: Library (Lib)
messages: 328929
nosy: fcurella
priority: normal
severity: normal
status: open
title: UUID objects can't be casted by `hex()`
type: behavior
versions: Python 3.8

___
Python tracker 

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



[issue19376] document that strptime() does not support the Feb 29 if the format does not contain the year

2018-10-30 Thread abhishek


Change by abhishek :


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

___
Python tracker 

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



[issue26175] Fully implement IOBase abstract on SpooledTemporaryFile

2018-10-30 Thread nubirstein


nubirstein  added the comment:

My last comment meant to land somewhere else, but nonetheless it is related to 
this topic, so:

SpooledTemporaryFile class from lib/tempfile.py still does not implement 
seekable() method. It could be like this (just two lines of code and my 
Flask.Request tests with sending files started again to work on 3.7:

def seekable(self):
return self._file.seekable()

Is it possible to add this method?

--

___
Python tracker 

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



[issue35081] Rename Include/internals/ to Include/pycore/

2018-10-30 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +9553

___
Python tracker 

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



[issue35081] Rename Include/internals/ to Include/pycore/

2018-10-30 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 31368a4f0e531c19affe2a1becd25fc316bc7501 by Victor Stinner in 
branch 'master':
bpo-35081: Move Include/pyatomic.c to Include/internal/ (GH-10239)
https://github.com/python/cpython/commit/31368a4f0e531c19affe2a1becd25fc316bc7501


--

___
Python tracker 

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



[issue34403] test_utf8_mode.test_cmd_line() fails on HP-UX due to false assumptions

2018-10-30 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 905f1ace5f7424e314ca7bed997868a2a3044839 by Victor Stinner in 
branch 'master':
bpo-34523: Fix config_init_fs_encoding() for ASCII (GH-10232)
https://github.com/python/cpython/commit/905f1ace5f7424e314ca7bed997868a2a3044839


--

___
Python tracker 

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



[issue34523] Choose the filesystem encoding before Python initialization (add _PyCoreConfig.filesystem_encoding)

2018-10-30 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 905f1ace5f7424e314ca7bed997868a2a3044839 by Victor Stinner in 
branch 'master':
bpo-34523: Fix config_init_fs_encoding() for ASCII (GH-10232)
https://github.com/python/cpython/commit/905f1ace5f7424e314ca7bed997868a2a3044839


--

___
Python tracker 

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



[issue35112] SpooledTemporaryFile and seekable() method

2018-10-30 Thread nubirstein


nubirstein  added the comment:

Should I have been added my request there? Anyway I do suffer from lack of 
'seekable()' implementation there. I'll go there and make a request

--

___
Python tracker 

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



[issue19376] document that strptime() does not support the Feb 29 if the format does not contain the year

2018-10-30 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



[issue35086] tkinter docs: errors in A Simple Hello World Program

2018-10-30 Thread miss-islington


Change by miss-islington :


--
pull_requests: +9555

___
Python tracker 

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



[issue35112] SpooledTemporaryFile and seekable() method

2018-10-30 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

Thanks for the report. Search gives me a related issue with PR to implement 
IOBase for SpooledTemporaryFile : issue26175

--
nosy: +xtreak

___
Python tracker 

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



[issue35114] ssl.RAND_status docs describe it as returning True/False; actually returns 1/0

2018-10-30 Thread Josh Rosenberg

New submission from Josh Rosenberg :

The ssl.RAND_status online docs say (with code format on True/False):

"Return True if the SSL pseudo-random number generator has been seeded with 
‘enough’ randomness, and False otherwise."

This is incorrect; the function actually returns 1 or 0 (and the docstring 
agrees).

Fix can be one of:

1. Update docs to be less specific about the return type (use true/false, not 
True/False)
2. Update docs to match docstring (which specifically says 1/0, not True/False)
3. Update implementation and docstring to actually return True/False (replacing 
PyLong_FromLong with PyBool_FromLong and changing docstring to use True/False 
to match online docs)

#3 involves a small amount of code churn, but it also means we're not 
needlessly replicating a C API's use of int return values when the function is 
logically bool (there is no error status for the C API AFAICT, so it's not like 
returning int gains us anything on flexibility). bool would be mathematically 
equivalent to the original 1/0 return value in the rare cases someone uses it 
mathematically.

--
assignee: docs@python
components: Documentation, SSL
messages: 328917
nosy: docs@python, josh.r
priority: low
severity: normal
status: open
title: ssl.RAND_status docs describe it as returning True/False; actually 
returns 1/0
type: behavior

___
Python tracker 

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



[issue27200] make doctest in CPython has failures

2018-10-30 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

At the moment, the dependent issues are closed and there is just one open PR on 
this issue.

Julian, I am nosying you here because you merged #34962, which is properly a 
dependency of this.

--
dependencies: +make doctest does not pass :/
nosy: +mdk

___
Python tracker 

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



[issue35113] inspect.getsource returns incorrect source for classes when class definition is part of multiline strings

2018-10-30 Thread Karthikeyan Singaravelan


New submission from Karthikeyan Singaravelan :

inspect.getsource uses inspect.findsource that uses a regex to check for class 
declaration and starts matching against the regex from the start of the 
program. When there is a match it checks for the first character to be 'c' to 
return the line number from which getblock is used to get the class definition. 
If there are multiple matches and there is no line with 'c' as the first 
character in the line then they are sorted based on the number of whitespaces 
preceding class keyword. This poses the following problem :

1. When a class definition like string occurs as part of a multiline string 
before the actual definition then this causes the function to return the 
multiline string instead of actual definition. This occurs both while using the 
multiline string also as comment and also using them in variable definition in 
other places.

2. When the class is defined inside another class and there is a similar 
multiline string inside another class which is indented along the same 
indentation level of the class then they are sorted by whitespace where they 
are equal and then followed by line number. Since the class definition occurs 
after the multiline string it causes the multiline string to be taken up as the 
source of the class.

This was last changed in 89f507fe8c4 (Dec 2006) which is also a merge commit. I 
searched for issues and relevant test cases but I couldn't find any in the test 
suite or issue tracker regarding the same. Hence I am filing a new issue.

# backups/bpo35101.py

import inspect

class Bar:
a = """
class MultilineStringVariable:
...
"""

class MultilineStringVariable:

def foo(self):
pass

'''
class MultilineStringComment:
pass
'''

class MultilineStringComment:

def foo(self):
pass

class NestedClass:
a = '''
class Spam:
...
'''

class Nested:

class Spam:
pass

print(inspect.getsource(MultilineStringVariable))
print(inspect.getsource(MultilineStringComment))
print(inspect.getsource(Nested.Spam))

# Incorrect results

$ ./python.exe ../backups/bpo35101.py
class MultilineStringVariable:
...

class MultilineStringComment:
pass

class Spam:
...

--
components: Library (Lib)
messages: 328909
nosy: xtreak
priority: normal
severity: normal
status: open
title: inspect.getsource returns incorrect source for classes when class 
definition is part of multiline strings
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



[issue35112] SpooledTemporaryFile and seekable() method

2018-10-30 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

The related issue already implements seekable and other methods for IOBase. As 
I can see from the open PR there are PR comments with respect to tests and docs 
that need to be acted upon as per reviewer's comments. With respect to this 
issue I propose closing this as a duplicate with issue26175 as superseder to 
continue your discussion there where it might be useful. 

Thanks!

--

___
Python tracker 

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



[issue35112] SpooledTemporaryFile and seekable() method

2018-10-30 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

@nubirstein You're welcome :) As noted in 
https://bugs.python.org/issue26175#msg328911 the PR has the implementation of 
seekable at 
https://github.com/python/cpython/pull/3249/files#diff-34b2145d7fe189e893ec7934afe9829cR761
 . You can help with the PR reviews if any and hopefully it gets merged.

Adding 26175 as superseder.

--
superseder:  -> Fully implement IOBase abstract on SpooledTemporaryFile

___
Python tracker 

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



[issue35066] Inconsistency between dangling '%' handling in time.strftime() and datetime.strftime()

2018-10-30 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



[issue25416] Add encoding aliases from the (HTML5) Encoding Standard

2018-10-30 Thread Felipe Rodrigues


Change by Felipe Rodrigues :


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



[issue18624] Add alias for iso-8859-8-i which is the same as iso-8859-8

2018-10-30 Thread Felipe Rodrigues


Change by Felipe Rodrigues :


--
pull_requests: +9550

___
Python tracker 

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



[issue32972] unittest.TestCase coroutine support

2018-10-30 Thread Petter S


Petter S  added the comment:

As far as I am concerned, the discussion can continue in this issue.

I still think a reasonable first step is to add a run hook to the regular 
TestCase class, like in PR 6051. But building consensus is a bit tricky.

--

___
Python tracker 

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



[issue19376] document that strptime() does not support the Feb 29 if the format does not contain the year

2018-10-30 Thread Paul Ganssle

Paul Ganssle  added the comment:

@Victor: You mean a PR to fix the *issue* or a PR to add this to the docs?

The current behavior is pretty counter-intuitive, particularly because it also 
fails because of the (relatively) little-known fact that 1900 happens to not be 
a leap year because it is evenly divisible by 100 but not by 400.

I think it's pretty simple for end-users to work around this:

def strptime_smarter(dtstr, fmt):
try:
return datetime.strptime(dtstr, fmt)
except ValueError:
tt = time.strptime(dtstr, fmt)
if tt[0:3] == (1900, 2, 29):
return datetime(1904, *tt[1:6])
raise


But this is largely a problem that arises because we don't have any concept of 
a "partial datetime", see this dateutil issue: 
https://github.com/dateutil/dateutil/issues/449

What users want when they do `datetime.strptime("Feb 29", "%b %d")` is 
something like `(None, 2, 29)`, but we're both specifying an arbitrary default 
year *and* enforcing that the final date be legal. I think the best solution 
would be to change the default year to 2000 for *all* dates, but for historical 
reasons that is just not feasible. :(

Another option is that we could allow specifying a "default date" from which 
missing values would be drawn. We have done this in dateutil.parser.parse: 
https://dateutil.readthedocs.io/en/stable/parser.html#dateutil.parser.parse

The biggest problem in dateutil is that the default value for "default date" is 
the *current date*, which causes many problems with reproducibility. For 
`datetime.strptime`, the default value would be `datetime(1900, 1, 1)`, which 
has none of those same problems.

Still, adding such a parameter to `datetime.strptime` seems like a lot of 
effort to go through to just to make it *easier* for people to work around this 
bug in `strptime`, particularly since in this case you can *kinda* do the same 
thing with:

strptime('1904 ' + dtstr, '%Y %b %d')

Long-winded carping on about datetime issues aside, I think my final vote is 
for leaving the behavior as-is and documenting it. Looking at the 
documentation, the only documentation I see for what happens when you don't 
have %Y, %m or %d is:

For time objects, the format codes for year, month, and day should not be 
used,
as time objects have no such values. If they’re used anyway, 1900 is 
substituted
for the year, and 1 for the month and day.

This only makes sense in the context of `strftime`. I think for starters we 
should document the behavior of strptime when no year, month or day are 
specified. As part of that documentation, we can add a footnote about Feb 29th.

I can make a PR for this, but as Tal mentions, I think this is a good issue for 
a first-time contributor, so I'd like to give someone else an opportunity to 
take a crack at this.

--

___
Python tracker 

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



[issue34403] test_utf8_mode.test_cmd_line() fails on HP-UX due to false assumptions

2018-10-30 Thread Michael Osipov


Michael Osipov <1983-01...@gmx.net> added the comment:

Victor, looks good to me: 0:00:26 [ 23/419/3] test_utf8_mode passed.

I don't know wether it is related, but test_unicode crash dumps here:
0:00:22 [ 16/419/2] test_unicode crashed (Exit code -11)
Fatal Python error: Segmentation fault

Current thread 0x0001 (most recent call first):
  File "/var/osipovmi/cpython/Lib/test/test_unicode.py", line 2465 in 
PyUnicode_FromFormat
  File "/var/osipovmi/cpython/Lib/test/test_unicode.py", line 2468 in 
check_format
  File "/var/osipovmi/cpython/Lib/test/test_unicode.py", line 2472 in 
test_from_format
  File "/var/osipovmi/cpython/Lib/unittest/case.py", line 610 in run
  File "/var/osipovmi/cpython/Lib/unittest/case.py", line 658 in __call__
  File "/var/osipovmi/cpython/Lib/unittest/suite.py", line 122 in run
  File "/var/osipovmi/cpython/Lib/unittest/suite.py", line 84 in __call__
  File "/var/osipovmi/cpython/Lib/unittest/suite.py", line 122 in run
  File "/var/osipovmi/cpython/Lib/unittest/suite.py", line 84 in __call__
  File "/var/osipovmi/cpython/Lib/unittest/suite.py", line 122 in run
  File "/var/osipovmi/cpython/Lib/unittest/suite.py", line 84 in __call__
  File "/var/osipovmi/cpython/Lib/test/support/testresult.py", line 162 in run
  File "/var/osipovmi/cpython/Lib/test/support/__init__.py", line 1928 in 
_run_suite
  File "/var/osipovmi/cpython/Lib/test/support/__init__.py", line 2022 in 
run_unittest
  File "/var/osipovmi/cpython/Lib/test/libregrtest/runtest.py", line 175 in 
test_runner
  File "/var/osipovmi/cpython/Lib/test/libregrtest/runtest.py", line 179 in 
runtest_inner
  File "/var/osipovmi/cpython/Lib/test/libregrtest/runtest.py", line 134 in 
runtest
  File "/var/osipovmi/cpython/Lib/test/libregrtest/runtest_mp.py", line 68 in 
run_tests_worker
  File "/var/osipovmi/cpython/Lib/test/libregrtest/main.py", line 587 in _main
  File "/var/osipovmi/cpython/Lib/test/libregrtest/main.py", line 571 in main
  File "/var/osipovmi/cpython/Lib/test/libregrtest/main.py", line 627 in main
  File "/var/osipovmi/cpython/Lib/test/regrtest.py", line 46 in _main
  File "/var/osipovmi/cpython/Lib/test/regrtest.py", line 50 in 
  File "/var/osipovmi/cpython/Lib/runpy.py", line 85 in _run_code
  File "/var/osipovmi/cpython/Lib/runpy.py", line 192 in _run_module_as_main

Is that related to your PEP?

--

___
Python tracker 

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



[issue35107] untokenize() fails on tokenize output when a newline is missing

2018-10-30 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

It seems to me a bug that if '\n' is not present, tokenize adds both NL and 
NEWLINE tokens, instead of just one of them.  Moreover, both tuples of the 
double correction look wrong.

If '\n' is present,
  TokenInfo(type=56 (NL), string='\n', start=(1, 1), end=(1, 2), line='#\n')
looks correct.

If NL represents a real character, the length 0 string='' in the generated
  TokenInfo(type=56 (NL), string='', start=(1, 1), end=(1, 1), line='#'),
seems wrong.  I suspect that the idea was to mis-represent NL to avoid '\n' 
being added by untokenize.  In
  TokenInfo(type=4 (NEWLINE), string='', start=(1, 1), end=(1, 2), line='')
string='' is mismatched by length = 2-1 = 1.  I am inclined to think that the 
following would be the correct added token, which should untokenize correctly
  TokenInfo(type=4 (NEWLINE), string='', start=(1, 1), end=(1, 1), line='')

ast.dump(ast.parse(s)) returns 'Module(body=[])' for both versions of 's', so 
no help there.

--

___
Python tracker 

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



[issue34403] test_utf8_mode.test_cmd_line() fails on HP-UX due to false assumptions

2018-10-30 Thread STINNER Victor


STINNER Victor  added the comment:

Michael Osipov: Oops, my commit b2457efc78b74a1d6d1b77d11a939e886b8a4e2c broke 
the filesystem encoding on HP-UX. It should be fixed by my commit 
905f1ace5f7424e314ca7bed997868a2a3044839.

--

___
Python tracker 

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



[issue34403] test_utf8_mode.test_cmd_line() fails on HP-UX due to false assumptions

2018-10-30 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 21220bbe65108f5a763ead24a6b572f80d84c9e2 by Victor Stinner in 
branch '3.7':
bpo-34403: Fix initfsencoding() for ASCII (GH-10233)
https://github.com/python/cpython/commit/21220bbe65108f5a763ead24a6b572f80d84c9e2


--

___
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()

2018-10-30 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +9548

___
Python tracker 

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



[issue26175] Fully implement IOBase abstract on SpooledTemporaryFile

2018-10-30 Thread nubirstein


nubirstein  added the comment:

Should I have been added my request there? Anyway I do suffer from lack of 
'seekable()' implementation there

--
nosy: +nubirstein

___
Python tracker 

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



[issue35112] SpooledTemporaryFile and seekable() method

2018-10-30 Thread nubirstein


nubirstein  added the comment:

According to Karthikeyan request I'am moving this discussion to the right 
place, i.e. https://bugs.python.org/issue26175
I hope to get some help there. Thx Karthikeyan for such a short response time.

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



[issue35081] Rename Include/internals/ to Include/pycore/

2018-10-30 Thread STINNER Victor


STINNER Victor  added the comment:

Serhiy Storchaka asked: "Would not be better to move files with the content 
fully surrounded by #ifdef Py_BUILD_CORE out of the Include/ directory?"

See his comment and my answer in the PR 10239:
https://github.com/python/cpython/pull/10239#issuecomment-434289361

--

___
Python tracker 

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



[issue35086] tkinter docs: errors in A Simple Hello World Program

2018-10-30 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset a80af770870937271865b5e2b05a2cfe40b024b6 by Serhiy Storchaka 
(Daniel Lovell) in branch 'master':
bpo-35086: Fix tkinter example "A Simple Hello World Program". (GH-10160)
https://github.com/python/cpython/commit/a80af770870937271865b5e2b05a2cfe40b024b6


--

___
Python tracker 

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



[issue35086] tkinter docs: errors in A Simple Hello World Program

2018-10-30 Thread miss-islington


Change by miss-islington :


--
pull_requests: +9554

___
Python tracker 

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



[issue35066] Inconsistency between dangling '%' handling in time.strftime() and datetime.strftime()

2018-10-30 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
nosy: +pablogsal

___
Python tracker 

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



[issue35115] UUID objects can't be casted by `hex()`

2018-10-30 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
nosy: +mark.dickinson

___
Python tracker 

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



[issue24303] OSError 17 due to _multiprocessing/semaphore.c assuming a one-to-one Pid -> process mapping.

2018-10-30 Thread Ryan Petrello


Ryan Petrello  added the comment:

Any chance this patch was every applied to Python3?  It looks to me like 3.6 
has the old code:

https://github.com/python/cpython/blob/3.6/Modules/_multiprocessing/semaphore.c#L448

--
nosy: +ryan.petrello

___
Python tracker 

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



[issue35086] tkinter docs: errors in A Simple Hello World Program

2018-10-30 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
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



[issue35115] UUID objects can't be casted by `hex()`

2018-10-30 Thread fcurella


fcurella  added the comment:

I must admit I was surprised to find out that `hex()` uses `__index__` (which 
is supposed to return an integer) and not something like a `__hex__` method 
returning the hex.

Maybe we should change the behaviour of `hex()` instead? (in a 
backward-compatible way, of course)

--

___
Python tracker 

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



[issue35115] UUID objects can't be casted by `hex()`

2018-10-30 Thread fcurella


Change by fcurella :


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

___
Python tracker 

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



[issue34977] Release Windows Store app containing Python

2018-10-30 Thread Steve Dower


Change by Steve Dower :


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

___
Python tracker 

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



[issue35115] UUID objects can't be casted by `hex()`

2018-10-30 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

hex() used the __hex__() special method in Python 2. This was changed in Python 
3 for purpose.

https://docs.python.org/3/whatsnew/3.0.html#operators-and-special-methods

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue35086] tkinter docs: errors in A Simple Hello World Program

2018-10-30 Thread miss-islington


miss-islington  added the comment:


New changeset f51ef51db686938486bff453e791a3093a1df108 by Miss Islington (bot) 
in branch '3.7':
bpo-35086: Fix tkinter example "A Simple Hello World Program". (GH-10160)
https://github.com/python/cpython/commit/f51ef51db686938486bff453e791a3093a1df108


--
nosy: +miss-islington

___
Python tracker 

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



[issue34403] test_utf8_mode.test_cmd_line() fails on HP-UX due to false assumptions

2018-10-30 Thread STINNER Victor


STINNER Victor  added the comment:

> 0:00:22 [ 16/419/2] test_unicode crashed (Exit code -11)

Please open a new issue to track this bug.

--

___
Python tracker 

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



[issue35115] UUID objects can't be casted by `hex()`

2018-10-30 Thread Ronald Oussoren


Ronald Oussoren  added the comment:

IMHO implementing "__index__" for UUID would not the correct solution. That 
method is meant be used by integer-like objects. One of the side effects of 
implementing "__index__" is that indexing lists with UUID instances would start 
to work, which is IMHO not correct.

--
nosy: +ronaldoussoren

___
Python tracker 

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



[issue35086] tkinter docs: errors in A Simple Hello World Program

2018-10-30 Thread miss-islington


miss-islington  added the comment:


New changeset c843a47007293d8361d0bfd45bfd7169afaa601c by Miss Islington (bot) 
in branch '3.6':
bpo-35086: Fix tkinter example "A Simple Hello World Program". (GH-10160)
https://github.com/python/cpython/commit/c843a47007293d8361d0bfd45bfd7169afaa601c


--

___
Python tracker 

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



[issue35116] Doc/library entries for cgi.FieldStorage max_num_fields

2018-10-30 Thread Matthew Belisle


New submission from Matthew Belisle :

vstinner pointed out that cgi.FieldStorage max_num_fields needs documentation 
added to Doc/library.

https://bugs.python.org/issue34866#msg328401

--
assignee: docs@python
components: Documentation
messages: 328937
nosy: Matthew Belisle, docs@python
priority: normal
severity: normal
status: open
title: Doc/library entries for cgi.FieldStorage max_num_fields
type: enhancement
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



[issue35116] Doc/library entries for cgi.FieldStorage max_num_fields

2018-10-30 Thread Matthew Belisle


Change by Matthew Belisle :


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

___
Python tracker 

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



[issue35116] Doc/library entries for cgi.FieldStorage max_num_fields

2018-10-30 Thread Matthew Belisle


Change by Matthew Belisle :


--
pull_requests: +9561

___
Python tracker 

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



[issue35117] set.discard should return True or False based on if element existed.

2018-10-30 Thread tzickel


New submission from tzickel :

Sometimes you want to do something based on if the item existed before removal, 
so instead of checking if it exists, then removing and doing something, if 
would be nice to make the function return True or False based on if the element 
existed.

--
components: Interpreter Core
messages: 328938
nosy: tzickel
priority: normal
severity: normal
status: open
title: set.discard should return True or False based on if element existed.
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



[issue24303] OSError 17 due to _multiprocessing/semaphore.c assuming a one-to-one Pid -> process mapping.

2018-10-30 Thread Mike Frysinger


Mike Frysinger  added the comment:

it does seem like the patch was never applied to any python 3 branch :/

--

___
Python tracker 

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



[issue35116] Doc/library entries for cgi.FieldStorage max_num_fields

2018-10-30 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 68f323715e6627c550d1e8ffed7e36f1bb4aa42b by Victor Stinner 
(matthewbelisle-wf) in branch 'master':
bpo-35116, urllib.parse: Document the new max_num_fields parameter (GH-10247)
https://github.com/python/cpython/commit/68f323715e6627c550d1e8ffed7e36f1bb4aa42b


--
nosy: +vstinner

___
Python tracker 

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



[issue3243] Support iterable bodies in httplib

2018-10-30 Thread tzickel


tzickel  added the comment:

This patch was opened for 2.7 but never applied there ?

https://github.com/python/cpython/pull/10226

This causes a bug with requests HTTP library (and others as well as httplib) 
when you want to send an iterable object as POST data (with a non-chunked way), 
it works in Python 3 but not 2, and this effects behaviour and performance...

--
nosy: +tzickel

___
Python tracker 

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



[issue35115] UUID objects can't be casted by `hex()`

2018-10-30 Thread శ్రీనివాస్ రెడ్డి తాటిపర్తి

Change by Srinivas  Reddy Thatiparthy(శ్రీనివాస్ రెడ్డి తాటిపర్తి) 
:


--
nosy: +thatiparthy

___
Python tracker 

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



[issue35116] Doc/library entries for cgi.FieldStorage max_num_fields

2018-10-30 Thread Matthew Belisle


Change by Matthew Belisle :


--
pull_requests: +9562

___
Python tracker 

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



[issue35117] set.discard should return True or False based on if element existed.

2018-10-30 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

try:
s.remove(x)
except KeyError:
# did not exist
else:
# existed

But catching exception in Python is expensive.

--
nosy: +rhettinger, serhiy.storchaka

___
Python tracker 

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



[issue35115] UUID objects can't be casted by `hex()`

2018-10-30 Thread Mark Dickinson


Mark Dickinson  added the comment:

Agreed that UUID should not implement `__index__`. I wouldn't expect to be able 
to use a UUID as a list index, for example.

This is marked as "behavior", but I have a hard time seeing this as a bug. It's 
not even a usability bug, given how easy it is to get the hex value of a UUID 
with `.hex`.

Maybe the UUID class should grow a `__format__` implementation that respects 
the `x` format specifier?

--

___
Python tracker 

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



[issue35115] UUID objects can't be casted by `hex()`

2018-10-30 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Note that str() for UUIDs already returns the hexadecimal representation, just 
with minuses.

I don't see large usability difference between 'uuid={:x}'.format(u) and 
'uuid={.hex}'.format(u). And in many case 'uuid={}'.format(u) is appropriate as 
well.

--

___
Python tracker 

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



[issue27200] make doctest in CPython has failures

2018-10-30 Thread Julien Palard


Julien Palard  added the comment:

Closing PR and issue as already fixed and now enforced by CI.

Thanks again Marco for those already-merged fixes, it helped a lot ending the 
work at the last PyCon Fr sprints.

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



[issue35081] Rename Include/internals/ to Include/pycore/

2018-10-30 Thread STINNER Victor


STINNER Victor  added the comment:

Include/internal/pystate.h uses #include "pystate.h" to include 
Include/pystate.h, but it tries to include itself (Include/internal/pystate.h) 
which does nothing because of "#ifndef Py_INTERNAL_PYSTATE_H #define 
Py_INTERNAL_PYSTATE_H ... #endif".

Remove the #ifndef #define to see the bug:

diff --git a/Include/internal/pystate.h b/Include/internal/pystate.h
index 38845d32ec..2ef023a9a5 100644
--- a/Include/internal/pystate.h
+++ b/Include/internal/pystate.h
@@ -1,5 +1,3 @@
-#ifndef Py_INTERNAL_PYSTATE_H
-#define Py_INTERNAL_PYSTATE_H
 #ifdef __cplusplus
 extern "C" {
 #endif
@@ -222,4 +220,3 @@ PyAPI_FUNC(void) _PyInterpreterState_DeleteExceptMain(void);
 #ifdef __cplusplus
 }
 #endif
-#endif /* !Py_INTERNAL_PYSTATE_H */


Compilation fails with:

In file included from ./Include/internal/pystate.h:5,
 from ./Include/internal/pystate.h:5,
 from ./Include/internal/pystate.h:5,
 from ./Include/internal/pystate.h:5,
 from ./Include/internal/pystate.h:5,
 from ./Include/internal/pystate.h:5,
 from ./Include/internal/pystate.h:5,
 ...
./Include/internal/pystate.h:5:21: error: #include nested too deeply
 #include "pystate.h"

--

___
Python tracker 

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



[issue35081] Rename Include/internals/ to Include/pycore/

2018-10-30 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +9563

___
Python tracker 

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



[issue35115] UUID objects can't be casted by `hex()`

2018-10-30 Thread fcurella


Change by fcurella :


--
status:  -> open

___
Python tracker 

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



[issue33376] [pysqlite] Duplicate rows can be returned after rolling back a transaction

2018-10-30 Thread cary


Change by cary :


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

___
Python tracker 

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



[issue34866] CGI DOS vulnerability via long post list

2018-10-30 Thread Matthew Belisle


Matthew Belisle  added the comment:

That makes sense Victor, I agree. Thanks for merging those PRs.

--

___
Python tracker 

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



[issue35109] Doctest in CI uses python binary built from master causing DeprecationWarnings

2018-10-30 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

> If we do so, we won't be able to write doctest about new features (existing 
> in 3.8, not existing in 3.7), which is worse than having warnings.

I agree with the same. Maybe I am running doctest wrong locally? I use make 
venv and make doctest. Sorry for the confusion on this.

--

___
Python tracker 

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



[issue35109] Doctest in CI uses python binary built from master causing DeprecationWarnings

2018-10-30 Thread Julien Palard


Julien Palard  added the comment:

> Maybe I am running doctest wrong locally?

Dunno. IIRC we had problems running doctest with a Python 3.7 on the 3.8 
branch, which make sense.

Anyway, if it works today, the first developper writing doctest about a 3.8 
feature will cause a doctest failure so no we can't use 3.7 to test 3.8.

--

___
Python tracker 

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



[issue33138] Improve standard error for uncopyable types

2018-10-30 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset 0353b4eaaf451ad463ce7eb3074f6b62d332f401 by Serhiy Storchaka in 
branch 'master':
bpo-33138: Change standard error message for non-pickleable and non-copyable 
types. (GH-6239)
https://github.com/python/cpython/commit/0353b4eaaf451ad463ce7eb3074f6b62d332f401


--

___
Python tracker 

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



[issue33138] Improve standard error for uncopyable types

2018-10-30 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



[issue34866] CGI DOS vulnerability via long post list

2018-10-30 Thread STINNER Victor


STINNER Victor  added the comment:

I suggest to not add the new parameter to 3.4 and 3.5 branches, even if it's a 
security fix. The fix requires to *use* the parameter, and I don't expect 
applications on Python 3.4 and 3.5 to be modified to use it.

--

___
Python tracker 

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



[issue33376] [pysqlite] Duplicate rows can be returned after rolling back a transaction

2018-10-30 Thread Maxime Belanger


Change by Maxime Belanger :


--
nosy: +Maxime Belanger

___
Python tracker 

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



[issue35034] Add closing and iteration to threading.Queue

2018-10-30 Thread Vladimir Filipović

Vladimir Filipović  added the comment:

Hi Raymond!

I've posted to python-ideas: 
https://mail.python.org/pipermail/python-ideas/2018-October/054238.html

The amount of attention it got was modest, so I couldn't exactly say the 
community has thoroughly vetted and enthusiastically endorsed this proposal :)

But all responses were in the narrow range of neutral to MILDLY positive.
There weren't any objections at all to either the idea or the code. Nor did 
anybody question whether a feature of this kind should be added at all.

I don't think I could realistically expect much more support than that for a 
change this minor. (Well, it would have been better if at least one person'd 
had an (uncontested) strongly positive response.)

Some problems with other kinds of implementations were brought up, but this one 
isn't vulnerable to them. I believe I've also addressed all your comments from 
this BPO issue in the opening post there.

An older discussion was linked, which had also shown tacit consensus that this 
type of feature in general would be welcome.

I suppose it's time to decide if that level of response is enough.

--
resolution: later -> 
status: closed -> open

___
Python tracker 

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



[issue33376] [pysqlite] Duplicate rows can be returned after rolling back a transaction

2018-10-30 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +xtreak

___
Python tracker 

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



[issue34788] ipaddress module fails on rfc4007 scoped IPv6 addresses

2018-10-30 Thread Lisa Roach


Lisa Roach  added the comment:

I think this is something that would be good to have. Jeremy would you care to 
make a PR for this?

--
nosy: +lisroach

___
Python tracker 

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



[issue34866] CGI DOS vulnerability via long post list

2018-10-30 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset bc6f74a520112d25ef40324e3de4e8187ff2835d by Victor Stinner 
(matthewbelisle-wf) in branch '2.7':
bpo-34866: Add max_num_fields to cgi.FieldStorage (GH-9660) (GH-9969)
https://github.com/python/cpython/commit/bc6f74a520112d25ef40324e3de4e8187ff2835d


--

___
Python tracker 

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



[issue34866] CGI DOS vulnerability via long post list

2018-10-30 Thread STINNER Victor


STINNER Victor  added the comment:

Thanks Matthew Belisle for the nice security counter-measure!

--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
versions:  -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



[issue35109] Doctest in CI uses python binary built from master causing DeprecationWarnings

2018-10-30 Thread Julien Palard


Change by Julien Palard :


--
nosy: +matrixise

___
Python tracker 

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



[issue35109] Doctest in CI uses python binary built from master causing DeprecationWarnings

2018-10-30 Thread Julien Palard


Julien Palard  added the comment:

> I propose using stable version of Python like python 3.7

If we do so, we won't be able to write doctest about new features (existing in 
3.8, not existing in 3.7), which is worse than having warnings.

I think the right move is to do some PR on remote projects (like babel) to fix 
the warning, future-proofing them from having a real issue in 3.8.

--

___
Python tracker 

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



[issue35116] Doc/library entries for cgi.FieldStorage max_num_fields

2018-10-30 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset aa0a21a7c81cb4eca723b0f400e860a0e8e730b5 by Victor Stinner 
(matthewbelisle-wf) in branch '3.7':
bpo-35116, urllib.parse: Document the new max_num_fields parameter (GH-10246)
https://github.com/python/cpython/commit/aa0a21a7c81cb4eca723b0f400e860a0e8e730b5


--

___
Python tracker 

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



[issue35116] Doc/library entries for cgi.FieldStorage max_num_fields

2018-10-30 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 691196d1af6a7e9d218e3281a8f3385616b2ca86 by Victor Stinner 
(matthewbelisle-wf) in branch '3.6':
bpo-35116, urllib.parse: Document the new max_num_fields parameter (GH-10248)
https://github.com/python/cpython/commit/691196d1af6a7e9d218e3281a8f3385616b2ca86


--

___
Python tracker 

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



[issue35109] Doctest in CI uses python binary built from master causing DeprecationWarnings

2018-10-30 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

I have an open PR for babel https://github.com/python-babel/babel/pull/608 . 
The problem is merging them and cutting a new release depends on the 
maintainers availability. Once it's fixed we have to make sure dependencies of 
babel like sphinx use the latest version and also make a release if needed. I 
agree it has to be fixed on those projects but coordinating release across 
various projects depends on the maintainers availability and shouldn't end up 
as a blocker for CPython's development here and in future with these type of 
deprecation warnings. I suggested using a stable version because when ran 
locally make venv for doctest uses python3 as binary name and on CI it uses 
python built from master branch that might cause confusion. Also it's not 
necessarily CPython's responsibility to make sure all our external projects 
work well on development branch.

We can keep this as an open issue while the warnings are fixed in the projects 
and also use this for reference when the collections import related code has to 
be removed.

--

___
Python tracker 

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



[issue35110] Fix more spaces around hyphens and dashes

2018-10-30 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset 3f819ca138db6945ee4271bf13e42db9f9b3b1e4 by Serhiy Storchaka in 
branch 'master':
bpo-35110: Fix unintentional spaces around hyphens and dashes. (GH-10231)
https://github.com/python/cpython/commit/3f819ca138db6945ee4271bf13e42db9f9b3b1e4


--

___
Python tracker 

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



[issue35116] Doc/library entries for cgi.FieldStorage max_num_fields

2018-10-30 Thread STINNER Victor


Change by STINNER Victor :


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



[issue35109] Doctest in CI uses python binary built from master causing DeprecationWarnings

2018-10-30 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

> Anyway, if it works today, the first developper writing doctest about a 3.8 
> feature will cause a doctest failure so no we can't use 3.7 to test 3.8.

Agreed that we need to run on the master branch binary for 3.8 only features 
like PEP 572 which is a language level change. Sorry, I forgot about that 
scenario. I guess it's then the right way to fix the dependencies upstream so 
that they work properly on development branch going forward.

--

___
Python tracker 

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



[issue35120] SSH tunnel support to ftp lib

2018-10-30 Thread Mohit Sharma


New submission from Mohit Sharma :

SSH tunnel forwarding doesn't work with ftp lib

--
messages: 328970
nosy: msharma
priority: normal
severity: normal
status: open
title: SSH tunnel support to ftp lib
type: enhancement
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



[issue35117] set.discard should return True or False based on if element existed.

2018-10-30 Thread Windson Yang


Windson Yang  added the comment:

I guess we can implement using ref_count? However, I agreed 

"The use of variables that haven't been defined or set (implicitly or 
explicitly) is almost always a bad thing in any language since it indicates 
that the logic of the program hasn't been thought through properly, and is 
likely to result in unpredictable behavior."

from 
https://stackoverflow.com/questions/843277/how-do-i-check-if-a-variable-exists

--
nosy: +Windson Yang

___
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-10-30 Thread Denis Osipov


New submission from Denis Osipov :

Customizing module attribute access example raises RecursionError:

>>> import sys
>>> from types import ModuleType
>>> class VerboseModule(ModuleType):
... def __repr__(self):
... return f'Verbose {self.__name__}'
... def __setattr__(self, attr, value):
... print(f'Setting {attr}...')
... setattr(self, attr, value)
...
>>> sys.modules[__name__].__class__ = VerboseModule
>>> sys.modules[__name__].a = 5
Setting a...
<...>
Setting a...
Traceback (most recent call last):
  File "", line 1, in 
  File "", line 6, in __setattr__
  File "", line 6, in __setattr__
  File "", line 6, in __setattr__
  [Previous line repeated 495 more times]
  File "", line 5, in __setattr__
RecursionError: maximum recursion depth exceeded while calling a Python object
Setting a...>>>

Something like this can fix it:

def __setattr__(self, attr, value):
... print(f'Setting {attr}...')
... super().setattr(self, attr, value)

--
assignee: docs@python
components: Documentation
messages: 328966
nosy: denis-osipov, docs@python
priority: normal
severity: normal
status: open
title: Customizing module attribute access example raises RecursionError
type: behavior
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



  1   2   >