[issue31800] datetime.strptime: Support for parsing offsets with a colon

2017-10-16 Thread Martin Panter

Martin Panter  added the comment:

FWIW it looks like “strptime” in glibc, and Open and Free BSD support parsing 
this and even more formats (RFC 822 and RFC 3339; includes “Z”, U.S. time 
zones, ±HH). Also, there is Issue 24954 for adding “%:z” like Gnu “date”.

--
nosy: +martin.panter

___
Python tracker 

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



[issue31800] datetime.strptime: Support for parsing offsets with a colon

2017-10-16 Thread Martin Panter

Martin Panter  added the comment:

Sorry, I meant Net BSD not Free BSD

--

___
Python tracker 

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



[issue31630] math.tan has poor accuracy near pi/2 on OpenBSD

2017-10-16 Thread Tim Peters

Tim Peters  added the comment:

On 16 Oct 2017, exactly the same test failures were reported on python-dev:

https://mail.python.org/pipermail/python-dev/2017-October/149880.html

>From the test output posted there:

"""
== CPython 3.6.3 (default, Oct 16 2017, 14:42:21) [GCC 4.7.2]
== Linux-3.2.0-4-686-pae-i686-with-debian-7.11 little-endian
"""

And I just noticed that in issue27953 exactly the same bad tan result() was 
reported (on "OS X Tiger").

It's hard to believe that three different systems (four, if I include wxMaxima) 
deliver exactly the same bad result by accident.

--

___
Python tracker 

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



[issue31800] datetime.strptime: Support for parsing offsets with a colon

2017-10-16 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



[issue31801] vars() manipulation encounters problems with Enum

2017-10-16 Thread Ethan Furman

New submission from Ethan Furman :

