[issue10381] Add timezone support to datetime C API

2018-07-05 Thread STINNER Victor


STINNER Victor  added the comment:

I tested manually "./python -m test test_datetime test_datetime" in 3.6, 3.7 
and master branches: I confirm that the test no longer crash. It has been fixed 
by the commit 58dc03c737a71de93edef7723c9f6186116288ef.

Moreover, I don't recall a recent crash on Windows Refleak or Gentoo Refleak 
buildbots.

Thanks again Paul Ganssle for this nice enhancement!

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



[issue10381] Add timezone support to datetime C API

2018-07-05 Thread Paul Ganssle


Paul Ganssle  added the comment:

This can be closed now, I think.

--

___
Python tracker 

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



[issue10381] Add timezone support to datetime C API

2018-02-27 Thread Alexander Belopolsky

Alexander Belopolsky  added the comment:


New changeset fff596f792a0752b0e571fa57809e5752aba6353 by Alexander Belopolsky 
(Miss Islington (bot)) in branch '3.7':
bpo-10381, bpo-32403: What's new entries for changes to datetime (gh-5814) 
(gh-5929)
https://github.com/python/cpython/commit/fff596f792a0752b0e571fa57809e5752aba6353


--

___
Python tracker 

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



[issue10381] Add timezone support to datetime C API

2018-02-27 Thread Alexander Belopolsky

Alexander Belopolsky  added the comment:


New changeset 5bd04f964b4f1bcdbd0fa36de04f087c2db07cfe by Alexander Belopolsky 
(Paul Ganssle) in branch 'master':
bpo-10381, bpo-32403: What's new entries for changes to datetime (gh-5814)
https://github.com/python/cpython/commit/5bd04f964b4f1bcdbd0fa36de04f087c2db07cfe


--

___
Python tracker 

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



[issue10381] Add timezone support to datetime C API

2018-02-27 Thread miss-islington

Change by miss-islington :


--
pull_requests: +5700

___
Python tracker 

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



[issue10381] Add timezone support to datetime C API

2018-02-22 Thread miss-islington

Change by miss-islington :


--
pull_requests: +5596

___
Python tracker 

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



[issue10381] Add timezone support to datetime C API

2018-02-22 Thread Paul Ganssle

Change by Paul Ganssle :


--
pull_requests: +5588

___
Python tracker 

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



[issue10381] Add timezone support to datetime C API

2018-01-25 Thread STINNER Victor

STINNER Victor  added the comment:

Oh, PR 5317 title mentionned this bpo number, but the merged change omits the 
bpo number and so wasn't mentioned on this issue.

PR 5317 added:

commit 58dc03c737a71de93edef7723c9f6186116288ef (upstream/master, master)
Author: Paul Ganssle 
Date:   Thu Jan 25 08:58:07 2018 -0500

Cleanup dangling reference in get_timezone_utc_capi (#5317)

--

___
Python tracker 

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



[issue10381] Add timezone support to datetime C API

2018-01-25 Thread Paul Ganssle

Change by Paul Ganssle :


--
pull_requests: +5164

___
Python tracker 

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



[issue10381] Add timezone support to datetime C API

2018-01-25 Thread STINNER Victor

STINNER Victor  added the comment:

Ok, this time it should be fixed for real ;-)

--

___
Python tracker 

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



[issue10381] Add timezone support to datetime C API

2018-01-25 Thread Paul Ganssle

Change by Paul Ganssle :


--
pull_requests: +5163
stage: resolved -> patch review

___
Python tracker 

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



[issue10381] Add timezone support to datetime C API

2018-01-25 Thread STINNER Victor

STINNER Victor  added the comment:

Hunting reference leaks with "./python -m test -R 3:3 test_datetime" crashs 
since the commit 04af5b1ba9eb546a29735fac6cb5298159069b53.

***
vstinner@apu$ ./python -m test -R 3:3 test_datetime 
Run tests sequentially
0:00:00 load avg: 1.05 [1/1] test_datetime
beginning 6 repetitions
123456
Fatal Python error: Segmentation fault

Current thread 0x7ff71fe33040 (most recent call first):
  File "/home/vstinner/prog/python/master/Lib/test/datetimetester.py", line 
5464 in test_utc_capi
  (...)
Segmentation fault (core dumped)
***

Shorter example without -R, just run the same test twice:
***
vstinner@apu$ ./python -m test -v test_datetime test_datetime -m test_utc_capi
== CPython 3.7.0a4+ (heads/master:cab0b2b053, Jan 25 2018, 09:06:01) [GCC 7.2.1 
20170915 (Red Hat 7.2.1-2)]
== Linux-4.14.13-300.fc27.x86_64-x86_64-with-fedora-27-Twenty_Seven 
little-endian
== cwd: /home/vstinner/prog/python/master/build/test_python_26308
== CPU count: 8
== encodings: locale=UTF-8, FS=utf-8
Run tests sequentially
0:00:00 load avg: 1.26 [1/2] test_datetime
test_utc_capi (test.datetimetester.CapiTest_Pure) ... skipped 'Not relevant in 
pure Python'
test_utc_capi (test.datetimetester.CapiTest_Fast) ... ok

--
Ran 2 tests in 0.001s

