[issue25779] deadlock with asyncio+contextmanager+ExitStack

2015-12-02 Thread Guido van Rossum
Guido van Rossum added the comment: Interestingly, it doesn't hang when you raise a different error. There's some new code dealing with the RuntimeError coming out of a generator if it raises StopIteration (instead of returning) introduced by issue #22906. Yury, it looks like you

[issue25782] CPython hangs on error __context__ set to the error itself

2015-12-02 Thread Guido van Rossum
Guido van Rossum added the comment: Ouch, it's unfortunate those APIs don't have an error return. :-( Setting it to NULL is one option -- silently ignoring the assignment (leaving whatever was there) might also be good? In 90% of the cases it would be the same thing right? (I'

[issue25782] CPython hangs on error __context__ set to the error itself

2015-12-02 Thread Guido van Rossum
Guido van Rossum added the comment: > But leaving the old __context__ there will completely mask the bug... OK, NULL is fine then. >we better raise a TypeError if a cycle is about to be introduced? Yes. -- ___ Python tracker <http://bugs.p

[issue25610] Add typing.Awaitable

2015-12-06 Thread Guido van Rossum
Guido van Rossum added the comment: Fixed by e9aeae1b2ea9 in 3.5, ad855c779bf3 in 3.6.] -- versions: +Python 3.5 ___ Python tracker <http://bugs.python.org/issue25

[issue19475] Add timespec optional flag to datetime isoformat() to choose the precision

2015-12-15 Thread Guido van Rossum
Guido van Rossum added the comment: I like the idea. I have one suggestion: can we add 'milliseconds' as an option too? And might a well add 'nanoseconds' too, for future-proofing. I suppose there isn't a real use case for 'hours' but it seems silly to le

[issue19475] Add timespec optional flag to datetime isoformat() to choose the precision

2015-12-15 Thread Guido van Rossum
Guido van Rossum added the comment: Actually, nanosecond = dt.microsecond*1000. I don't think we need 'none' -- you should just extract the date component and call its isoformat() method if that's what you want. On Tue, Dec 15, 2015 at 12:01 PM, Alexander Belopolsky <

[issue25610] Add typing.Awaitable

2015-12-15 Thread Guido van Rossum
Guido van Rossum added the comment: Yes. (There's a corresponding issue for the typehinting repo that's still open because the tests need to be segregated into Python-3.5-only tests and tests for Python 3.3-3.4). -- assignee: -> gvanrossum resolution: -> fixed status

[issue25888] awaiting on coroutine that is being awaited should be an error

2015-12-16 Thread Guido van Rossum
Guido van Rossum added the comment: Right. -- ___ Python tracker <http://bugs.python.org/issue25888> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue25887] awaiting on coroutine more than once should be an error

2015-12-16 Thread Guido van Rossum
Guido van Rossum added the comment: OK, but only for await (not for yield from). -- ___ Python tracker <http://bugs.python.org/issue25887> ___ ___ Python-bug

[issue25887] awaiting on coroutine more than once should be an error

2015-12-16 Thread Guido van Rossum
Guido van Rossum added the comment: PEP 492 is provisional, we can change things like this in 3.5.2. On Wed, Dec 16, 2015 at 3:48 PM, Martin Panter wrote: > > Martin Panter added the comment: > > It should always be valid to create a new coroutine instance. Perhaps you > mean

[issue22429] asyncio: pending call to loop.stop() if a coroutine raises a BaseException

2015-12-19 Thread Guido van Rossum
Guido van Rossum added the comment: FWIW I think this is now fixed differently, because we reimplemented stop() to use a flag on the loop that's checked by _run_once(), rather than raising an exception. _run_until_complete_cb() can be reduced to simply call fut._loop.stop(). (At least

[issue23846] asyncio : ProactorEventLoop raised BlockingIOError when ThreadPoolExecutor has many workers

2015-12-22 Thread Guido van Rossum
Guido van Rossum added the comment: Why are you using 2 threads? --Guido (mobile) On Dec 22, 2015 02:03, "Joseph Gordon" wrote: > > Changes by Joseph Gordon : > > > -- > nosy: +josephgordon > > ___ > Pyth

[issue25599] asyncio.iscoroutinefunction returns unexpected results when presented with unittest.mock.Mock

2015-12-22 Thread Guido van Rossum
Guido van Rossum added the comment: Oh dang. We were waiting for the OP to submit a patch (not very complex) but they never did. Now we missed the 3.5.2 deadline. Maybe someone can try again for 3.5.3? On Tue, Dec 22, 2015 at 12:30 AM, Joseph Gordon wrote: > > Changes by Joseph

[issue25599] asyncio.iscoroutinefunction returns unexpected results when presented with unittest.mock.Mock

2015-12-22 Thread Guido van Rossum
Guido van Rossum added the comment: No I just misremembered. --Guido (mobile) -- ___ Python tracker <http://bugs.python.org/issue25599> ___ ___ Python-bugs-list m

[issue25936] Improve FastChildWatcher with WNOWAIT?

2015-12-25 Thread Guido van Rossum
Guido van Rossum added the comment: Hm... Looks like this wouldn't work unless we also implemented the waitid() (note: 'id', not 'pid') syscall, as waitpid() doesn't support this flag (e.g. https://bugzilla.red

[issue25936] Improve FastChildWatcher with WNOWAIT?

2015-12-25 Thread Guido van Rossum
Guido van Rossum added the comment: Oh, hm, we do seem to have os.waitid() but not on OS X... Well that makes producing a reasonable patch much more complicated. Maybe you want to add a 3rd ChildWatcher just for Linux (or just for platforms that have os.waitid)? (If so, please submit a PR to

[issue25864] collections.abc.Mapping should include a __reversed__ that raises TypeError

2015-12-26 Thread Guido van Rossum
Guido van Rossum added the comment: This sounds good. Also, reversed() could then be modified to produce a better error. (The "unhashable" error comes from the hash() builtin, so that's also a precedent.) On Sat, Dec 26, 2015 at 4:32 PM, Andrew Barnert wrote: > > And

[issue25864] collections.abc.Mapping should include a __reversed__ that raises TypeError

2015-12-26 Thread Guido van Rossum
Guido van Rossum added the comment: All sounds fine. -- ___ Python tracker <http://bugs.python.org/issue25864> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue25609] Add a ContextManager ABC and type

2016-01-03 Thread Guido van Rossum
Guido van Rossum added the comment: The abstract base class would be an ABC providing documentation and a template for implementations, and a way to test using isinstance(). This is how several other ABCs are used that have no particularly useful default implementation. In addition, the

[issue25958] Implicit ABCs have no means of "anti-registration"

2016-01-04 Thread Guido van Rossum
Guido van Rossum added the comment: I propose to solve the narrow problem by indeed supporting the setting of certain special methods to None similar to __hash__. This should be limited to those methods for which this adds value, e.g. where the complete absence of the method causes a fall

[issue25864] collections.abc.Mapping should include a __reversed__ that raises TypeError

2016-01-04 Thread Guido van Rossum
Guido van Rossum added the comment: I think I tried to address all questions in #25958. -- ___ Python tracker <http://bugs.python.org/issue25864> ___ ___ Pytho

[issue25864] collections.abc.Mapping should include a __reversed__ that raises TypeError

2016-01-04 Thread Guido van Rossum
Guido van Rossum added the comment: Agreed that improving the docs doesn't belong in this bug, but in general if the docs aren't clear enough and only a visit to the source helps you understand, something's wrong. Because the source may do things one way today and be chang

[issue25988] collections.abc.Indexable

2016-01-04 Thread Guido van Rossum
Guido van Rossum added the comment: Interesting. I just hope the name doesn't confuse people into connecting this with the Index type (a type of integer that can't be cast from float). -- nosy: +gvanrossum ___ Python tracker <http://bu

[issue25987] collections.abc.Reversible

2016-01-04 Thread Guido van Rossum
Guido van Rossum added the comment: Yes please. Thanks for thinking about all the edge cases here! -- nosy: +gvanrossum ___ Python tracker <http://bugs.python.org/issue25

[issue25958] Implicit ABCs have no means of "anti-registration"

2016-01-04 Thread Guido van Rossum
Guido van Rossum added the comment: I like all of that. Thanks! -- ___ Python tracker <http://bugs.python.org/issue25958> ___ ___ Python-bugs-list mailin

[issue22062] Fix pathlib.Path.(r)glob doc glitches.

2016-01-04 Thread Guido van Rossum
Guido van Rossum added the comment: Classifying as easy doc bug. -- assignee: -> docs@python components: +Documentation keywords: +easy nosy: +docs@python, gvanrossum ___ Python tracker <http://bugs.python.org/issu

[issue24120] pathlib.(r)glob stops on PermissionDenied exception

2016-01-04 Thread Guido van Rossum
Guido van Rossum added the comment: I just ran into this issue. What's keeping it from being committed, except perhaps that Antoine decided to leave core developments? -- nosy: +gvanrossum ___ Python tracker <http://bugs.python.org/is

[issue26012] pathlib.Path().rglob() is fooled by symlink loops

2016-01-04 Thread Guido van Rossum
Changes by Guido van Rossum : -- components: +Library (Lib) ___ Python tracker <http://bugs.python.org/issue26012> ___ ___ Python-bugs-list mailing list Unsub

[issue26012] pathlib.Path().rglob() is fooled by symlink loops

2016-01-04 Thread Guido van Rossum
New submission from Guido van Rossum: I created a symlink loop as follows: mkdir tmp cd tmp ln -s ../tmp baz cd .. Then I tried to list it recursively using rglob(): >>> list(pathlib.Path('tmp').rglob('**/*') This caused an infinite regress: Traceback (most recen

[issue26012] pathlib.Path().rglob() is fooled by symlink loops

2016-01-04 Thread Guido van Rossum
Guido van Rossum added the comment: I agree it's easiest just not to traverse symlinks matching **. glob.py avoids the errors (but not the senseless recursion) by simply ignoring OSError coming out of listdir(). That might be a good idea anyways (it might even be a simpler way to avoi

[issue25958] Implicit ABCs have no means of "anti-registration"

2016-01-05 Thread Guido van Rossum
Guido van Rossum added the comment: I'm regenerating the patch in the hope that it will trigger the code review hook. -- Added file: http://bugs.python.org/file41508/abarnert-patch-regenerated.diff ___ Python tracker <http://bugs.py

[issue25958] Implicit ABCs have no means of "anti-registration"

2016-01-05 Thread Guido van Rossum
Guido van Rossum added the comment: FWIW, Martin's review was much more extensive. I'm looking forward to the flat version of your next patch, Andrew! -- ___ Python tracker <http://bugs.python.o

[issue25958] Implicit ABCs have no means of "anti-registration"

2016-01-05 Thread Guido van Rossum
Guido van Rossum added the comment: In response to Serhiy's comment regarding __copy__ etc.: while the distinction is somewhat unfortunate, I think it's too late to make this more consistent. I think it's fine that the special methods used by copy and pickle protocols behave somew

[issue25637] Move non-collections-related ABCs out of collections.abc

2016-01-05 Thread Guido van Rossum
Guido van Rossum added the comment: Honestly I think this such a slippery slope that I prefer keeping them in collections.abc. The main reason that we have Iterable and Iterator is that they are closely related to real collections (e.g. Sequence, Set, Mapping). And generators are related to

[issue25958] Implicit ABCs have no means of "anti-registration"

2016-01-05 Thread Guido van Rossum
Guido van Rossum added the comment: The idea of using NotImplemented was already discussed (IIR in python-ideas). I really don't like it. -- ___ Python tracker <http://bugs.python.org/is

[issue25958] Implicit ABCs have no means of "anti-registration"

2016-01-05 Thread Guido van Rossum
Guido van Rossum added the comment: No. Simply No. Nobody will be able to remember which means which. -- ___ Python tracker <http://bugs.python.org/issue25

[issue25637] Move non-collections-related ABCs out of collections.abc

2016-01-05 Thread Guido van Rossum
Guido van Rossum added the comment: I think ContextManager should be in contextlib. I don't want to put anything in functools. Coroutine doesn't belong in asyncio, it's more fundamental (closely related to Generator). -- ___ Python

[issue22268] add dedicated functions mrohasattr and mrogetattr

2016-01-05 Thread Guido van Rossum
Guido van Rossum added the comment: Honestly I don't think this is worth it. The proposed functions seem to fall firmly in the territory of "not every three useful lines of code are worth a stdlib function". -- nosy: +gvanrossum ___

[issue25966] Bug in asyncio.corotuines._format_coroutine

2016-01-05 Thread Guido van Rossum
Changes by Guido van Rossum : -- assignee: -> gvanrossum resolution: -> fixed ___ Python tracker <http://bugs.python.org/issue25966> ___ ___ Python-bugs-

[issue25966] Bug in asyncio.corotuines._format_coroutine

2016-01-05 Thread Guido van Rossum
Guido van Rossum added the comment: Thanks! I've fixed this in the git repo now (https://github.com/python/asyncio/commit/0c3e6ec0340f45d5f6989391358d44b8e974858e). It will be merged into the CPython repo at the next opportunity (before

[issue22570] Better stdlib support for Path objects

2016-01-05 Thread Guido van Rossum
Guido van Rossum added the comment: Random idea: what if pathlib.Path defined a .path attribute that was a plain string? Then you could write p.path instead of str(p), and "if hasattr(p, 'path'): p = p.path". This would be the new protocol. Advantage is also that DirEntry

[issue23076] list(pathlib.Path().glob("")) fails with IndexError

2016-01-05 Thread Guido van Rossum
Guido van Rossum added the comment: This should be easy to fix. It should raise ValueError. -- keywords: +easy nosy: +gvanrossum versions: +Python 3.6 ___ Python tracker <http://bugs.python.org/issue23

[issue22558] Missing hint to source code - complete

2016-01-05 Thread Guido van Rossum
Guido van Rossum added the comment: Actually uploading a patch for this should be easy, right? -- keywords: +easy nosy: +gvanrossum ___ Python tracker <http://bugs.python.org/issue22

[issue22558] Missing hint to source code - complete

2016-01-05 Thread Guido van Rossum
Guido van Rossum added the comment: It's fine to add a source link to any module for which there is Python source code. I suppose this adds a slight maintenance burden when a module moves (e.g. when a module is turned into a package, or when the subdirectory structure of the Lib dire

[issue22570] Better stdlib support for Path objects

2016-01-06 Thread Guido van Rossum
Guido van Rossum added the comment: I think it's actually very reasonable for a Path to have a path attribute that's a string. The DirEntry has two string attributes: name (the last component) and path (the full path). The Path object already has the former. Adding the latter makes s

[issue24120] pathlib.(r)glob stops on PermissionDenied exception

2016-01-06 Thread Guido van Rossum
Guido van Rossum added the comment: I'm just going to commit this. -- assignee: -> gvanrossum ___ Python tracker <http://bugs.python.org/issue24120> ___ _

[issue26012] pathlib.Path().rglob() is fooled by symlink loops

2016-01-06 Thread Guido van Rossum
Guido van Rossum added the comment: I'm going to fix this by skipping all symlinks in _RecursiveWildcardSelector. -- assignee: -> gvanrossum ___ Python tracker <http://bugs.python.org

[issue22570] Better stdlib support for Path objects

2016-01-06 Thread Guido van Rossum
Guido van Rossum added the comment: Only if we changed DirEntry to support that too. But it's a kind of high-falootin' word that also has some other connotations (e.g. geographical location, and the HTTP Location header). I've never heard it use in relation to filenames -- those

[issue24120] pathlib.(r)glob stops on PermissionDenied exception

2016-01-06 Thread Guido van Rossum
Changes by Guido van Rossum : -- resolution: -> fixed status: open -> closed ___ Python tracker <http://bugs.python.org/issue24120> ___ ___ Python-bugs-

[issue26012] pathlib.Path().rglob() is fooled by symlink loops

2016-01-06 Thread Guido van Rossum
Changes by Guido van Rossum : -- resolution: -> fixed stage: -> resolved status: open -> closed type: -> behavior ___ Python tracker <http://bugs.python

[issue22570] Better stdlib support for Path objects

2016-01-06 Thread Guido van Rossum
Guido van Rossum added the comment: OK, I'll add 'path' to unblock changes to the stdlib (but I won't close this issue). -- ___ Python tracker <http://bug

[issue22570] Better stdlib support for Path objects

2016-01-06 Thread Guido van Rossum
Guido van Rossum added the comment: So, I added docs, mentioning the getattr(arg, 'path', arg) idiom, and (for 3.5 and 3.6) also cross-referencing with DirEntry. I'm not sure whether to now close this issue or whether to leave it open to remind people of adding patches using t

[issue25958] Implicit ABCs have no means of "anti-registration"

2016-01-06 Thread Guido van Rossum
Guido van Rossum added the comment: Uploading a flattened version of patch3.diff. -- Added file: http://bugs.python.org/file41519/patch3-regenerated.diff ___ Python tracker <http://bugs.python.org/issue25

[issue25958] Implicit ABCs have no means of "anti-registration"

2016-01-06 Thread Guido van Rossum
Guido van Rossum added the comment: FWIW, it looks fine to me -- but I'm hoping to get Serhiy's agreement first. Serhiy: feel free to commit when you're happy. -- ___ Python tracker <http://bugs.pyt

[issue26019] collections.abc documentation incomplete

2016-01-06 Thread Guido van Rossum
Guido van Rossum added the comment: LGTM. Do you want me to commit it now or wait until you've redone it after #25958 has gone through? -- nosy: +gvanrossum ___ Python tracker <http://bugs.python.org/is

[issue22570] Better stdlib support for Path objects

2016-01-06 Thread Guido van Rossum
Guido van Rossum added the comment: Let's say that the path attribute should be str or bytes -- this matches the behavior of DirEntry. (But for pathlib.Path it is always a str.) It cannot be None or FD. But note that the getattr(x, 'path', x) idiom returns x unchanged if x is None

[issue26031] Add stat caching option to pathlib

2016-01-06 Thread Guido van Rossum
New submission from Guido van Rossum: There are concerns that pathlib is inefficient because it doesn't cache stat() operations. Thus, for example this code calls stat() for each result twice (once internal to the glob, a second time to answer the is_symlink() question): p = pathlib

[issue26032] Use scandir() to speed up pathlib globbing

2016-01-06 Thread Guido van Rossum
Changes by Guido van Rossum : -- nosy: +pitrou ___ Python tracker <http://bugs.python.org/issue26032> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue26032] Use scandir() to speed up pathlib globbing

2016-01-06 Thread Guido van Rossum
New submission from Guido van Rossum: The globbing functionality in pathlib (Path.glob() and Path.rglob()) might benefit from using the new optimized os.scandir() interface. It currently just uses os.listdir(). The Path.iterdir() method might also benefit (though less so). There's a

[issue26031] Add stat caching option to pathlib

2016-01-06 Thread Guido van Rossum
Guido van Rossum added the comment: That's fair, though I don't know what kind of caching design was considered (until Ram's suggestion on python-ideas I had thought the cache would simply use a slot on the Path instance to hold the stat() result). If we want pathlib to become p

[issue25596] regular files handled as directories in the glob module

2016-01-06 Thread Guido van Rossum
Guido van Rossum added the comment: (IOW once this patch has been applied maybe you can do the same for globbing in pathlib as requested in issue #26032.) -- nosy: +gvanrossum ___ Python tracker <http://bugs.python.org/issue25

[issue26032] Use scandir() to speed up pathlib globbing

2016-01-06 Thread Guido van Rossum
Guido van Rossum added the comment: The DirEntry docs say for most methods "In most cases, no system call is required" which is pretty non-committal. :-( The only firm promise is for inode(), which is pretty useless. -- ___ Python trac

[issue26032] Use scandir() to speed up pathlib globbing

2016-01-06 Thread Guido van Rossum
Guido van Rossum added the comment: Ben, I think it's worth calling out what the rules are around symlinks. I'm guessing the info that is initially present is a subset of lstat(), so if that indicates it's a symlink, is_dir() and is_file() will need a stat() call, *unless* fol

[issue26012] pathlib.Path().rglob() is fooled by symlink loops

2016-01-07 Thread Guido van Rossum
Guido van Rossum added the comment: Oops, sorry about that. I will see if I can figure out how to repro this -- on my own Mac it succeeds. In the mean time if you could have a look yourself (since you can repro it on your own computer) I'd be grateful. Initial hunches: maybe a

[issue26012] pathlib.Path().rglob() is fooled by symlink loops

2016-01-07 Thread Guido van Rossum
Guido van Rossum added the comment: Should be fixed for real now. -- status: open -> closed ___ Python tracker <http://bugs.python.org/issue26012> ___ ___ Py

[issue26012] pathlib.Path().rglob() is fooled by symlink loops

2016-01-07 Thread Guido van Rossum
Guido van Rossum added the comment: I think I understand the Windows failure. I uncommented some tests that were previously broken due to the symlink loop and/or PermissionError, but one of these has a different expected outcome if symlinks don't work. I've pushed a hopeful fix fo

[issue26012] pathlib.Path().rglob() is fooled by symlink loops

2016-01-07 Thread Guido van Rossum
Guido van Rossum added the comment: Looks like that Windows buildbot is now green. Of the stable bots only OpenIndiana is red, and it's unrelated. -- ___ Python tracker <http://bugs.python.org/is

[issue26045] Improve error message for http.client when posting unicode string

2016-01-07 Thread Guido van Rossum
Changes by Guido van Rossum : -- nosy: +gvanrossum ___ Python tracker <http://bugs.python.org/issue26045> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue19251] bitwise ops for bytes of equal length

2016-01-07 Thread Guido van Rossum
Guido van Rossum added the comment: I'm very skeptical of this. I expect it would cause quite a few surprises for people who aren't used to bitmask operations on integers, let alone on (byte) strings. -- nosy: +gvanrossum ___ Python trac

[issue26045] Improve error message for http.client when posting unicode string

2016-01-07 Thread Guido van Rossum
Guido van Rossum added the comment: Any solution that encodes Unicode in a way that works for some characters but fails for others has the same problem that Unicode had in Python 3. Unfortunately we're stuck with such a solution (Latin-1) and for backwards compatibility reasons we

[issue26045] Improve error message for http.client when posting unicode string

2016-01-08 Thread Guido van Rossum
Guido van Rossum added the comment: Here's a patch. I noticed there are lots of other places where a similar encoding() call exists -- I wrapped them all using a helper function. Please review carefully. -- keywords: +patch Added file: http://bugs.python.org/file41537/utfpatch

[issue26045] Improve error message for http.client when posting unicode string

2016-01-08 Thread Guido van Rossum
Guido van Rossum added the comment: BTW the error and traceback will look something like this: Traceback (most recent call last): File "", line 1, in File "/Users/guido/src/cpython/Lib/http/client.py", line 1138, in _send_request self.putheader(hdr, value) Fi

[issue26045] Improve error message for http.client when posting unicode string

2016-01-08 Thread Guido van Rossum
Guido van Rossum added the comment: I think this would be okay for 3.5.2 as well. -- versions: +Python 3.5 ___ Python tracker <http://bugs.python.org/issue26

[issue26045] Improve error message for http.client when posting unicode string

2016-01-08 Thread Guido van Rossum
Guido van Rossum added the comment: Martin, please make a patch along those lines! The only reason I generalized this to headers is that one of the three Requests issues referenced in the original post seemed to be about a header value (https://github.com/kennethreitz/requests/issues/1926

[issue26068] re.compile() repr end quote truncated

2016-01-09 Thread Guido van Rossum
Guido van Rossum added the comment: It's simply the effect of the "%.200R" format here: https://hg.python.org/cpython/file/default/Modules/_sre.c#l1417 I recommend not bothering to fix this: it would just be more code, and to what end? -- no

[issue26068] re.compile() repr end quote truncated

2016-01-09 Thread Guido van Rossum
Guido van Rossum added the comment: Yes, the C code pretty much always uses %., in order to protect itself from buffer overflows. Pulling off an unabbreviated str() here would be a major piece of work. -- ___ Python tracker <http://bugs.python.

[issue26068] re.compile() repr end quote truncated

2016-01-09 Thread Guido van Rossum
Guido van Rossum added the comment: That would be an interesting exercise. You'd have to patch PyUnicode_FromFormat(). It would be nice to have this. It should probably also insert some dots (the universal sign to indicate that something was trun

[issue22570] Better stdlib support for Path objects

2016-01-10 Thread Guido van Rossum
Guido van Rossum added the comment: Using 'path' for this field is not a misnomer (example: DictEntry uses 'path' for the same field). See issue #26027 for a follow-up idea. -- dependencies: -Support Path objects in the posix module resolution: -> fixed sta

[issue26075] typing.Union unifies types too broadly

2016-01-10 Thread Guido van Rossum
Guido van Rossum added the comment: Oh, this is yet another reason to finally rip out the issubclass() support... We're tracking that at https://github.com/ambv/typehinting/issues/136 In the meantime, just don't do this! -- ___ Pyth

[issue22570] Better stdlib support for Path objects

2016-01-10 Thread Guido van Rossum
Guido van Rossum added the comment: You can't win 'em all... :-) -- ___ Python tracker <http://bugs.python.org/issue22570> ___ ___ Python-bugs-l

[issue25596] regular files handled as directories in the glob module

2016-01-10 Thread Guido van Rossum
Guido van Rossum added the comment: @serhiy, I assume this is in your capable hands? Personally I'd like to have seen the refactoring in a separate diff from the switch to scandir(), just to ensure that the refactoring does not change anything and to make it easier to read the changes fo

[issue26059] Integer Overflow

2016-01-11 Thread Guido van Rossum
Guido van Rossum added the comment: Thanks for the report. This module has been deprecated for a long time, but we should still fix this. Do you have any idea how to fix it? -- components: +Extension Modules -ctypes nosy: +gvanrossum ___ Python

[issue26059] Integer Overflow in strop.replace()

2016-01-11 Thread Guido van Rossum
Guido van Rossum added the comment: I cannot reproduce this on Mac (the code form 1.py just gives a very long answer). I don't have a Windows machine to try it on. Do you have a patch or fix? -- ___ Python tracker <http://bugs.py

[issue25596] Use scandir() to speed up the glob module

2016-01-11 Thread Guido van Rossum
Guido van Rossum added the comment: Looks like switching to scandir will also resolve http://bugs.python.org/issue22167 without further action. -- ___ Python tracker <http://bugs.python.org/issue25

[issue22167] iglob() has misleading documentation (does indeed store names internally)

2016-01-11 Thread Guido van Rossum
Guido van Rossum added the comment: Once http://bugs.python.org/issue25596 (switching glob to use scandir) is solved this issue can be closed IMO. -- nosy: +gvanrossum ___ Python tracker <http://bugs.python.org/issue22

[issue25596] Use scandir() to speed up the glob module

2016-01-11 Thread Guido van Rossum
Guido van Rossum added the comment: Oh well. Too bad. Never mind then. -- ___ Python tracker <http://bugs.python.org/issue25596> ___ ___ Python-bugs-list mailin

[issue25994] File descriptor leaks in os.scandir()

2016-01-11 Thread Guido van Rossum
Guido van Rossum added the comment: Note there's also a nasty corner case related to generators and GC. If a generator contains a with-block or finally-clause, and the generator is not run until its end because the caller hit an exception on one of the items returned, and the generator o

[issue25995] os.walk() consumes a lot of file descriptors

2016-01-11 Thread Guido van Rossum
Guido van Rossum added the comment: I don't like the first solution (it just collects all scandir() results in a list, which defeats one of the purposes of using scandir()), but I don't understand the second solution. Ideally the number of FDs used should be limited by the depth o

[issue25995] os.walk() consumes a lot of file descriptors

2016-01-11 Thread Guido van Rossum
Guido van Rossum added the comment: I am all for preventing the leaks. But using FDs proportional to the tree depth seems reasonable to me. (If you are worried about some kind of DoS attack on the algorithm by someone who can build a tree with depth 1000, well, if they can do that they can also

[issue25994] File descriptor leaks in os.scandir()

2016-01-11 Thread Guido van Rossum
Guido van Rossum added the comment: It was a bit more subtle. I think like this: def f(): with some_lock: yield 0 yield 1 def g(): with another_lock: it = f() for i in it: raise We determined that another_lock was freed *before* some_lock

[issue26090] More correct string truncating in PyUnicode_FromFormat()

2016-01-12 Thread Guido van Rossum
Guido van Rossum added the comment: Could we make this feature available at the Python level too? It sounds really useful. --Guido (mobile) On Jan 12, 2016 2:01 AM, "STINNER Victor" wrote: > > STINNER Victor added the comment: > > See my old issue #10833 which pr

[issue25995] os.walk() consumes a lot of file descriptors

2016-01-12 Thread Guido van Rossum
Guido van Rossum added the comment: I like them both, if I had to choose I'd pick patch 2. But yes, we need to add a close() method to the scandir iterator object. In the meantime, I am still worried about what would happen if somehow the loop got interrupted and the frame got kept aliv

[issue26090] More correct string truncating in PyUnicode_FromFormat()

2016-01-12 Thread Guido van Rossum
Guido van Rossum added the comment: Well it seems a little odd to spend effort on a corner case of the C-level error messages if we can't even replicate it in pure Python. -- ___ Python tracker <http://bugs.python.org/is

[issue26096] '*' glob string matches dot files in pathlib

2016-01-14 Thread Guido van Rossum
Guido van Rossum added the comment: I've thought about this too, and I've decided it's a feature. As Antoine says, it's easy enough to filter the dot files out if you don't want them; it's slightly complicated to include them if the default is to skip them. --

[issue26110] Speedup method calls 1.2x

2016-01-14 Thread Guido van Rossum
Guido van Rossum added the comment: I like this idea! I like the limitations to positional-only calls. I do think that it would be nice if we could speed up C calls too -- today, s.startswith('abc') is slower than s[:3] == 'abc' precisely because of the lookup. But I'

[issue26113] pathlib p.match('') should return False rather than raising exception

2016-01-14 Thread Guido van Rossum
Guido van Rossum added the comment: What's the use case for a "reject all" pattern? Why do you want to call glob with an argument that causes it do do a bunch of pointless work but then return an empty result set? -- ___ Python

[issue26096] '*' glob string matches dot files in pathlib

2016-01-14 Thread Guido van Rossum
Guido van Rossum added the comment: If you have that use case you're probably better of using os.walk() so you are not limited to a prune strategy that can be expressed using a single glob pattern (e.g. maybe I want to ignore .git, .hg and __pycache__ but descend into everything else

[issue26113] pathlib p.match('') should return False rather than raising exception

2016-01-14 Thread Guido van Rossum
Guido van Rossum added the comment: A benefit is that it catches certain bugs early. It's not really worth a fight, so status quo wins. -- resolution: -> wont fix status: open -> closed ___ Python tracker <http://bugs.python.

[issue26125] Incorrect error message in the module asyncio.selector_events.

2016-01-15 Thread Guido van Rossum
Guido van Rossum added the comment: Remember also to apply to asyncio's own GitHub repo. --Guido (mobile) On Jan 15, 2016 6:03 AM, "Ezio Melotti" wrote: > > Ezio Melotti added the comment: > > LGTM unless you think we should also add a test that checks that the name

[issue26133] TypeError: signal handler must be signal.SIG_IGN, signal.SIG_DFL, or a callable object in

2016-01-16 Thread Guido van Rossum
Guido van Rossum added the comment: Heh, this is weird. If the signal being removed is SIGTERM, the logic looks like it is definitely going to call signal.signal(signal.SIGTERM, signal.SIG_DFL). And it doesn't look like the signal module's globals have been eradicated yet (or

<    47   48   49   50   51   52   53   54   55   56   >