New submission from jort bloem:
When using shutil.move() between mounts (i.e. when it does a copy/delete),
running as root, ownership should be maintained.
To test: log in as root, create a file owned by a regular user. In python, use
shutil.move() to move it to another mountpoint. Check
jort bloem added the comment:
I am only new to Python, but...
Having looked at the code, I am surprised that the _TemporaryFileWrapper is not
a subclass of file. Surely that would be the python way, and would solve
this problem, too? __getattr__ would no longer be needed. The opening
New submission from jort bloem:
Issue occurs in the following code:
tempfile.NamedTemporaryFile(dir=.,delete=False).write(hello)
The NamedTemporaryFile is deleted before the write is complete; deleting the
object closes the file, so the write fails.
--
messages: 196485
nosy
jort bloem added the comment:
Sorry, my python-foo is not quite up to providing a solution. A partial
solution would be for the file not to be closed at NamedTemporaryFile
destruction, if delete==False. If delete==True, then there is no point writing
to a file (though it shouldn't raise
New submission from jort bloem:
When calling os.fork() without a tty, a process reporting the parent's pid runs
code BEFORE the fork().
When running on a tty, it behaves as expected: both parent and child continue
running from statement immediately after os.fork()
See attached test.py
jort bloem added the comment:
Try attachment again.
--
Added file: http://bugs.python.org/file29119/test.py
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17230
jort bloem added the comment:
haypo: I understand that, after a fork, parent and child instructions are run
in parallel; which one prints first is a matter of chance.
However, commands BEFORE THE FORK should not be re-run.
See test script. I would expect one Start pid, followed by a parent
jort bloem added the comment:
I agree that it is reasonable NOT to flush stdout on fork().
I don't think the outcome is reasonable.
What about voiding all buffers after the fork for the child?
--
___
Python tracker rep...@bugs.python.org
http