OK (skipped=1)
0:00:00 load avg: 1.26 [2/2] test_datetime
test_utc_capi (test.datetimetester.CapiTest_Pure) ... skipped 'Not relevant in 
pure Python'
test_utc_capi (test.datetimetester.CapiTest_Fast) ... Fatal Python error: 
Segmentation fault

Current thread 0x7f9836b31040 (most recent call first):
  File "/home/vstinner/prog/python/master/Lib/test/datetimetester.py", line 
5464 in test_utc_capi
  (...)
Segmentation fault (core dumped)
***

--
nosy: +vstinner
resolution: fixed -> 
status: closed -> open

___
Python tracker 

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



[issue10381] Add timezone support to datetime C API

2018-01-24 Thread Alexander Belopolsky

Change by Alexander Belopolsky :


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



[issue10381] Add timezone support to datetime C API

2018-01-24 Thread Alexander Belopolsky

Alexander Belopolsky  added the comment:


New changeset 04af5b1ba9eb546a29735fac6cb5298159069b53 by Alexander Belopolsky 
(Paul Ganssle) in branch 'master':
bpo-10381: Add timezone to datetime C API (#5032)
https://github.com/python/cpython/commit/04af5b1ba9eb546a29735fac6cb5298159069b53


--

___
Python tracker 

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



[issue10381] Add timezone support to datetime C API

2017-12-30 Thread Nick Coghlan

Nick Coghlan  added the comment:

https://bugs.python.org/issue32459 covers defining a module-reloading-friendly 
way of using capsules.

For this issue, I now think it makes sense to just ignore that problem, and add 
whatever you need to the existing API.

--

___
Python tracker 

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



[issue10381] Add timezone support to datetime C API

2017-12-30 Thread Nick Coghlan

Nick Coghlan  added the comment:

On 31 December 2017 at 01:34, Paul Ganssle  wrote:
> That said, I think it would be really good if we could get a fast path for 
> timezone creation and access to the UTC singleton into the Python 3.7 
> release. I think it's kind of a big disparity between the Python and C APIs 
> that's existed for too long already.

It turns out the API already *is* exported as a capsule:
https://github.com/python/cpython/blob/master/Include/datetime.h#L149

Our general guidance for capsule usage is just outdated, and the
datetime API follows that dated advice:
https://docs.python.org/3/extending/extending.html#providing-a-c-api-for-an-extension-module

I'll file a separate issue for that docs problem later (the tracker is
reporting 502 Proxy Error for me right now)

--

___
Python tracker 

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



[issue10381] Add timezone support to datetime C API

2017-12-30 Thread Paul Ganssle

Paul Ganssle  added the comment:

@Nick

I'm certainly fine with re-configuring my PR to center around a new capsule 
module with deprecation of the old C API (though if you have any examples of 
what you have in mind that would be helpful to me). Certainly the "C global 
needs to be initiated" problem has bitten me in the past and I'm certain will 
continue to bite people in the future.

That said, I think it would be really good if we could get a fast path for 
timezone creation and access to the UTC singleton into the Python 3.7 release. 
I think it's kind of a big disparity between the Python and C APIs that's 
existed for too long already.

--

___
Python tracker 

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



[issue10381] Add timezone support to datetime C API

2017-12-29 Thread Nick Coghlan

Nick Coghlan  added the comment:

Would it be possible to deprecate (or at least stop enhancing) the current 
datetime C API and add a new capsule based one instead?

We're trying to get extension module authors to *stop* relying on C level 
globals, since it causes problems with:

- memory usage analysis
- interpreter reinitialisation
- module reloading
- subinterpreters

Unfortunately, the current design of the datetime C API *requires* the use of C 
level global state.

--
nosy: +ncoghlan

___
Python tracker 

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



[issue10381] Add timezone support to datetime C API

2017-12-28 Thread Paul Ganssle

Change by Paul Ganssle :


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



[issue10381] Add timezone support to datetime C API

2017-12-28 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



[issue10381] Add timezone support to datetime C API

2015-09-29 Thread Alexander Belopolsky

Alexander Belopolsky added the comment:

Since issue 24773 (PEP 495 implementation) will touch on CAPI, maybe it is time 
to implement this as well.

--
nosy: +tim.peters
versions: +Python 3.6 -Python 3.5

___
Python tracker 

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



[issue10381] Add timezone support to datetime C API

2014-06-17 Thread Mark Lawrence

Changes by Mark Lawrence breamore...@yahoo.co.uk:


--
versions: +Python 3.5 -Python 3.2

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



[issue10381] Add timezone support to datetime C API

2010-11-11 Thread Alexander Belopolsky

New submission from Alexander Belopolsky belopol...@users.sourceforge.net:

With timezone class added to datetime module, C API should be extended to at 
the minimum support efficient creation of timezone instances and access to the 
singleton UTC instance.

I am not sure whether PyDateTime_TimeZone details should be exposed in 
datetime.h because presumably programmers should access it through the abstract 
tzinfo interface.

--
assignee: belopolsky
components: Extension Modules
messages: 120928
nosy: belopolsky
priority: normal
severity: normal
stage: needs patch
status: open
title: Add timezone support to datetime C API
type: feature request
versions: Python 3.2

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10381
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com