Re: [Python-ideas] Was `os.errno` undocumented?

2018-05-29 Thread Steve Barnes
On 29/05/2018 23:58, Guido van Rossum wrote: > Have we received complaints about other cases? Whenever this  breaks > code for which I am responsible I just blush and fix it, I don't > complain. Repeating the same warning typically just causes warning > fatigue rather than helping anyone. >

Re: [Python-ideas] Add shutil.chown(..., recursive=False)

2018-05-29 Thread Chris Angelico
On Wed, May 30, 2018 at 9:11 AM, Greg Ewing wrote: > BTW, I wouldn't argue that Python shouldn't provide things > that are only useful to root. While writing setuid utilities > in Python is a bad idea for lots of reasons, I don't think > there's anything wrong with becoming root by another means

Re: [Python-ideas] Was `os.errno` undocumented?

2018-05-29 Thread Terry Reedy
On 5/29/2018 6:06 AM, Petr Viktorin wrote: Python 3.7 removes the undocumented internal import `os.errno`. Among a couple of hundred others, including some from idlelib. We consider that a an implementation detail, which can be changed *without notice* even in a bugfix release. We core

Re: [Python-ideas] Add shutil.chown(..., recursive=False)

2018-05-29 Thread Greg Ewing
BTW, I wouldn't argue that Python shouldn't provide things that are only useful to root. While writing setuid utilities in Python is a bad idea for lots of reasons, I don't think there's anything wrong with becoming root by another means and then running a Python program that you know well enough

Re: [Python-ideas] Add shutil.chown(..., recursive=False)

2018-05-29 Thread Greg Ewing
Steven D'Aprano wrote: Look closely at my example: the file ownership recursively changed from steve.steve to steve.users. You're quite right. I hadn't realised that chown can be used to change the group as well as the user. It's permitted to change the group to one that the user is a member

Re: [Python-ideas] Was `os.errno` undocumented?

2018-05-29 Thread Guido van Rossum
Have we received complaints about other cases? Whenever this breaks code for which I am responsible I just blush and fix it, I don't complain. Repeating the same warning typically just causes warning fatigue rather than helping anyone. On Tue, May 29, 2018 at 3:53 PM, Terry Reedy wrote: > On

Re: [Python-ideas] Was `os.errno` undocumented?

2018-05-29 Thread Terry Reedy
On 5/29/2018 12:09 PM, Guido van Rossum wrote: Yes. What Steve says at the end. Let's be kind and mention this one on the release notes. But not all the others. How about adding a general reminder. In Porting to 3.7: "Imports into a module are a private implementation detail unless otherwise

Re: [Python-ideas] Mashup the existing statement grammars to capture predicates

2018-05-29 Thread Carl Smith
Ah. Nice one. I'll look through that. -- Carl Smith carl.in...@gmail.com On 29 May 2018 at 19:52, Chris Angelico wrote: > On Wed, May 30, 2018 at 4:48 AM, Carl Smith wrote: > > Nah?? > > Nah. It's already been discussed at interminable length as part of PEP > 572. Feel free to browse that

Re: [Python-ideas] shutil zero-copy and exotic filesystems

2018-05-29 Thread Eric Fahlgren
On Tue, May 29, 2018 at 10:17 AM Barry Scott wrote: > On Tuesday, 29 May 2018 16:42:13 BST Eric Fahlgren wrote: > > Maybe you are suffering from TCP windows scaling not work well enough? > Thanks for the tip, I'll have to mention that to our IT infrastructure guys and see if they can check it

Re: [Python-ideas] Mashup the existing statement grammars to capture predicates

2018-05-29 Thread Chris Angelico
On Wed, May 30, 2018 at 4:48 AM, Carl Smith wrote: > Nah?? Nah. It's already been discussed at interminable length as part of PEP 572. Feel free to browse that document. ChrisA ___ Python-ideas mailing list Python-ideas@python.org

Re: [Python-ideas] Mashup the existing statement grammars to capture predicates

2018-05-29 Thread Carl Smith
Nah?? -- Carl Smith carl.in...@gmail.com On 24 May 2018 at 19:24, Carl Smith wrote: > This is another suggestion for new syntax for assigning a name to the value > of the predicate in an if, elif or while statement. It still uses `as` for > its keyword, but with (more flexible) params instead

Re: [Python-ideas] shutil zero-copy and exotic filesystems

2018-05-29 Thread Barry Scott
On Tuesday, 29 May 2018 16:42:13 BST Eric Fahlgren wrote: snip... > On our WAN, which has a VPN endpoint 3000 miles from our office, routing > back to a test server another 2000 miles inside the network (tracert shows > 12-15 hops, 200 ms latency, arrrg), copying is slow no matter what: we are >

Re: [Python-ideas] Add shutil.chown(..., recursive=False)

2018-05-29 Thread Guido van Rossum
Honestly, despite the occasional use case(1), I'm not sure that this is a battery we need in the stdlib. Nobody seems too excited about writing the code, and when the operation is needed, shelling out to the system chown is not too onerous. (Ditto for chmod.) (1) Not even sure that a use case was

Re: [Python-ideas] Was `os.errno` undocumented?

2018-05-29 Thread Guido van Rossum
Yes. What Steve says at the end. Let's be kind and mention this one on the release notes. But not all the others. On Tue, May 29, 2018, 07:57 Steven D'Aprano wrote: > On Tue, May 29, 2018 at 05:37:06PM +0300, Serhiy Storchaka wrote: > > > We have removed over 100 module attributes in 3.6 [2]

Re: [Python-ideas] shutil zero-copy and exotic filesystems

