Re: [Python-Dev] Tests failing on Windows with TESTFN

2018-07-28 Thread Jeremy Kloth
On Sat, Jul 28, 2018 at 7:15 PM Chris Jerdonek wrote: > Regardless of whether the tempfile or TESTFN approach is used, I think it > would be best for a few reasons if the choice is abstracted behind a uniquely > named test function (e.g. make_test_file if not already used). +1, although my

Re: [Python-Dev] Tests failing on Windows with TESTFN

2018-07-28 Thread Chris Jerdonek
On Sat, Jul 28, 2018 at 5:40 PM Brett Cannon wrote: > > On Sat, Jul 28, 2018, 15:13 eryk sun, wrote: > >> On Sat, Jul 28, 2018 at 9:17 PM, Jeremy Kloth >> wrote: >> > >> > *PLEASE*, don't use tempfile to create files/directories in tests. It >> > is unfriendly to (Windows) buildbots. The

Re: [Python-Dev] Tests failing on Windows with TESTFN

2018-07-28 Thread Jeremy Kloth
On Sat, Jul 28, 2018 at 6:43 PM Brett Cannon wrote: > If Windows doesn't clean up its temp directory on a regular basis then that > doesn't suggest to me not to use tempfile, but instead that the use of > tempfile still needs to clean up after itself. And if there is a lacking > feature in

Re: [Python-Dev] Tests failing on Windows with TESTFN

2018-07-28 Thread Brett Cannon
On Sat, Jul 28, 2018, 15:13 eryk sun, wrote: > On Sat, Jul 28, 2018 at 9:17 PM, Jeremy Kloth > wrote: > > > > *PLEASE*, don't use tempfile to create files/directories in tests. It > > is unfriendly to (Windows) buildbots. The current approach of > > directory-per-process ensures no test turds

Re: [Python-Dev] [Python-checkins] bpo-34239: Convert test_bz2 to use tempfile (#8485)

2018-07-28 Thread Chris Jerdonek
On Thu, Jul 26, 2018 at 2:05 PM, Tim Golden wrote: > https://github.com/python/cpython/commit/6a62e1d365934de82ff7c634981b3fbf218b4d5f > commit: 6a62e1d365934de82ff7c634981b3fbf218b4d5f > branch: master > author: Tim Golden > committer: GitHub > date: 2018-07-26T22:05:00+01:00 > summary: > >

Re: [Python-Dev] Tests failing on Windows with TESTFN

2018-07-28 Thread eryk sun
On Sat, Jul 28, 2018 at 9:17 PM, Jeremy Kloth wrote: > > *PLEASE*, don't use tempfile to create files/directories in tests. It > is unfriendly to (Windows) buildbots. The current approach of > directory-per-process ensures no test turds are left behind, whereas > the tempfile solution slowly

Re: [Python-Dev] Tests failing on Windows with TESTFN

2018-07-28 Thread eryk sun
On Sat, Jul 28, 2018 at 5:20 PM, Tim Golden wrote: > > I've got a mixture of Permission (winerror 13) & Access errors (winerror 5) EACCES (13) is a CRT errno value. Python raises PermissionError for EACCES and EPERM (1, not used). It also does the reverse mapping for WinAPI calls, so

Re: [Python-Dev] Tests failing on Windows with TESTFN

2018-07-28 Thread Chris Jerdonek
On Sat, Jul 28, 2018 at 10:20 AM, Tim Golden wrote: > > Here's the thing. The TESTFN approach creates a directory per process > test_python_ and some variant of @test__tmp inside that directory. I filed an issue some years back about this (still open): https://bugs.python.org/issue15305 The pid

Re: [Python-Dev] Tests failing on Windows with TESTFN

2018-07-28 Thread Jeremy Kloth
On Sat, Jul 28, 2018 at 11:20 AM Tim Golden wrote: > Although things have moved on since that discussion and > test.support.unlink has grown some extra legs, all it's done really is > to push the bump along the carpet for a bit. I've got a newly-installed > Win10 machine with the typical MS

Re: [Python-Dev] Tests failing on Windows with TESTFN

2018-07-28 Thread Tim Golden
On 28/07/2018 17:27, Jeremy Kloth wrote: On Sat, Jul 28, 2018 at 8:41 AM Tim Golden wrote: 1) Why are these errors occurring? ie are we dodging a root cause issue The root cause is how Windows handles file deletions. When a file is removed, it is not immediately removed from the directory,

Re: [Python-Dev] Tests failing on Windows with TESTFN

2018-07-28 Thread Jeremy Kloth
On Sat, Jul 28, 2018 at 8:41 AM Tim Golden wrote: > 1) Why are these errors occurring? ie are we dodging a root cause issue The root cause is how Windows handles file deletions. When a file is removed, it is not immediately removed from the directory, instead, it is simply marked for deletion.

[Python-Dev] USE_STACKCHECK and running out of stack

2018-07-28 Thread Ronald Oussoren via Python-Dev
Hi, I’m looking at PyOS_CheckStack because this feature might be useful on macOS (and when I created bpo-33955 for this someone ran with it and created a patch). Does anyone remember why the interpreter raises MemoryError and not RecursionError when PyOS_CheckStack detects that we’re about to

Re: [Python-Dev] Tests failing on Windows with TESTFN

2018-07-28 Thread Tim Golden
On 25/07/2018 16:07, Tim Golden wrote: One problem is that certain tests use support.TESTFN (a local directory constructed from the pid) for output files etc. However this can cause issues on Windows when recreating the folders / files for multiple tests, especially when running in parallel.