On Sun, Apr 24, 2016 at 5:42 AM, Albert-Jan Roskam
wrote:
> Aww, I kinda forgot about that already, but I came across this last
> year [1]. Apparently, shutil.rmtree(very_long_path) failed under Win 7,
> even with the "silly prefix". I believe very_long_path was a
> Python2-str.
> [1]
> https://ma
> From: eryk...@gmail.com
> Date: Sat, 23 Apr 2016 15:22:35 -0500
> Subject: Re: Remove directory tree without following symlinks
> To: python-list@python.org
>
> On Sat, Apr 23, 2016 at 4:34 AM, Albert-Jan Roskam
> wrote:
>>
>>> From: eryk...@gmail.com
>&
On Sat, Apr 23, 2016, at 12:29, Nobody wrote:
> On Linux, an alternative is to use fchdir() rather than chdir(), which
> changes to a directory specified by an open file descriptor
Of course, then there's also the risk of running out of open file
descriptors. High-quality implementations of rm wi
On Sat, Apr 23, 2016, at 06:24, Steven D'Aprano wrote:
> "rm -r" gives me a NameError when I run it in my Python script :-)
>
> But seriously, where is that documented? I've read the man page for
> rm, and it doesn't say anything about treatment of symlinks, nor is
> there an option to follow/not
On Sat, Apr 23, 2016 at 4:34 AM, Albert-Jan Roskam
wrote:
>
>> From: eryk...@gmail.com
>> Date: Fri, 22 Apr 2016 13:28:01 -0500
>> On Fri, Apr 22, 2016 at 12:39 PM, Albert-Jan Roskam
>> wrote:
>> > FYI, Just today I found out that shutil.rmtree raises a WindowsError if
>> > the dir is read-only (
On Sat, 23 Apr 2016 00:56:33 +1000, Steven D'Aprano wrote:
> I want to remove a directory, including all files and subdirectories under
> it, but without following symlinks. I want the symlinks to be deleted, not
> the files pointed to by those symlinks.
Note that this is non-trivial to do secure
Steven D'Aprano wrote:
But seriously, where is that documented? I've read the man page for rm, and
it doesn't say anything about treatment of symlinks
The Linux man page seems to be a bit deficient on this.
The BSD version contains this sentence:
The rm utility removes symbolic links, not
On Sat, 23 Apr 2016 06:13 pm, Paul Rubin wrote:
> Steven D'Aprano writes:
>> I want to remove a directory, including all files and subdirectories
>> under it, but without following symlinks. I want the symlinks to be
>> deleted, not the files pointed to by those symlinks.
>
> rm -r shouldn't fol
> From: eryk...@gmail.com
> Date: Fri, 22 Apr 2016 13:28:01 -0500
> Subject: Re: Remove directory tree without following symlinks
> To: python-list@python.org
>
> On Fri, Apr 22, 2016 at 12:39 PM, Albert-Jan Roskam
> wrote:
> > FYI, Just today I found out
Steven D'Aprano writes:
> I want to remove a directory, including all files and subdirectories under
> it, but without following symlinks. I want the symlinks to be deleted, not
> the files pointed to by those symlinks.
rm -r shouldn't follow symlinks like you mention.
--
https://mail.python.org
On Fri, Apr 22, 2016 at 12:39 PM, Albert-Jan Roskam
wrote:
> FYI, Just today I found out that shutil.rmtree raises a WindowsError if the
> dir is read-
> only (or its contents). Using 'ignore_errors', won't help. Sure, no error is
> raised, but the
> dir is not deleted either! A 'force' option w
> From: st...@pearwood.info
> Subject: Re: Remove directory tree without following symlinks
> Date: Sat, 23 Apr 2016 03:14:12 +1000
> To: python-list@python.org
>
> On Sat, 23 Apr 2016 01:09 am, Random832 wrote:
>
> > On Fri, Apr 22, 2016, at 10:56, Steven D'
On Sat, 23 Apr 2016 01:09 am, Random832 wrote:
> On Fri, Apr 22, 2016, at 10:56, Steven D'Aprano wrote:
>> What should I use for "remove_tree"? Do I have to write my own, or does a
>> solution already exist?
>
> In the os.walk documentation it provides a simple recipe and also
> mentions shutil.r
On Fri, Apr 22, 2016, at 10:56, Steven D'Aprano wrote:
> What should I use for "remove_tree"? Do I have to write my own, or does a
> solution already exist?
In the os.walk documentation it provides a simple recipe and also
mentions shutil.rmtree
--
https://mail.python.org/mailman/listinfo/python-
14 matches
Mail list logo