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 2017年01月03日 13:57 by vstinner, last changed 2022年04月11日 14:58 by admin. This issue is now closed.
| Files | ||||
|---|---|---|---|---|
| File name | Uploaded | Description | Edit | |
| time_hash.patch | vstinner, 2017年01月03日 13:57 | review | ||
| check.patch | vstinner, 2017年01月03日 22:45 | |||
| Messages (4) | |||
|---|---|---|---|
| msg284561 - (view) | Author: STINNER Victor (vstinner) * (Python committer) | Date: 2017年01月03日 13:57 | |
When the time is folded, time_hash() uses DATE_xxx() macros, instead of TIME_xxx() macros, and so reads microseconds from the wrong bytes. Bug introduced by the implementation of the PEP 495 (Local Time Disambiguation). #define PyDateTime_DATE_GET_MICROSECOND(o) \ ((((PyDateTime_DateTime*)o)->data[7] << 16) | \ (((PyDateTime_DateTime*)o)->data[8] << 8) | \ ((PyDateTime_DateTime*)o)->data[9]) #define PyDateTime_TIME_GET_MICROSECOND(o) \ ((((PyDateTime_Time*)o)->data[3] << 16) | \ (((PyDateTime_Time*)o)->data[4] << 8) | \ ((PyDateTime_Time*)o)->data[5]) Attached patch fixes time_hash(). I guess that it's a dummy copy-paste issue. |
|||
| msg284596 - (view) | Author: STINNER Victor (vstinner) * (Python committer) | Date: 2017年01月03日 22:45 | |
I used attached check.patch to check if macros are misused in other functions. Hopefully, only time_hash() has bugs. I don't think that it's worth it to apply check.patch, I dislike such complex macro. |
|||
| msg284597 - (view) | Author: Roundup Robot (python-dev) (Python triager) | Date: 2017年01月03日 22:48 | |
New changeset 72e48ff7b169 by Victor Stinner in branch '3.6': Issue #29140: Fix hash(datetime.time) https://hg.python.org/cpython/rev/72e48ff7b169 |
|||
| msg284598 - (view) | Author: STINNER Victor (vstinner) * (Python committer) | Date: 2017年01月03日 22:48 | |
Note: I found this bug while working on the issue #29100. |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:58:41 | admin | set | github: 73326 |
| 2017年02月01日 17:15:10 | vstinner | set | status: open -> closed resolution: fixed |
| 2017年01月03日 22:48:40 | vstinner | set | messages: + msg284598 |
| 2017年01月03日 22:48:19 | python-dev | set | nosy:
+ python-dev messages: + msg284597 |
| 2017年01月03日 22:45:29 | vstinner | set | files:
+ check.patch messages: + msg284596 |
| 2017年01月03日 14:08:16 | vstinner | set | keywords: + 3.6regression |
| 2017年01月03日 13:57:09 | vstinner | create | |