2018-05-29 Thread Eric Fahlgren
I have been doing speed testing on our network frequently enough over the last five year that I have a good feel for these changes. I have been benchmarking various means for copying files of 1.0-500 MB between workstations on our 1 Gbps LAN to local servers, and on our WAN which was just

Re: [Python-ideas] Was `os.errno` undocumented?

2018-05-29 Thread Steven D'Aprano
On Tue, May 29, 2018 at 05:37:06PM +0300, Serhiy Storchaka wrote: > We have removed over 100 module attributes in 3.6 [2] and over 200 > module attributes in 3.7 [3]. > > Some of these removals broke third-part projects [4], even removals of > underscored names. Yes, people will rely on

Re: [Python-ideas] Was `os.errno` undocumented?

2018-05-29 Thread Serhiy Storchaka
29.05.18 13:06, Petr Viktorin пише: As you can see, the built-in documentation does not contain *any* warnings against using `os.errno`. You might think the fact that it's called "errno" and not "os.errno" is a red flag, but it's not, really -- "os.path" is (on my system) named "posixpath",

Re: [Python-ideas] Was `os.errno` undocumented?

2018-05-29 Thread Nick Coghlan
On 29 May 2018 at 20:06, Petr Viktorin wrote: > Is that reasoning sound? > Should our policy on removing internal imports take that into account? > As Steven noted, the normative answer to this is in PEP 8: https://www.python.org/dev/peps/pep-0008/#public-and-internal-interfaces Since

Re: [Python-ideas] Add shutil.chown(..., recursive=False)

2018-05-29 Thread Nick Coghlan
On 29 May 2018 at 06:23, Giampaolo Rodola' wrote: > ...as in (not tested): > > def _rchown(dir, user, group): > for root, dirs, files in os.walk(dir, topdown=False): > for name in files: > chown(os.path.join(root, name), user, group) > > def

Re: [Python-ideas] Was `os.errno` undocumented?

2018-05-29 Thread INADA Naoki
> I agree that it's technically well within our rights to remove it > without notice. > But ... PEP8? A style guide defines what is a CPython implementation > detail? That's not a place to point to while saying "told you so!" -- > perhaps "sorry for the inconvenience" would be more appropriate :)

Re: [Python-ideas] Was `os.errno` undocumented?

2018-05-29 Thread Petr Viktorin
(Apologies if you received an empty/unfinished e-mail here earlier; I hit Send by mistake.) On 05/29/18 13:57, Steven D'Aprano wrote: On Tue, May 29, 2018 at 12:06:42PM +0200, Petr Viktorin wrote: Hello, Python 3.7 removes the undocumented internal import `os.errno`. We consider that a an

Re: [Python-ideas] Was `os.errno` undocumented?

2018-05-29 Thread Petr Viktorin
On 05/29/18 13:57, Steven D'Aprano wrote: On Tue, May 29, 2018 at 12:06:42PM +0200, Petr Viktorin wrote: Hello, Python 3.7 removes the undocumented internal import `os.errno`. We consider that a an implementation detail, which can be changed *without notice* even in a bugfix release. Projects

Re: [Python-ideas] Was `os.errno` undocumented?

2018-05-29 Thread Steven D'Aprano
On Tue, May 29, 2018 at 12:06:42PM +0200, Petr Viktorin wrote: > Hello, > Python 3.7 removes the undocumented internal import `os.errno`. > We consider that a an implementation detail, which can be changed > *without notice* even in a bugfix release. Projects that depend on it > are incorrect

Re: [Python-ideas] Was `os.errno` undocumented?

2018-05-29 Thread Chris Angelico
On Tue, May 29, 2018 at 8:06 PM, Petr Viktorin wrote: > I don't think we can reasonably expect people who used built-in help as > above to go back and check that Python's official docs *do not* contain > `os.errno`. Effectively, while `os.errno` is not very *discoverable* using > official docs

Re: [Python-ideas] shutil zero-copy and exotic filesystems

2018-05-29 Thread Giampaolo Rodola'
Whops, I hit "send" too soon. Sorry about the messed up message. On Tue, May 29, 2018 at 10:56 AM, Giampaolo Rodola' wrote: > Hello, > I've been working on a patch which speeds up shutil.copy* operations for > all 3 major platforms (Linux, Windows, OSX): > https://bugs.python.org/issue33671 >

[Python-ideas] shutil zero-copy and exotic filesystems

2018-05-29 Thread Giampaolo Rodola'
Hello, I've been working on a patch which speeds up shutil.copy* operations for all 3 major platforms (Linux, Windows, OSX): https://bugs.python.org/issue33671 Since the speedup is quite consistent I'd love to see this merged in, but considering shutil.copy* is quite crucial I wanted to hear other

Re: [Python-ideas] Add shutil.chown(..., recursive=False)

2018-05-29 Thread Steven D'Aprano
On Tue, May 29, 2018 at 06:29:50PM +1200, Greg Ewing wrote: > Steven D'Aprano wrote: > >But it doesn't matter: regular users can call chown -R: > > Only if you're not actually telling it to change anything. That's not correct. Look closely at my example: the file ownership recursively changed

Re: [Python-ideas] Add shutil.chown(..., recursive=False)

2018-05-29 Thread Greg Ewing
Steven D'Aprano wrote: But it doesn't matter: regular users can call chown -R: Only if you're not actually telling it to change anything. % ls -l foo.txt -rw-r--r-- 1 greg users 1 29 May 18:19 foo.txt % chown greg foo.txt % chown fred foo.txt chown: foo.txt: Operation not permitted So you