Issue 7879: Too narrow platform check in test_datetime (original) (raw)

Issue7879

Created on 2010-02-07 22:16 by akrpic77, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
test_datetime_win32_check.patch akrpic77,2010-02-07 22:16 test_datetime patch
issue7879.diff belopolsky,2010-05-26 20:31
Messages (10)
msg99026 - (view) Author: Andrej Krpic (akrpic77) Date: 2010-02-07 22:16
Windows doesn't accept negative timestamps (stated in the comment), yet checks is made against os.name instead of sys.platform. patch fixes that, and also enables windows ce to pass on this test. I think this is better than having os.name in ("nt", "ce").
msg106532 - (view) Author: Mark Dickinson (mark.dickinson) * (Python committer) Date: 2010-05-26 15:23
This looks fine to me. Alexander?
msg106544 - (view) Author: Alexander Belopolsky (belopolsky) * (Python committer) Date: 2010-05-26 17:06
Mark, I have zero experience with Windows and don't even have a win32 machine to test the patch. On the other hand the patch is so simple that I think it can be reviewed based on theoretical considerations. This is probably bikesheding, but I have a slight preference for os.name in ("nt", "ce"). The reason is that sys.platform is fixed when python is built while os.name is (in theory) determined at run-time. Also, sys.platform == "win32", appears to be false on 64 bit Windows, but I think it is actually true. Finally, explicit better than implicit. A change from if os.name == "nt" to os.name in ("nt", "ce") gives obviously a strictly wider check. On the other hand it is not obvious to me how the current patch will affect Cygwin platform.
msg106547 - (view) Author: Brian Curtin (brian.curtin) * (Python committer) Date: 2010-05-26 17:15
sys.platform will be "win32" for both 32 and 64-bit Windows. As for Cygwin, os.name is "posix" there, and sys.platform is "cygwin", so it should be unaffected. The patch looks fine to me, and we do typically use sys.platform more often than the os.name check.
msg106549 - (view) Author: Alexander Belopolsky (belopolsky) * (Python committer) Date: 2010-05-26 17:23
OK, I'll commit it then.
msg106575 - (view) Author: Alexander Belopolsky (belopolsky) * (Python committer) Date: 2010-05-26 20:31
Committed in r81555 (trunk) and r81556 (py3k). Is this a 2.6 backport candidate? I don't think so. Leaving this open to consider using newer unittest.skipIf mechanism. See attached patch, .diff.
msg106576 - (view) Author: Mark Dickinson (mark.dickinson) * (Python committer) Date: 2010-05-26 20:36
The skipIf patch looks good to me (though I haven't tested it).
msg106577 - (view) Author: Alexander Belopolsky (belopolsky) * (Python committer) Date: 2010-05-26 20:38
From IRC: Taggnostr: imho tests and doc updates can be backported
msg106579 - (view) Author: Alexander Belopolsky (belopolsky) * (Python committer) Date: 2010-05-26 20:50
SkipIf patch committed in r81559 (trunk) and r81560 (py3k).
msg106792 - (view) Author: Alexander Belopolsky (belopolsky) * (Python committer) Date: 2010-05-31 16:23
- 26backport committed in r81618. - merged to release31-maint in r81619. The skipIf patch blocked from release26-maint (skipIf is new in 2.7) and merged into release31-maint in r81620.
History
Date User Action Args
2022-04-11 14:56:57 admin set github: 52127
2011-07-21 11:50:20 r.david.murray set messages: -
2011-07-21 11:50:02 r.david.murray set nosy: + r.david.murraymessages: +
2010-05-31 16:23:18 belopolsky set status: open -> closedmessages: + stage: commit review -> resolved
2010-05-26 20:50:22 belopolsky set messages: +
2010-05-26 20:39:39 belopolsky set versions: + Python 2.6, Python 3.1, Python 3.2
2010-05-26 20:38:06 belopolsky set keywords: + 26backportmessages: +
2010-05-26 20:36:30 mark.dickinson set messages: +
2010-05-26 20:31:13 belopolsky set files: + issue7879.diffmessages: +
2010-05-26 17:23:15 belopolsky set resolution: acceptedmessages: +
2010-05-26 17:15:04 brian.curtin set nosy: + brian.curtinmessages: +
2010-05-26 17:06:19 belopolsky set messages: +
2010-05-26 16:13:42 belopolsky set assignee: belopolskystage: commit review
2010-05-26 15:23:01 mark.dickinson set nosy: + mark.dickinson, belopolskymessages: +
2010-05-10 12🔞37 akrpic77 set type: behaviorcomponents: + Windows
2010-02-07 22:16:33 akrpic77 create