Issue 34239: Convert test_bz2 to use tempfile (original) (raw)

This issue has been migrated to GitHub: https://github.com/python/cpython/issues/78420

classification

Title: Convert test_bz2 to use tempfile
Type: behavior Stage: resolved
Components: Versions: Python 3.8

process

Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: tim.golden Nosy List: brett.cannon, serhiy.storchaka, tim.golden, tjguk
Priority: normal Keywords: patch

Created on 2018-07-26 17:28 by tim.golden, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 8485 merged tim.golden,2018-07-26 17:43
Messages (5)
msg322441 - (view) Author: Tim Golden (tim.golden) * (Python committer) Date: 2018-07-26 17:28
test_bz2 currently uses the test.support.TESTFN functionality which creates a temporary file local to the test directory named around the pid. This can give rise to race conditions where tests are competing with each other to delete and recreate the file.
msg322451 - (view) Author: Tim Golden (tim.golden) * (Python committer) Date: 2018-07-26 21:05
New changeset 6a62e1d365934de82ff7c634981b3fbf218b4d5f by Tim Golden in branch 'master': bpo-34239: Convert test_bz2 to use tempfile (#8485) https://github.com/python/cpython/commit/6a62e1d365934de82ff7c634981b3fbf218b4d5f
msg322461 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2018-07-27 04:52
It is more reliable to use test.support.unlink().
msg322517 - (view) Author: Brett Cannon (brett.cannon) * (Python committer) Date: 2018-07-28 00:06
Should this issue be closed, Tim, after you update for Serhiy's suggestion? (Basically I'm just making sure you know issues are not automatically closed after merge :) .
msg322528 - (view) Author: TJG (tjguk) Date: 2018-07-28 08:52
Thanks, Brett. I'll address Serhiy's comment with a new PR and then tidy yup.
History
Date User Action Args
2022-04-11 14:59:03 admin set github: 78420
2018-07-28 17:28:37 tim.golden set status: open -> closedresolution: fixedstage: patch review -> resolved
2018-07-28 08:52:56 tjguk set nosy: + tjgukmessages: +
2018-07-28 00:06:09 brett.cannon set nosy: + brett.cannonmessages: +
2018-07-27 04:52:52 serhiy.storchaka set nosy: + serhiy.storchakamessages: +
2018-07-26 21:05:08 tim.golden set messages: +
2018-07-26 17:43:23 tim.golden set keywords: + patchstage: patch reviewpull_requests: + <pull%5Frequest8007>
2018-07-26 17:28:08 tim.golden create