diff options
author | Nat Goodspeed <nat@lindenlab.com> | 2023-06-06 10:02:57 -0400 |
---|---|---|
committer | Nat Goodspeed <nat@lindenlab.com> | 2023-06-06 10:02:57 -0400 |
commit | 1db7ac7139adf505be12308fd7ba2920f5beecde (patch) | |
tree | 4bcb3e6a3a1c4ea2fe99880b5ba984eb53c945b0 | |
parent | 6516c9d07db42beba5ba9c0c41a33925794a249c (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.
-rw-r--r-- | indra/test/namedtempfile.h | 5 |
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 }; |