The following code should work (from 
https://stackoverflow.com/a/46780742/208880):


class BaudRate(Enum):

cls = vars()
regexp = r"(?:^|,)B(?P\d+)"
rates = sorted(map(int, re.findall(regexp, ",".join(dir(termios)
for value in rates:
cls['B%d' % value] = value

@classmethod
def valid_rate(cls, value):
return (any(value == item.value for item in cls))


This doesn't work because EnumMeta does not allow names to be reassigned nor 
deleted.  aenum gets around this by allowing an _ignore_ attribute which 
contains the names that should not be tracked (and, in fact, those names are 
removed from the final class).

Unless a better idea is put forward, I will add _ignore_ support to Enum.

--
assignee: ethan.furman
messages: 304487
nosy: barry, eli.bendersky, ethan.furman
priority: normal
severity: normal
stage: test needed
status: open
title: vars() manipulation encounters problems with Enum
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



[issue31800] datetime.strptime: Support for parsing offsets with a colon

2017-10-16 Thread Mario Corchero

Change by Mario Corchero :


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

___
Python tracker 

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



[issue31800] datetime.strptime: Support for parsing offsets with a colon

2017-10-16 Thread Mario Corchero

New submission from Mario Corchero :

Currently, datetime.strptime does not support parsing utc offsets that include 
a colon. "+" is parsed without issues whilst it fails with "+00:00".

"+NN:NN" is not only ISO8601 valid but also the way the offset is presented to 
the user when using .isoformat on a datetime with a timezone/offset.

This lead to the users needing to go to external libraries like dateutil or 
iso8601 just to be able to parse the datetime encoded in strings that 
"datetime" produces.

Even if a long-term goal would be to provide a way to parse any isoformatted 
string this issue just aims to address the problem that the %z parsing 
presents. This already unblocks users from parsing datetime object serialized 
with isoformat.

With this change, the following will just work:

>>> import datetime as dt
>>> iso_fmt = '%Y-%m-%dT%H:%M:%S%z'
>>> d = dt.datetime.strptime('2004-01-01T10:10:10+05:00', iso_fmt)

*'2004-01-01T10:10:10+05:00' is a sample string generated via 
datetime.isoformat()

Other options like having a new %:z was proposed but having just %z seems much 
simpler for the user.



Note: There has been already conversations about adding support on datetime to 
parse any ISO-formatted string. This is a more simplistic approach. We might be 
able to get to that situation after this patch, but this aims just to unblock 
us.

Related:
http://www.loc.gov/standards/datetime/iso-tc154-wg5_n0039_iso_wd_8601-2_2016-02-16.pdf
https://mail.python.org/pipermail/python-ideas/2014-March/027018.html
https://bugs.python.org/issue15873

--
components: Library (Lib)
messages: 304486
nosy: mariocj89
priority: normal
severity: normal
status: open
title: datetime.strptime: Support for parsing offsets with a colon
type: enhancement
versions: Python 3.7

___
Python tracker 

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



[issue28603] traceback module can't format/print unhashable exceptions

2017-10-16 Thread Zane Bitter

Zane Bitter  added the comment:

I also encountered this issue, and I'd like to further note that it is 
extraordinarily difficult to debug without access to stderr. If your logging 
facility uses the traceback module then it will be unable to record both the 
original (unhashable) exception, and the TypeError that it triggers (since the 
original exception is its __context__). The effect is that execution of a 
thread appears to simply stop without rhyme or reason (in fact it is still 
executing, but that fact is not apparent from the logs). I'm attaching a short 
reproducer that demonstrates this effect.

I believe the trade-offs inherent in the attached patches (either stopping the 
chain at an unhashable exception, or using a less-efficient data structure) can 
be avoided by comparing for identity rather than equality. The purpose of the 
check is to avoid an infinite loop; whether the objects compare as equal is 
something that is up to the author of the class, and has no relevance here 
except insofar as that objects ought to compare equal to themselves.

I submitted a pull request (#4014) with an implementation of that.

--
nosy: +zaneb
Added file: https://bugs.python.org/file47223/hashex.py

___
Python tracker 

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



[issue28603] traceback module can't format/print unhashable exceptions

2017-10-16 Thread Zane Bitter

Change by Zane Bitter :


--
pull_requests: +3988

___
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

2017-10-16 Thread Barry A. Warsaw

Barry A. Warsaw  added the comment:

I've landed here after chatting with @brett.cannon.  I have a use case for this 
(making pex startup faster by bypassing pkg_resources) but I need to hack 
around the limitation of dlopen'ing .so's from zips.  Our idea was to have a 
zipimport subclass which doesn't return None from `importlib.util.find_spec()` 
when it finds a .so, but instead dumps that into some safe directory, and then 
arranges for a loader that knows how to load that.  It sure would be handy for 
this to be a zipimporter subclass. :)

I think Serhiy's patch predates the move to GitHub, so it's not a branch/PR.  I 
guess the next step would be to branchify the patch and then continue 
discussion over there.  Depending on my availability, I might do that.

--

___
Python tracker 

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



[issue31558] gc.freeze() - an API to mark objects as uncollectable

2017-10-16 Thread Łukasz Langa

Łukasz Langa  added the comment:


New changeset c30b55b96c0967e3a8b3b86f25eb012a97f360a5 by Łukasz Langa in 
branch 'master':
bpo-31558: Update NEWS and ACKS (#4013)
https://github.com/python/cpython/commit/c30b55b96c0967e3a8b3b86f25eb012a97f360a5


--

___
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

2017-10-16 Thread Barry A. Warsaw

Change by Barry A. Warsaw :


--
nosy: +barry

___
Python tracker 

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



[issue31558] gc.freeze() - an API to mark objects as uncollectable

2017-10-16 Thread Łukasz Langa

Change by Łukasz Langa :


--
pull_requests: +3987

___
Python tracker 

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



[issue31558] gc.freeze() - an API to mark objects as uncollectable

2017-10-16 Thread Łukasz Langa

Change by Łukasz Langa :


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



[issue31558] gc.freeze() - an API to mark objects as uncollectable

2017-10-16 Thread Łukasz Langa

Łukasz Langa  added the comment:


New changeset c75edabbb65ca2bb29e51f8d1eb2c780e5890982 by Łukasz Langa 
(brainfvck) in branch 'master':
bpo-31558: Add gc.freeze() (#3705)
https://github.com/python/cpython/commit/c75edabbb65ca2bb29e51f8d1eb2c780e5890982


--

___
Python tracker 

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



[issue31558] gc.freeze() - an API to mark objects as uncollectable

2017-10-16 Thread Łukasz Langa

Łukasz Langa  added the comment:

Based on Inadasan's, Antoine's, Neil's, and Barry's review, I'm merging the 
change to 3.7.

--

___
Python tracker 

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



[issue31754] Documented type of parameter 'itemsize' to PyBuffer_FillContiguousStrides is incorrect.

2017-10-16 Thread Berker Peksag

Berker Peksag  added the comment:

Thank you for the report, Robert and thank you for the patches, Aniket.

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



[issue31754] Documented type of parameter 'itemsize' to PyBuffer_FillContiguousStrides is incorrect.

2017-10-16 Thread Berker Peksag

Berker Peksag  added the comment:


New changeset 50cef52372381a9e2f3d760497d8db76254cffef by Berker Peksag 
(vyas45) in branch '2.7':
[2.7] bpo-31754: Fix type of 'itemsize' in PyBuffer_FillContiguousStrides 
(GH-3993)
https://github.com/python/cpython/commit/50cef52372381a9e2f3d760497d8db76254cffef


--

___
Python tracker 

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



[issue31754] Documented type of parameter 'itemsize' to PyBuffer_FillContiguousStrides is incorrect.

2017-10-16 Thread Aniket Vyas

Change by Aniket Vyas :


--
pull_requests: +3986

___
Python tracker 

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



[issue31738] Lib/site.py: method `abs_paths` is not documented

2017-10-16 Thread Éric Araujo

Éric Araujo  added the comment:

Thanks for wanting to help!  This function is not meant to be public, which 
explains why it’s not documented.  Please see the devguide and the 
core-mentorship mailing list to find ways to contribute!

--
nosy: +merwok
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



[issue31754] Documented type of parameter 'itemsize' to PyBuffer_FillContiguousStrides is incorrect.

2017-10-16 Thread Aniket Vyas

Change by Aniket Vyas :


--
pull_requests: +3985
stage: backport needed -> patch review

___
Python tracker 

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



[issue31773] Rewrite _PyTime_GetWinPerfCounter() for _PyTime_t

2017-10-16 Thread STINNER Victor

STINNER Victor  added the comment:


New changeset bdaeb7d237462a629e6c85001317faa85f94a0c6 by Victor Stinner in 
branch 'master':
bpo-31773: _PyTime_GetPerfCounter() uses _PyTime_t (GH-3983)
https://github.com/python/cpython/commit/bdaeb7d237462a629e6c85001317faa85f94a0c6


--

___
Python tracker 

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



[issue28700] test_dbm failure: KeyError: b'0' (intermittent in 3.5, reliable in 3.6)

2017-10-16 Thread Facundo Batista

Facundo Batista  added the comment:

I have this failure on my machine too (Ubuntu 17.04, kernel 4.10.0-37-generic).

Installing `libgdbm-dev` and running configure with 
`--with-dbmliborder=gdbm:bdb` didn't help.

--
nosy: +facundobatista

___
Python tracker 

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



[issue31784] Implementation of the PEP 564: Add time.time_ns()

2017-10-16 Thread STINNER Victor

STINNER Victor  added the comment:

> For the full rationale, see my thread on python-ideas: (...)

I just created the PEP 564: "Add new time functions with nanosecond resolution".

--

___
Python tracker 

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



[issue31784] Implementation of the PEP 564: Add time.time_ns()

2017-10-16 Thread STINNER Victor

Change by STINNER Victor :


--
title: Add time.time_ns(): get time with nanosecond resolution -> 
Implementation of the PEP 564: Add time.time_ns()

___
Python tracker 

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



[issue31799] Improve __spec__ discoverability

2017-10-16 Thread Barry A. Warsaw

Change by Barry A. Warsaw :


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

___
Python tracker 

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



[issue31799] Improve __spec__ discoverability

2017-10-16 Thread Barry A. Warsaw

New submission from Barry A. Warsaw :

__spec__ is defined in PEP 451.  If you search for "__spec__" in the docs, you 
get a number of hits.

https://docs.python.org/3/search.html?q=__spec__&check_keywords=yes&area=default

Click on the first link:

https://docs.python.org/3/reference/import.html?highlight=__spec__#__spec__

but that still leaves you scratching your head as to what exactly is in 
__spec__.  If you happen to scroll up a little bit though, you end up here:

https://docs.python.org/3/reference/import.html?highlight=__spec__#module-spec

and then if you follow the link to ModuleSpec, you finally get to here:

https://docs.python.org/3/library/importlib.html#importlib.machinery.ModuleSpec

and *that's* where the contents of __spec__ are defined.  Not very discoverable.

I propose just a couple of small documentation fixes to add "__spec__" in both 
of those locations so that a search lands you in a useful place.

--
assignee: barry
components: Documentation
messages: 304474
nosy: barry
priority: normal
severity: normal
status: open
title: Improve __spec__ discoverability
versions: Python 3.4, Python 3.5, Python 3.6, Python 3.7

___
Python tracker 

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



[issue31786] In select.poll.poll() ms can be 0 if timeout < 0

2017-10-16 Thread Riccardo Coccioli

Change by Riccardo Coccioli :


--
nosy: +Riccardo Coccioli

___
Python tracker 

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



[issue31334] select.poll.poll fails on BSDs with arbitrary negative timeouts

2017-10-16 Thread Riccardo Coccioli

Riccardo Coccioli  added the comment:

Although it's documented as -1 in Linux man page [1], from my quick tests I was 
not able to get any error with negative values different from -1 and it seems 
to wait indefinitely as expected. Looking also at its implementation in [2], it 
doesn't seem to differentiate between negative values. It could be argued that 
is implementation dependent at the moment and the behaviour might change in the 
future.
But, on a related note, the Python documentation doesn't say much either as 
what are acceptable values for the timeout parameter, see [3].

So at the moment there isn't any discrepancy between the Python documentation 
and the current behaviour IMHO, but I'm happy to open a separate task and send 
a PR if you think this should be improved/fixed too.

[1] http://man7.org/linux/man-pages/man2/epoll_wait.2.html
[2] http://elixir.free-electrons.com/linux/latest/source/fs/eventpoll.c#L1754
[3] https://docs.python.org/3.7/library/select.html

--

___
Python tracker 

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



[issue31334] select.poll.poll fails on BSDs with arbitrary negative timeouts

2017-10-16 Thread STINNER Victor

Change by STINNER Victor :


--
nosy: +haypo

___
Python tracker 

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



[issue31334] select.poll.poll fails on BSDs with arbitrary negative timeouts

2017-10-16 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

Shouldn't epoll_poll() be fixed too? Only -1 is documented as an infinity 
timeout in epoll_wait (2).

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue31797] Python 3.6.3: JSON loop fails using elif

2017-10-16 Thread Steven D'Aprano

Steven D'Aprano  added the comment:

Oops, accidentally messed up the status. Fixing now.

Francesco, if you simplify your code and come back with a detailed description 
of what you think the bug is, then we will investigate.

--
nosy: +eric.smith
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



[issue31797] Python 3.6.3: JSON loop fails using elif

2017-10-16 Thread Steven D'Aprano

Steven D'Aprano  added the comment:

What are you claiming is the bug? I don't understand what you think the problem 
is.

Don't dump a large script in our laps and expect us to get a Google API key to 
run it. Forget that, it isn't going to happen. Simplify your code to make the 
smallest, simplest demonstration you can.

Please read: http://sscce.org/

Then tell us:

- what you expect to happen
- what actually happens
- show any output you get
- including any exception.


To start with, there's no need to query five fields, if one field is enough. 
Make your code as simple as you can. Don't leave "dead code" commented out, 
delete it.

--
nosy: +steven.daprano -eric.smith
resolution: not a bug -> 
stage: resolved -> 
status: closed -> open

___
Python tracker 

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



[issue31797] Python 3.6.3: JSON loop fails using elif

2017-10-16 Thread Eric V. Smith

Eric V. Smith  added the comment:

Hi, Francesco.

This isn't the appropriate place to ask for help with your script.

I suggest trying the python-list mailing list.

--
nosy: +eric.smith
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



[issue31308] forkserver process isn't re-launched if it died

2017-10-16 Thread Matthew Rocklin

Matthew Rocklin  added the comment:

>From a user's perspective I would definitely appreciate forkserver being 
>protected from SIGINT.  This bug affects me in practice.  If the forkserver 
>goes down I personally have no objection to it restarting automatically, 
>though I appreciate that I have a narrow view of this topic.

Davin, at your last comment it seemed like you had reservations about this 
going in.  Did Antoine's recent comments resolve these concerns or no?  Do you 
have any suggestions on what might be done to protect users from SIGINT 
crashing the forkserver?

--
nosy: +Matthew Rocklin

___
Python tracker 

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



[issue31795] Slicings documentation doesn't mention Ellipsis

2017-10-16 Thread Raymond Hettinger

Raymond Hettinger  added the comment:

> Can we add an example of its usage in Numpy to the docs?

I don't think we should.   In CPython, the ellipsis has no interesting 
semantics.  It is something that third-party modules can use however they wish. 
 It doesn't make sense for CPython docs to cover their usage.

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



[issue31798] `site.abs__file__` fails for modules where `__file__` cannot be modified

2017-10-16 Thread Alexander McFarlane

Change by Alexander McFarlane :


--
title: "abs__file__" in "Lib/site.py" fails for modules where "__file__" cannot 
be assigned a new value -> `site.abs__file__` fails for modules where 
`__file__` cannot be modified

___
Python tracker 

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



[issue31798] "abs__file__" in "Lib/site.py" fails for modules where "__file__" cannot be assigned a new value

2017-10-16 Thread Alexander McFarlane

Change by Alexander McFarlane :


--
type:  -> crash

___
Python tracker 

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



[issue31798] "abs__file__" in "Lib/site.py" fails for modules where "__file__" cannot be assigned a new value

2017-10-16 Thread Alexander McFarlane

New submission from Alexander McFarlane :

The pythonnet module clr causes a TypeError when `abs__file__` attempts to run 
the following line:

`m.__file__ = os.path.abspath(m.__file__)`

Reproduction:

```
import clr
cls.__file__ = 'example'
```

--
components: +Library (Lib)
title: abs__file__ in "Lib/site.py" -> "abs__file__" in "Lib/site.py" fails for 
modules where "__file__" cannot be assigned a new value
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



[issue31798] abs__file__ in "Lib/site.py"

2017-10-16 Thread Alexander McFarlane

Change by Alexander McFarlane :


--
nosy: Alexander McFarlane
priority: normal
severity: normal
status: open
title: abs__file__ in "Lib/site.py"

___
Python tracker 

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



[issue31797] Python 3.6.3: JSON loop fails using elif

2017-10-16 Thread Francesco Mantovani

New submission from Francesco Mantovani :

I attach here a file with 3 different way to parse Google Places API.

Please put your Google API key token into the variable 
[PutHereYourGoogleAPIKey] to make the script work.

The script contains 3 loops:
- the first loop works and that's how I fixed the problem 
- the second loop fail because of the `elif`
- the third loop works because all `elif` were removed

--
components: Interpreter Core
files: Test_log_bug.py
messages: 304465
nosy: Francesco Mantovani
priority: normal
severity: normal
status: open
title: Python 3.6.3: JSON loop fails using elif
type: behavior
versions: Python 3.6
Added file: https://bugs.python.org/file47222/Test_log_bug.py

___
Python tracker 

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



[issue31772] SourceLoader uses stale bytecode in case of equal mtime seconds

2017-10-16 Thread Devin Bayer

Devin Bayer  added the comment:

That seems like it makes the most sense, though I would suggest a higher-level 
test, because caching of bytecode is an implementation detail. So, while 
mocking time.time to be constant:

1. write dummy module with x=1
2. import dummy
3. overwrite dummy module with x=2
4. reload(dummy)
5. assert dummy.x == 2

BTW Brett, I didn't think it was personal; that would be odd considering you 
don't know me. But from a new contributor's perspective it didn't look like you 
are taking bugs seriously. If you had pointed out that you will reopen it if I 
made a good case, that would be been more clear.

--

___
Python tracker 

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



[issue31786] In select.poll.poll() ms can be 0 if timeout < 0

2017-10-16 Thread STINNER Victor

STINNER Victor  added the comment:

> It seems like _PyTime_ROUND_CEILING is not needed in Python currently.

Oops, my pending PR 3983 uses _PyTime_ROUND_CEILING :-) Please keep it.

--

___
Python tracker 

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



[issue31776] Missing "raise from None" in /Lib/xml/etree/ElementPath.py

2017-10-16 Thread Serhiy Storchaka

Change by Serhiy Storchaka :


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

___
Python tracker 

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



[issue31776] Missing "raise from None" in /Lib/xml/etree/ElementPath.py

2017-10-16 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:


New changeset 0df19055c92a0b0728659807978e4ca4d6c8e1bc by Serhiy Storchaka 
(Pablo Galindo) in branch 'master':
bpo-31776: Missing "raise from None" in Lib/xml/etree/ElementPath.py (#3978)
https://github.com/python/cpython/commit/0df19055c92a0b0728659807978e4ca4d6c8e1bc


--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue31792] test_buffer altered the execution environment

2017-10-16 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

Thank you Victor and Stefan for your review.

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



[issue31792] test_buffer altered the execution environment

2017-10-16 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:


New changeset 06949585d292d1a9dbf2d0d0fa8fc8fe1dee3ccf by Serhiy Storchaka 
(Miss Islington (bot)) in branch '3.6':
[3.6] bpo-31792: Restore os.environ in test_buffer when import numpy. (GH-4007) 
(#4009)
https://github.com/python/cpython/commit/06949585d292d1a9dbf2d0d0fa8fc8fe1dee3ccf


--

___
Python tracker 

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



[issue31647] asyncio: StreamWriter write_eof() after close raises mysterious AttributeError

2017-10-16 Thread STINNER Victor

Change by STINNER Victor :


--
nosy:  -haypo

___
Python tracker 

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



[issue31647] asyncio: StreamWriter write_eof() after close raises mysterious AttributeError

2017-10-16 Thread STINNER Victor

STINNER Victor  added the comment:

(Sorry, I don't work on asyncio anymore.)

--

___
Python tracker 

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



[issue31774] tarfile.open ignores custom bufsize value when creating a new archive

2017-10-16 Thread Nitish

Nitish  added the comment:

Sorry. My bad. There *is* an argument 'copybufsize' in TarFile.

--

___
Python tracker 

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



[issue31774] tarfile.open ignores custom bufsize value when creating a new archive

2017-10-16 Thread Nitish

Nitish  added the comment:

Seems like bufsize is used only in streaming modes. Even in the documentation 
bufsize is described only in the context of streaming modes. 

Even TarFile constructor doesn't take bufsize as an argument. Why is it so?

--

___
Python tracker 

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



[issue31786] In select.poll.poll() ms can be 0 if timeout < 0

2017-10-16 Thread STINNER Victor

STINNER Victor  added the comment:

Ok, so it seems like we need 3 rounding modes:

* _PyTime_ROUND_FLOOR: read a clock, like datetime.datetime.now(). We need to 
round nanoseconds since datetime.datetime only supports 1 us resolution

* _PyTime_ROUND_HALF_EVEN: "round from a Python float" like round(float), used 
by datetime.datetime.fromtimestamp()

* _PyTime_ROUND_UP: round timeouts, socket.settimeout(), lock.acquire(timeout), 
poll(timeout), etc.

_PyTime_ROUND_UP and _PyTime_ROUND_CEILING are the same for positive numbers, 
but using _PyTime_ROUND_CEILING causes this bug: values in ]-0.5; 0.0[ are 
rounding to zero which gives the wrong behaviour. It seems like 
_PyTime_ROUND_CEILING is not needed in Python currently.

--

___
Python tracker 

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



[issue31792] test_buffer altered the execution environment

2017-10-16 Thread Roundup Robot

Change by Roundup Robot :


--
pull_requests: +3983

___
Python tracker 

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



[issue31792] test_buffer altered the execution environment

2017-10-16 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:


New changeset 676db4bbf2e7c18dc7c35add17dd3bbdc2d3eeb3 by Serhiy Storchaka in 
branch 'master':
bpo-31792: Restore os.environ in test_buffer when import numpy. (#4007)
https://github.com/python/cpython/commit/676db4bbf2e7c18dc7c35add17dd3bbdc2d3eeb3


--

___
Python tracker 

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



[issue31774] tarfile.open ignores custom bufsize value when creating a new archive

2017-10-16 Thread Nitish

Change by Nitish :


--
nosy: +nitishch

___
Python tracker 

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



[issue31647] asyncio: StreamWriter write_eof() after close raises mysterious AttributeError

2017-10-16 Thread twisteroid ambassador

Change by twisteroid ambassador :


--
nosy: +giampaolo.rodola, haypo

___
Python tracker 

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