1,918 questions
7
votes
1
answer
149
views
Rename temporary file after closing its file descriptor in Python
I want to atomically write files in Python. pathlib and tempfile should be used.
I have
import os
from pathlib import Path
import tempfile
def atomic_write(f: Path, data: bytes) -> None:
with ...
1
vote
1
answer
78
views
Setting os.environ["TMP"] works in the code but not in pytest tests
I have the following python code:
import tempfile
import os
def test_paul_confused():
os.environ["TMP"] = "/home/fedora"
assert tempfile.gettempdir() == "/home/fedora&...
0
votes
1
answer
58
views
Python save TemporaryFile read as "w+b" to compressed tarfile
I am given a SpooledTemporaryFile through FastAPI's UploadFile. My goal is to write it to disk so I can extract it and process its contents later. This seems simple, but I am having problems saving ...
2
votes
1
answer
82
views
How to write models to tempdir()
I'm creating an R package that automatically creates trained models. One of the goals is to allow the user to save the trained models for use with future data. The trained models were originally saved ...
2
votes
1
answer
78
views
Why am I getting "not a valid identifier" when trying to read a tmp file in a bash script?
I am using a bash script with some inline python to read a JSON API. I take a small part of the output and dump it into a temporary file. I know that the temporary file exists, because I am able to ...
5
votes
1
answer
120
views
Where should an application targeting Linux store temporary files that are expected to be larger than memory?
With Ubuntu 24.10 switching to a tmpfs-based (i.e. in-memory) /tmp, having a /tmp that is not usefully larger than memory, or even one that is smaller than memory, is about to become a lot more common....
-3
votes
1
answer
80
views
Why is tempfile.gettempdir() giving me the wrong path? [closed]
I have code that is trying to create a directory in my temp folder.
My code is :
temp = os.path.join(tempfile.gettempdir(), "HDD")
print(temp)
And it prints:
C:\Users\JEFFSA~1\AppData\Local\...
0
votes
1
answer
87
views
Error in file(fn, "rb") : cannot open the connection
I want to buffer some bioclimatic variables with the following code. I'm using R 4.4.1 on a windows 11 22H2 PC 64bit.
# test buffersizes
results <- lapply(buffersizes, function(buffer_distance) {
...
0
votes
0
answers
82
views
How to use django TemporaryUploadedFile multiple times?
I am trying to create several records in django from a TemporaryUploadedFile object, due to the nature of this, when wanting to create more records, I get the error [Errno 2] No such file or directory:...
0
votes
0
answers
51
views
When using dask dataframe, temporary files seem to accumulate
I aggregate data using outer join and groupby.sum with a dask dataframe, but the size of the temporary file becomes too large compared to the data.
My data size is about 50GB, but when I worked on 1/...
0
votes
1
answer
85
views
Query Students with 3 Consecutive Absences - Custom Calendar
Working on identifying students that have 3 or more consecutive absences on a custom calendar (already created) for the school year.
I have a temp table for the custom calendar here:
SELECT
cal....
0
votes
1
answer
36
views
manual tmp dir is being deleted inside jenkins agent pod
Team,
i am are running bazel and wanted to use a new dir for its cache. so created a dir using jenkins stage and it works fine. but somehow the dir is being deleted and am not sure what could be ...
0
votes
0
answers
336
views
java.nio.file.NoSuchFileException
public HttpEntity<?> card(MultipartFile multipartFile, String name) {
try {
String jsonData = String.format("{\"active\": true, \"name\": \"%s\&...
0
votes
0
answers
1k
views
Ansible failed to create temporary directory despite ansible_system_tmpdirs: "/var/tmp"
Below is my Ansible playbook and the specific task that fails:
- name: My Playbook
hosts: AppServer
gather_facts: true
become: yes
vars:
ansible_remote_tmp: "~/.ansible/tmp"
...
-1
votes
1
answer
120
views
How to setup temp directory for org.jvnet.mimepull?
I am using org.jvnet.mimepull to allow my Java app to serve the download of files. It all works perfectly until I try to download large files >4GB. Then, I got the error of java.io.IOException: No ...
1
vote
3
answers
538
views
BizTalk Server 2020 - Temp Files not getting cleaned within InProcess User Context
We are using BizTalk Server 2020 with SFTP Adapter (WinSCP Version 5.21.5).
Multiple Receive Locations and other Artefacts are running under this user.
Unfortunately our Admin contacted me that the ...
2
votes
0
answers
317
views
An unexpected ErrorOccurredinReport Processing.System.UnauthorizedAccessException: Access to thePath 'C:\Windows\TEMP\expression_host_.dll' is denied
It is a .NET web application and it is running for more than 7 years without issues. All of the sudden, while bulking printing it gives the below error.Basically, it exports 1000 plus reports in to ...
0
votes
0
answers
103
views
Using NamedTemporaryFile with Context Manager
I created a function to move tabular data from zipped outlook attachments to a dictionary object that contains the contents of all the respective data in a pandas dataframe, with the key being the ...
0
votes
0
answers
232
views
Uploading a FPDF output pdf to the s3 bucket
The error message "No such file or directory: '/tmp/tmpnj0aocz9'" indicates that the code is unable to find the temporary file that should contain the PDF content.
Does anyone have a ...
0
votes
0
answers
221
views
BadZipFile error confusion with Python zipfile library
I wrote the functions below in an attempt to extract tabular data from emailed zip file attachments and dump the contents to a pandas data frame. I used temp files to try to be efficient with resource ...
0
votes
0
answers
142
views
Matlab fails to delete temporary storage folder
I create a parpool object in the following way:
c = parcluster();
c.JobStorageLocation = storage_folder;
p = gcp('nocreate'); % If no pool, do not create new one yet.
if isempty(p)
parpool(c, ...
0
votes
1
answer
114
views
Python, cPickle dump to tempfile
I have a class:
import os
class TestClass:
def __init__(self, origin_path):
self.origin_path = origin_path
self.new_path = None
def append_path(self, new_folder):
self....
1
vote
1
answer
597
views
Create a Tempfile with lifespan as the object
I have a project where I need to create temp files.
I have a class that accepts a file path. and as needed it reads the data from the file. However, sometimes I have the data and I want to create the ...
0
votes
0
answers
1k
views
Permission denied when writing content created with PyMuPdf to temporary PDF file
I'm working on a Python script that uses the PyMuPDF library to modify a PDF document and then save the modified content to a temporary PDF file. However, I'm encountering a "Permission denied&...
1
vote
1
answer
61
views
How can I (compliantly) read from a tmpfile()?
There are questions already for "how do I get the path created by tmpfile()?" but my understanding is that the standard does not guarantee that the file created has an accessible path. So, ...