On 06/16/2017 01:37 PM, Alexandre Brault wrote:
So a if used directly, and a if used as a
context manager. I don't have a copy of 3.6 nor the future 3.7 handy,
so maybe it changed there?
The code in master has the context manager return `self.name`. This
behaviour has (based on looking at
On 08/06/17 15:42, Antoine Pietri wrote:
> Hello everyone!
>
> A very common pattern when dealing with temporary files is code like this:
>
> with tempfile.TemporaryDirectory() as tmpdir:
> tmp_path = tmpdir.name
>
> os.chmod(tmp_path)
> os.foobar(tmp_path)
>
On 06/08/2017 12:22 PM, Brett Cannon wrote:
Already exists, been discussed, and rejected:
https://bugs.python.org/issue29447 .
Ah, right, because the returned object is not a file path. Makes sense.
--
~Ethan~
___
Python-ideas mailing list
On Thu, 8 Jun 2017 at 08:27 Ethan Furman wrote:
> On 06/08/2017 06:42 AM, Antoine Pietri wrote:
> > Hello everyone!
> >
> > A very common pattern when dealing with temporary files is code like
> this:
> >
> > with tempfile.TemporaryDirectory() as tmpdir:
> >
On Thu, Jun 8, 2017 at 9:42 AM, Antoine Pietri
wrote:
> My proposal is to define __fspath__() for TemporaryDirectory and
> NamedTemporaryFile so that we can pass those directly to the library
> functions instead of having to use the .name attribute explicitely.
>
+1
On 06/08/2017 06:42 AM, Antoine Pietri wrote:
Hello everyone!
A very common pattern when dealing with temporary files is code like this:
with tempfile.TemporaryDirectory() as tmpdir:
tmp_path = tmpdir.name
os.chmod(tmp_path)
os.foobar(tmp_path)
Hello everyone!
A very common pattern when dealing with temporary files is code like this:
with tempfile.TemporaryDirectory() as tmpdir:
tmp_path = tmpdir.name
os.chmod(tmp_path)
os.foobar(tmp_path)
open(tmp_path).read(barquux)
PEP 519