summaryrefslogtreecommitdiff
path: root/indra/test/namedtempfile.h
diff options
context:
space:
mode:
authorNat Goodspeed <nat@lindenlab.com>2023-06-06 10:02:57 -0400
committerNat Goodspeed <nat@lindenlab.com>2023-06-06 10:02:57 -0400
commit1db7ac7139adf505be12308fd7ba2920f5beecde (patch)
tree4bcb3e6a3a1c4ea2fe99880b5ba984eb53c945b0 /indra/test/namedtempfile.h
parent6516c9d07db42beba5ba9c0c41a33925794a249c (diff)
SL-18837: Make NamedTempFile name template compatible with Python.
The recommended template uses hyphens; change to underscores to be valid Python temp module names.
Diffstat (limited to 'indra/test/namedtempfile.h')
-rw-r--r--indra/test/namedtempfile.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/indra/test/namedtempfile.h b/indra/test/namedtempfile.h
index 84b62a0945..8cd6c990dc 100644
--- a/indra/test/namedtempfile.h
+++ b/indra/test/namedtempfile.h
@@ -83,8 +83,9 @@ protected:
{
// Create file in a temporary place.
boost::filesystem::path tempname{ boost::filesystem::temp_directory_path() };
- // unique_path() recommended model
- tempname += stringize(pfx, "%%%%-%%%%-%%%%-%%%%", sfx);
+ // unique_path() recommended template, but with underscores instead of
+ // hyphens: some use cases involve temporary Python scripts
+ tempname += stringize(pfx, "%%%%_%%%%_%%%%_%%%%", sfx);
mPath = boost::filesystem::unique_path(tempname);
boost::filesystem::ofstream out{ mPath };