This issue tracker has been migrated to GitHub ,
and is currently read-only.
For more information,
see the GitHub FAQs in the Python's Developer Guide.
Created on 2016年05月03日 14:11 by xdegaye, last changed 2022年04月11日 14:58 by admin. This issue is now closed.
| Files | ||||
|---|---|---|---|---|
| File name | Uploaded | Description | Edit | |
| test_output.txt | xdegaye, 2016年05月03日 14:11 | test results | ||
| exclude_ymd.patch | xdegaye, 2016年11月09日 09:52 | review | ||
| exclude_ymd_2.patch | xdegaye, 2016年11月11日 16:22 | review | ||
| exclude_ymd_3.patch | xdegaye, 2016年11月12日 08:33 | Fixes the tuple. | review | |
| Messages (16) | |||
|---|---|---|---|
| msg264729 - (view) | Author: Xavier de Gaye (xdegaye) * (Python triager) | Date: 2016年05月03日 14:11 | |
test_strptime fails on an android emulator running an x86 system image at API level 21. See the attached test_output.txt file. |
|||
| msg264760 - (view) | Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) | Date: 2016年05月03日 19:53 | |
What is the output of following code?
import datetime
for i in range(1, 10):
print(datetime.date(1905, 1, i).strftime('%Y %U %w %G %V %u'))
|
|||
| msg264761 - (view) | Author: Xavier de Gaye (xdegaye) * (Python triager) | Date: 2016年05月03日 20:02 | |
root@generic_x86:/data/local/tmp # python Python 3.6.0a0 (default:f4c6dab59cd8+, May 3 2016, 21:59:47) [GCC 4.9 20140827 (prerelease)] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import datetime >>> for i in range(1, 10): ... print(datetime.date(1905, 1, i).strftime('%Y %U %w %G %V %u')) ... 1905 01 0 1904 53 7 1905 01 1 1905 01 1 1905 01 2 1905 01 2 1905 01 3 1905 01 3 1905 01 4 1905 01 4 1905 01 5 1905 01 5 1905 01 6 1905 01 6 1905 02 0 1905 01 7 1905 02 1 1905 02 1 >>> |
|||
| msg264762 - (view) | Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) | Date: 2016年05月03日 20:13 | |
Thanks. And what is the output of following code?
for i in range(25, 32):
print(datetime.date(1904, 12, i).strftime('%Y %U %w %G %V %u'))
|
|||
| msg264763 - (view) | Author: Xavier de Gaye (xdegaye) * (Python triager) | Date: 2016年05月03日 20:21 | |
>>> for i in range(25, 32):
... print(datetime.date(1904, 12, i).strftime('%Y %U %w %G %V %u'))
...
1904 52 0 1904 51 7
1904 52 1 1904 52 1
1904 52 2 1904 52 2
1904 52 3 1904 52 3
1904 52 4 1904 52 4
1904 52 5 1904 52 5
1904 52 6 1904 52 6
>>>
|
|||
| msg264765 - (view) | Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) | Date: 2016年05月03日 20:34 | |
Thus there is a gap between 1904年12月31日 and 1905年1月1日. This is a bug in strftime() on Android. |
|||
| msg264768 - (view) | Author: Xavier de Gaye (xdegaye) * (Python triager) | Date: 2016年05月03日 21:08 | |
GNU libc says: ‘%V’ The ISO 8601:1988 week number as a decimal number (range ‘01’ through ‘53’). ISO weeks start with Monday and end with Sunday. Week ‘01’ of a year is the first week which has the majority of its days in that year; this is equivalent to the week containing the year’s first Thursday, and it is also equivalent to the week containing January 4. Week ‘01’ of a year can contain days from the previous year. The week before week ‘01’ of a year is the last week (‘52’ or ‘53’) of the previous year even if it contains days from the new year. This format was first standardized by POSIX.2-1992 and by ISO C99. So on 1905年1月1日, %V should be 52 instead of 53 as printed by android; is this the only bug ? A pretty good test to find such a mistake. |
|||
| msg264769 - (view) | Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) | Date: 2016年05月03日 21:27 | |
There is other bug at the last week of a year:
import datetime
for i in range(25, 32):
print(datetime.date(1906, 12, i).strftime('%Y %U %w %G %V %u'))
for i in range(1, 10):
print(datetime.date(1907, 1, i).strftime('%Y %U %w %G %V %u'))
|
|||
| msg264786 - (view) | Author: Xavier de Gaye (xdegaye) * (Python triager) | Date: 2016年05月04日 07:29 | |
Here is the result of running on android:
<script>
import datetime
for y in (1904, 1906, 2008, 1917):
for i in range(25, 32):
print(datetime.date(y, 12, i).strftime('%Y %U %w %G %V %u'))
print()
for i in range(1, 10):
print(datetime.date(y + 1, 1, i).strftime('%Y %U %w %G %V %u'))
print('=====================')
<script>
root@generic_x86:/data/local/tmp # python strftime.py
1904 52 0 1904 51 7
1904 52 1 1904 52 1
1904 52 2 1904 52 2
1904 52 3 1904 52 3
1904 52 4 1904 52 4
1904 52 5 1904 52 5
1904 52 6 1904 52 6
1905 01 0 1904 53 7
1905 01 1 1905 01 1
1905 01 2 1905 01 2
1905 01 3 1905 01 3
1905 01 4 1905 01 4
1905 01 5 1905 01 5
1905 01 6 1905 01 6
1905 02 0 1905 01 7
1905 02 1 1905 02 1
=わ=わ=わ=わ=わ=わ=わ=わ=わ=わ=わ=わ=わ=わ=わ=わ=わ=わ=わ=わ=わ
1906 51 2 1906 52 2
1906 51 3 1906 52 3
1906 51 4 1906 52 4
1906 51 5 1906 52 5
1906 51 6 1906 52 6
1906 52 0 1906 52 7
1906 52 1 1907 53 1
1907 00 2 1907 01 2
1907 00 3 1907 01 3
1907 00 4 1907 01 4
1907 00 5 1907 01 5
1907 00 6 1907 01 6
1907 01 0 1907 01 7
1907 01 1 1907 02 1
1907 01 2 1907 02 2
1907 01 3 1907 02 3
=わ=わ=わ=わ=わ=わ=わ=わ=わ=わ=わ=わ=わ=わ=わ=わ=わ=わ=わ=わ=わ
2008 51 4 2008 52 4
2008 51 5 2008 52 5
2008 51 6 2008 52 6
2008 52 0 2008 52 7
2008 52 1 2009 53 1
2008 52 2 2009 53 2
2008 52 3 2009 53 3
2009 00 4 2009 01 4
2009 00 5 2009 01 5
2009 00 6 2009 01 6
2009 01 0 2009 01 7
2009 01 1 2009 02 1
2009 01 2 2009 02 2
2009 01 3 2009 02 3
2009 01 4 2009 02 4
2009 01 5 2009 02 5
=わ=わ=わ=わ=わ=わ=わ=わ=わ=わ=わ=わ=わ=わ=わ=わ=わ=わ=わ=わ=わ
1917 51 2 1917 52 2
1917 51 3 1917 52 3
1917 51 4 1917 52 4
1917 51 5 1917 52 5
1917 51 6 1917 52 6
1917 52 0 1917 52 7
1917 52 1 1918 53 1
1918 00 2 1918 01 2
1918 00 3 1918 01 3
1918 00 4 1918 01 4
1918 00 5 1918 01 5
1918 00 6 1918 01 6
1918 01 0 1918 01 7
1918 01 1 1918 02 1
1918 01 2 1918 02 2
1918 01 3 1918 02 3
=====================
|
|||
| msg264790 - (view) | Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) | Date: 2016年05月04日 08:01 | |
1904 52 6 1904 52 6 1905 01 0 1904 53 7 ^^ 1906 52 0 1906 52 7 1906 52 1 1907 53 1 ^^^^ strftime() on Android incorrectly formats %V or %G for the last or the first incomplete week in a year. |
|||
| msg280388 - (view) | Author: Xavier de Gaye (xdegaye) * (Python triager) | Date: 2016年11月09日 09:52 | |
Patch attached. |
|||
| msg280389 - (view) | Author: Xavier de Gaye (xdegaye) * (Python triager) | Date: 2016年11月09日 10:05 | |
Entered new issue https://code.google.com/p/android/issues/detail?id=227388 on the AOSP issue tracker. |
|||
| msg280594 - (view) | Author: Xavier de Gaye (xdegaye) * (Python triager) | Date: 2016年11月11日 16:22 | |
New patch following Serhiy comments. |
|||
| msg280644 - (view) | Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) | Date: 2016年11月12日 09:00 | |
exclude_ymd_3.patch LGTM. |
|||
| msg280647 - (view) | Author: Xavier de Gaye (xdegaye) * (Python triager) | Date: 2016年11月12日 09:16 | |
Thanks Serhiy for your help with this issue. I will push this patch with the other Android patches after 3.6 is released. |
|||
| msg280864 - (view) | Author: Roundup Robot (python-dev) (Python triager) | Date: 2016年11月15日 16:26 | |
New changeset 3c6e5f83d235 by Xavier de Gaye in branch '3.6': Issue #26929: Skip some test_strptime tests failing on Android that https://hg.python.org/cpython/rev/3c6e5f83d235 New changeset 91e0cf7f8e30 by Xavier de Gaye in branch 'default': Issue #26929: Merge 3.6 https://hg.python.org/cpython/rev/91e0cf7f8e30 |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:58:30 | admin | set | github: 71116 |
| 2016年11月15日 18:52:40 | xdegaye | set | status: open -> closed resolution: fixed stage: commit review -> resolved |
| 2016年11月15日 16:26:48 | python-dev | set | nosy:
+ python-dev messages: + msg280864 |
| 2016年11月12日 09:16:50 | xdegaye | set | messages: + msg280647 |
| 2016年11月12日 09:00:52 | serhiy.storchaka | set | messages:
+ msg280644 stage: patch review -> commit review |
| 2016年11月12日 08:33:38 | xdegaye | set | files: + exclude_ymd_3.patch |
| 2016年11月11日 16:22:38 | xdegaye | set | files:
+ exclude_ymd_2.patch messages: + msg280594 |
| 2016年11月09日 10:05:10 | xdegaye | set | messages: + msg280389 |
| 2016年11月09日 09:52:15 | xdegaye | set | files:
+ exclude_ymd.patch assignee: xdegaye components: - Cross-Build versions: + Python 3.7 keywords: + patch messages: + msg280388 stage: patch review |
| 2016年05月21日 07:06:39 | xdegaye | link | issue26865 dependencies |
| 2016年05月04日 08:01:48 | serhiy.storchaka | set | messages: + msg264790 |
| 2016年05月04日 07:29:30 | xdegaye | set | messages: + msg264786 |
| 2016年05月03日 21:27:26 | serhiy.storchaka | set | messages: + msg264769 |
| 2016年05月03日 21:08:28 | xdegaye | set | messages: + msg264768 |
| 2016年05月03日 20:34:23 | serhiy.storchaka | set | messages: + msg264765 |
| 2016年05月03日 20:21:15 | xdegaye | set | messages: + msg264763 |
| 2016年05月03日 20:13:14 | serhiy.storchaka | set | messages: + msg264762 |
| 2016年05月03日 20:02:55 | xdegaye | set | messages: + msg264761 |
| 2016年05月03日 19:53:12 | serhiy.storchaka | set | nosy:
+ serhiy.storchaka messages: + msg264760 |
| 2016年05月03日 14:11:51 | xdegaye | create | |