[issue46404] 3.11a4: a small attrs regression

2022-01-16 Thread Hynek Schlawack
Change by Hynek Schlawack : -- nosy: +hynek ___ Python tracker <https://bugs.python.org/issue46404> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue46382] dataclass(slots=True) does not account for slots in base classes

2022-01-17 Thread Hynek Schlawack
Hynek Schlawack added the comment: >>> @attrs.define ... class C(Base): ... a: int ... b: int ... >>> C.__slots__ ('b', '__weakref__') We've got a test specifically for this use case: https://github.com/python-attrs/attrs/blob/5f36ba9b89d4d196f

[issue12708] multiprocessing.Pool is missing a starmap[_async]() method.

2011-12-20 Thread Hynek Schlawack
Hynek Schlawack added the comment: Thanks for the feedback Antoine! I updated the patch to latest default tip and added the requested tags to the docs. -- hgrepos: +97 ___ Python tracker <http://bugs.python.org/issue12

[issue12708] multiprocessing.Pool is missing a starmap[_async]() method.

2011-12-20 Thread Hynek Schlawack
Changes by Hynek Schlawack : Added file: http://bugs.python.org/file24062/8a9e14cda106.diff ___ Python tracker <http://bugs.python.org/issue12708> ___ ___ Python-bug

[issue12708] multiprocessing.Pool is missing a starmap[_async]() method.

2011-12-20 Thread Hynek Schlawack
Changes by Hynek Schlawack : Removed file: http://bugs.python.org/file22860/mp-starmap-w-docs.diff ___ Python tracker <http://bugs.python.org/issue12708> ___ ___ Pytho

[issue12708] multiprocessing.Pool is missing a starmap[_async]() method.

2011-12-20 Thread Hynek Schlawack
Hynek Schlawack added the comment: You're right. I've updated the docs accordingly, thanks! -- ___ Python tracker <http://bugs.python.org/issue12708> ___ __

[issue12708] multiprocessing.Pool is missing a starmap[_async]() method.

2011-12-20 Thread Hynek Schlawack
Changes by Hynek Schlawack : Added file: http://bugs.python.org/file24063/c02fbcda56f3.diff ___ Python tracker <http://bugs.python.org/issue12708> ___ ___ Python-bug

[issue12708] multiprocessing.Pool is missing a starmap[_async]() method.

2011-12-20 Thread Hynek Schlawack
Changes by Hynek Schlawack : Removed file: http://bugs.python.org/file24062/8a9e14cda106.diff ___ Python tracker <http://bugs.python.org/issue12708> ___ ___ Python-bug

[issue12715] Add symlink support to shutil functions

2011-12-21 Thread Hynek Schlawack
Changes by Hynek Schlawack : Added file: http://bugs.python.org/file24067/c92c4d936255.diff ___ Python tracker <http://bugs.python.org/issue12715> ___ ___ Python-bug

[issue12715] Add symlink support to shutil functions

2011-12-21 Thread Hynek Schlawack
Hynek Schlawack added the comment: I have updated the patch to latest default/tip and would appreciate a review. -- ___ Python tracker <http://bugs.python.org/issue12

[issue12715] Add symlink support to shutil functions

2011-12-21 Thread Hynek Schlawack
Changes by Hynek Schlawack : Added file: http://bugs.python.org/file24069/4832bf7aa028.diff ___ Python tracker <http://bugs.python.org/issue12715> ___ ___ Python-bug

[issue12715] Add symlink support to shutil functions

2011-12-21 Thread Hynek Schlawack
Hynek Schlawack added the comment: Thanks to Antoine & Charles-François for their reviews! I think I've incorporated all desired changes. Please let me know if I have missed something, meanwhile I'll tackle the docs. -- ___ Python

[issue12715] Add symlink support to shutil functions

2011-12-21 Thread Hynek Schlawack
Changes by Hynek Schlawack : Added file: http://bugs.python.org/file24070/d9212bb67f64.diff ___ Python tracker <http://bugs.python.org/issue12715> ___ ___ Python-bug

[issue12715] Add symlink support to shutil functions

2011-12-21 Thread Hynek Schlawack
Hynek Schlawack added the comment: The patch contains also the necessary changes for the docs now. Please let me know, if I can do anything else. -- ___ Python tracker <http://bugs.python.org/issue12

[issue12715] Add symlink support to shutil functions

2011-12-28 Thread Hynek Schlawack
Changes by Hynek Schlawack : Added file: http://bugs.python.org/file24099/23e6204efe20.diff ___ Python tracker <http://bugs.python.org/issue12715> ___ ___ Python-bug

[issue12715] Add symlink support to shutil functions

2011-12-28 Thread Hynek Schlawack
Hynek Schlawack added the comment: Added another patch fixing the issues pointed out by Antoine and Charles-François. -- ___ Python tracker <http://bugs.python.org/issue12

[issue12715] Add symlink support to shutil functions

2011-12-29 Thread Hynek Schlawack
Changes by Hynek Schlawack : Added file: http://bugs.python.org/file24102/8330f2045f4d.diff ___ Python tracker <http://bugs.python.org/issue12715> ___ ___ Python-bug

[issue12715] Add symlink support to shutil functions

2011-12-29 Thread Hynek Schlawack
Hynek Schlawack added the comment: Added new patch with protection for the remaining UF_NODUMPs in the test case. All raised issues should be fixed now. :) -- ___ Python tracker <http://bugs.python.org/issue12

[issue9993] shutil.move fails on symlink source

2012-01-05 Thread Hynek Schlawack
Hynek Schlawack added the comment: I took the liberty to fix the tests. Basically I've adapted them to the new mock based cross file system approach (that doesn't depend on luck anymore :)). I also had to add one more `os.path.realpath` because on some OS (like OS X) the tmp dire

[issue9993] shutil.move fails on symlink source

2012-01-06 Thread Hynek Schlawack
Hynek Schlawack added the comment: Oh sorry, I didn't look into the doc patch. I unified both into one patch and added the versionchanged tag and also updated the docstring of shutil.move. -- Added file: http://bugs.python.org/file24149/shutil_move_symlinks.

[issue4489] shutil.rmtree is vulnerable to a symlink attack

2012-01-07 Thread Hynek Schlawack
Hynek Schlawack added the comment: What's the current state here? Anyone working on a solution or are we waiting how http://hg.python.org/features/pathlib/ will work out? If the consensus is to add a generic walker method, wouldn't be appropriate to open a new bug and add it as

[issue4489] shutil.rmtree is vulnerable to a symlink attack

2012-01-07 Thread Hynek Schlawack
Hynek Schlawack added the comment: > > What's the current state here? Anyone working on a solution or are we > > waiting how http://hg.python.org/features/pathlib/ will work out? > > Well, I am not working on that one, so waiting for it to work out might > be optimis

[issue13734] Add a generic directory walker method to avoid symlink attacks

2012-01-07 Thread Hynek Schlawack
New submission from Hynek Schlawack : This is an offspring of #4489 (which is a security bug). The method is AFAIU intended to be private. As shown in the discussion of the mentioned #4489, there is a whole family of attacks that exploit the time window between gathering path names and

[issue12708] multiprocessing.Pool is missing a starmap[_async]() method.

2011-08-08 Thread Hynek Schlawack
New submission from Hynek Schlawack : After I've seen a co-worker to unpack tuples while using multiprocessing.Pool.map(), I realized that the module is missing a starmap() method like itertools has. I took it as a opportunity to contribute some code and implemented both starmap(

[issue12709] In multiprocessing, error_callback isn't documented for map_async

2011-08-08 Thread Hynek Schlawack
New submission from Hynek Schlawack : While working on #12708 , I noticed that the error_callback argument of multiprocessing.Pool.map_async() isn't documented (callback is). -- assignee: docs@python components: Documentation messages: 141763 nosy: docs@python, hynek priority: n

[issue12708] multiprocessing.Pool is missing a starmap[_async]() method.

2011-08-08 Thread Hynek Schlawack
Hynek Schlawack added the comment: In all my excitement, I somehow presumed that the docstring automagically lands in the docs. Added doc entries to patch (I hope they aren't too crude, I'm not a native speaker). Same as first patch otherwise. -- Added file: http://bugs.

[issue12709] In multiprocessing, error_callback isn't documented for map_async

2011-08-08 Thread Hynek Schlawack
Hynek Schlawack added the comment: Yeah, if my 3G hadn't failed on me, it would have been already here. :) As a matter of fact, the argument is discussed in the body of the doc, it just has been omitted in the method definition, so the patch is trivial. -- keywords: +patch Added

[issue12708] multiprocessing.Pool is missing a starmap[_async]() method.

2011-08-08 Thread Hynek Schlawack
Changes by Hynek Schlawack : Removed file: http://bugs.python.org/file22859/mp-starmap.diff ___ Python tracker <http://bugs.python.org/issue12708> ___ ___ Python-bug

[issue12715] Add symlink support to shutil functions

2011-08-09 Thread Hynek Schlawack
Hynek Schlawack added the comment: Additionally copyfile() might be fixed to understand symlinks=True too. Currently working on a patch for all 5 of them. -- ___ Python tracker <http://bugs.python.org/issue12

[issue12721] Chaotic use of helper functions in test_shutil for reading and writing files

2011-08-10 Thread Hynek Schlawack
New submission from Hynek Schlawack : While working on #12715 I noticed that the tests of shutil aren't exactly consistent concerning reading and writing files. There were no less than two function to read files (one of them not being used at all) and two methods to write them. Additio

[issue12715] Add symlink support to shutil functions

2011-08-10 Thread Hynek Schlawack
Hynek Schlawack added the comment: JFTR, my implementation is ready, but I can't/don't want to start writing tests, as long as #12721 is open. -- ___ Python tracker <http://bugs.python.o

[issue12721] Chaotic use of helper functions in test_shutil for reading and writing files

2011-08-11 Thread Hynek Schlawack
Hynek Schlawack added the comment: I tend to agree on public APIs, however in this case of a helper function the use case with a join is really really common so this extra function comes in very handy. I also kept it using lists, so it's more obvious than tuples. JFTR it wasn't m

[issue12708] multiprocessing.Pool is missing a starmap[_async]() method.

2011-08-12 Thread Hynek Schlawack
Hynek Schlawack added the comment: No, that's just a helper function like the `mapstar` directly above. args[1] is the iterable with tuples that get unpacked as arguments. -- ___ Python tracker <http://bugs.python.org/is

[issue12721] Chaotic use of helper functions in test_shutil for reading and writing files

2011-08-12 Thread Hynek Schlawack
Hynek Schlawack added the comment: Eric, just to be clear: Are you making this list->tuple change or should I fix the patch? -- ___ Python tracker <http://bugs.python.org/issu

[issue12461] it's not clear how the shutil.copystat() should work on symlinks

2011-08-21 Thread Hynek Schlawack
Hynek Schlawack added the comment: This is a sub-issue of #12715. ATM the consent is to add just one symlinks parameter and use the l* functions iff src _and_ dst are symlinks. -- nosy: +hynek ___ Python tracker <http://bugs.python.org/issue12

[issue9993] shutil.move fails on symlink source

2011-08-21 Thread Hynek Schlawack
Hynek Schlawack added the comment: I work on the superficially related #12715 (symlinks for shutil). As we try to mimic the POSIX tools and `mv` indeed doesn't follow links, I agree with the approach of this patch. -- nosy: +hynek ___ P

[issue12715] Add symlink support to shutil functions

2011-08-21 Thread Hynek Schlawack
Hynek Schlawack added the comment: We have an edge case when the caller calls copymode with symlinks=True on an OS that doesn't have lchmod (ie any other than FreeBSD). Should it be a nop (as in copystat), use chmod or raise an Exception? I Personally (and some people on #python-dev) be

[issue4489] shutil.rmtree is vulnerable to a symlink attack

2011-08-21 Thread Hynek Schlawack
Changes by Hynek Schlawack : -- nosy: +hynek ___ Python tracker <http://bugs.python.org/issue4489> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue12721] Chaotic use of helper functions in test_shutil for reading and writing files

2011-08-21 Thread Hynek Schlawack
Hynek Schlawack added the comment: While writing my tests I realized, it would be really useful to make write_file() return the path it wrote to. I need the concatenated filenames most of the time, so I'm getting blocks of: fn = os.path.join(x,y) write_file(fn, 'contents')

[issue12824] Make the write_file() helper function in test_shutil return the file name it wrote to

2011-08-23 Thread Hynek Schlawack
New submission from Hynek Schlawack : test_shutil contains a handy helper function called write_file(filename. contents). If *filename* is a tuple, os.path.join() is used to concatenate it to a path. To be really useful, the resulting file name should be returned, so the user can work with

[issue12721] Chaotic use of helper functions in test_shutil for reading and writing files

2011-08-23 Thread Hynek Schlawack
Hynek Schlawack added the comment: Done in Issue12824. -- ___ Python tracker <http://bugs.python.org/issue12721> ___ ___ Python-bugs-list mailing list Unsub

[issue12824] Make the write_file() helper function in test_shutil return the file name it wrote to

2011-08-24 Thread Hynek Schlawack
Hynek Schlawack added the comment: ok. it would have saved some LOC for me, but it's nothing essential of course. -- resolution: -> rejected status: open -> closed ___ Python tracker <http://bugs.python.

[issue12715] Add symlink support to shutil functions

2011-08-24 Thread Hynek Schlawack
Hynek Schlawack added the comment: What started as a 2 lines fix, grew to a patch of ~400 lines. :) It's mostly tests though: Lib/shutil.py | 102 +-- Lib/test/test_shutil.py |

[issue12715] Add symlink support to shutil functions

2011-08-24 Thread Hynek Schlawack
Changes by Hynek Schlawack : -- keywords: +patch Added file: http://bugs.python.org/file23028/e126ceae5ba9.diff ___ Python tracker <http://bugs.python.org/issue12

[issue45792] contextvars.Token has wrong module name in Sphinx's objects.inv

2021-11-11 Thread Hynek Schlawack
New submission from Hynek Schlawack : Doc/library/contextvars.rst defines a module using `.. module:: contextvars` which means that all defined symbols are automatically part of the contextvars module. The docs added in https://github.com/python/cpython/pull/5685 however explicitly use

[issue45792] contextvars.Token has wrong module name in Sphinx's objects.inv

2021-11-12 Thread Hynek Schlawack
Change by Hynek Schlawack : -- keywords: +patch pull_requests: +27783 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/29533 ___ Python tracker <https://bugs.python.org/issu

[issue42600] Cancelling tasks waiting for asyncio.Conditions crashes w/ RuntimeError: Lock is not acquired.

2020-12-08 Thread Hynek Schlawack
New submission from Hynek Schlawack : This is something I've been procrastinating on for almost a year and working around it using my own version of asyncio.Condition because I wasn't sure how to describe it. So here's my best take: Consider the following code: ``` import

[issue42014] shutil.rmtree calls onerror with different function than failed

2020-11-11 Thread Hynek Schlawack
Change by Hynek Schlawack : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue13520] Patch to make pickle aware of __qualname__

2012-01-22 Thread Hynek Schlawack
Changes by Hynek Schlawack : -- nosy: +hynek ___ Python tracker <http://bugs.python.org/issue13520> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue13848] io.open() doesn't check for embedded NUL characters

2012-01-24 Thread Hynek Schlawack
Hynek Schlawack added the comment: I took a deep dive into parts of CPython that were unknown to me :) and dug up the following: Methods like os.stat or even os.open convert the file name using "et" in PyArg_ParseTuple[AndKeywords]. OTOH, open() and io.open() just hand through the

[issue13849] Add tests for NUL checking in certain strs

2012-01-24 Thread Hynek Schlawack
Changes by Hynek Schlawack : -- nosy: +hynek ___ Python tracker <http://bugs.python.org/issue13849> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue13848] io.open() doesn't check for embedded NUL characters

2012-01-24 Thread Hynek Schlawack
Hynek Schlawack added the comment: JFTR, file()'s C equivalent is fileio_init and not io_open, I lost track of all the opens. ;) -- ___ Python tracker <http://bugs.python.org/is

[issue13848] io.open() doesn't check for embedded NUL characters

2012-01-24 Thread Hynek Schlawack
Hynek Schlawack added the comment: So I have good news and bad news. The good is: I fixed it for non-Win platforms and the patch is truly beautiful: Lib/test/test_builtin.py | 6 ++ Modules/_io/fileio.c | 25 - 2 files changed, 10 insertions(+), 21

[issue13848] io.open() doesn't check for embedded NUL characters

2012-01-29 Thread Hynek Schlawack
Hynek Schlawack added the comment: I have fixed the refleak, added a _PyUnicode_HasNULChars and integrated it into the Win32-unicode-if-branch. Couldn't test it due to lack of win32 – the function itself is tested though. -- Added file: http://bugs.python.org/file24355/open-nul.

[issue13848] io.open() doesn't check for embedded NUL characters

2012-01-29 Thread Hynek Schlawack
Hynek Schlawack added the comment: With Georg's kind help I added some improvements: - I've been reluctant to waste heap for caching the nul string but he convinced me that I was being ridiculous ;) - For some reason there was a stray character inside, that should be fixed too.

[issue10284] NNTP should accept bytestrings for username and password

2012-02-05 Thread Hynek Schlawack
Changes by Hynek Schlawack : -- nosy: +hynek ___ Python tracker <http://bugs.python.org/issue10284> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue10287] NNTP authentication should check capabilities

2012-02-07 Thread Hynek Schlawack
Changes by Hynek Schlawack : -- nosy: +hynek ___ Python tracker <http://bugs.python.org/issue10287> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue10287] NNTP authentication should check capabilities

2012-02-09 Thread Hynek Schlawack
Hynek Schlawack added the comment: I think I've fixed it to do as described. Alas, I have no Easynews account to test it (I mailed their support about that so maybe that'll change). Would someone with an account mind to test, if it works? Nathan? -- Added file: http://bugs.

[issue10287] NNTP authentication should check capabilities

2012-02-12 Thread Hynek Schlawack
Hynek Schlawack added the comment: Sure, I wanted to add tests as soon as I know that the flow is correct (which it isn't :)). So essentially we want always CAPABILITIES LOGIN CAPABILITIES ? That's rather simple to achieve. The tests are going to be the harder part. ;) Re th

[issue10287] NNTP authentication should check capabilities

2012-02-12 Thread Hynek Schlawack
Hynek Schlawack added the comment: I've added general tests of AUTH USER/PASS as there weren't any present yet. As I haven't alas heard back from Easynews, I can only presume they allow CAPABILITIES after a login – I've added a test case that models this behavior. Other

[issue10287] NNTP authentication should check capabilities

2012-02-12 Thread Hynek Schlawack
Changes by Hynek Schlawack : Added file: http://bugs.python.org/file24499/0cf0b06e1d31.diff ___ Python tracker <http://bugs.python.org/issue10287> ___ ___ Python-bug

[issue10287] NNTP authentication should check capabilities

2012-02-12 Thread Hynek Schlawack
Changes by Hynek Schlawack : Added file: http://bugs.python.org/file24500/e986dd8bb47d.diff ___ Python tracker <http://bugs.python.org/issue10287> ___ ___ Python-bug

[issue10287] NNTP authentication should check capabilities

2012-02-12 Thread Hynek Schlawack
Hynek Schlawack added the comment: Thanks! I think I've addressed everything in the latest patch. -- ___ Python tracker <http://bugs.python.org/is

[issue10287] NNTP authentication should check capabilities

2012-02-12 Thread Hynek Schlawack
Hynek Schlawack added the comment: There's one more issue Julien has raised: nntplib attempts to authenticate when "AUTHINFO" is sent w/o USER. (haven't tested it but I presume it's still valid) It's trivial to catch that but I'd say that it's fine to l

[issue10287] NNTP authentication should check capabilities

2012-02-12 Thread Hynek Schlawack
Changes by Hynek Schlawack : Added file: http://bugs.python.org/file24502/b33bcf179df4.diff ___ Python tracker <http://bugs.python.org/issue10287> ___ ___ Python-bug

[issue10287] NNTP authentication should check capabilities

2012-02-12 Thread Hynek Schlawack
Hynek Schlawack added the comment: So my take on the whole issue and Antoine "tends to agree". ;) 1. If the user tells us (s)he _wants_ us to authenticate or send MODE READER, we do it even if capabilities don't advertise it. There's a lot of rfc-non-conformant servers

[issue7644] bug in nntplib.body() method with possible fix

2012-02-13 Thread Hynek Schlawack
Hynek Schlawack added the comment: Looking into the source code of nntplib, I'd claim this bug isn't valid anymore? At least the file is opened in binary mode now – see Lib/nntplib.py:462 In any case, we have a test suite now. -- nosy: +hynek versions: +Python 3.3 -

[issue8739] Update to smtpd.py to RFC 5321

2012-02-13 Thread Hynek Schlawack
Changes by Hynek Schlawack : -- nosy: +hynek ___ Python tracker <http://bugs.python.org/issue8739> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue7644] bug in nntplib.body() method with possible fix

2012-02-15 Thread Hynek Schlawack
Hynek Schlawack added the comment: I have also added a test for NTTP.head(), enjoy. -- keywords: +patch Added file: http://bugs.python.org/file24524/nntp-file-test.diff ___ Python tracker <http://bugs.python.org/issue7

[issue14082] shutil doesn't copy extended attributes

2012-02-25 Thread Hynek Schlawack
Hynek Schlawack added the comment: I'd tend to always copy xattrs – it seems that's what the user would expect to happen. A new parameter to _forbid_ it might make sense. However, I feel that there are already enough parameter

[issue14082] shutil doesn't copy extended attributes

2012-02-25 Thread Hynek Schlawack
Hynek Schlawack added the comment: If nobody objects, I'd cook up a patch. -- ___ Python tracker <http://bugs.python.org/issue14082> ___ ___ Python-bugs-l

[issue14082] shutil doesn't copy extended attributes

2012-04-06 Thread Hynek Schlawack
Hynek Schlawack added the comment: This ticket has a small catch: There are several namespaces. According to http://en.wikipedia.org/wiki/Xattr#Linux : - user: can be set by anyone - trusted: root only - security: root only - system: even root can’t do that, at least not in my vm I’m

[issue12978] Figure out extended attributes on BSDs

2012-04-10 Thread Hynek Schlawack
Changes by Hynek Schlawack : -- nosy: +hynek ___ Python tracker <http://bugs.python.org/issue12978> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue14082] shutil doesn't copy extended attributes

2012-04-12 Thread Hynek Schlawack
Hynek Schlawack added the comment: Ok, so I’ve added a function `copyxattr()` and `copy2()` tries to copy all possible namespaces. Tests pass on Linux and Mac OS X. -- keywords: +patch Added file: http://bugs.python.org/file25194/xattr.diff

[issue14157] time.strptime without a year fails on Feb 29

2012-04-13 Thread Hynek Schlawack
Hynek Schlawack added the comment: The point isn’t that time.strptime validates dates but that it uses datetime internally: julian = datetime_date(year, month, day).toordinal() - \ datetime_date(year, 1, 1).toordinal() + 1 Is it worth to reimplement this functionality

[issue29587] Generator/coroutine 'throw' discards exc_info state, which is bad

2017-11-11 Thread Hynek Schlawack
Change by Hynek Schlawack : -- nosy: +hynek ___ Python tracker <https://bugs.python.org/issue29587> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue31997] SSL lib does not handle trailing dot (period) in hostname or certificate

2017-11-11 Thread Hynek Schlawack
Change by Hynek Schlawack : -- nosy: +hynek ___ Python tracker <https://bugs.python.org/issue31997> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue33734] asyncio/ssl: Fix AttributeError, increase default handshake timeout

2018-06-01 Thread Hynek Schlawack
Hynek Schlawack added the comment: For some context: 10s seems to be more common than I liked to believe (seems like Go's http client uses it by default too). Nevertheless I ran into the 10s after updating uvloop and stopped being able to connect to a server in India. Therefore I'

[issue33734] asyncio/ssl: Fix AttributeError, increase default handshake timeout

2018-06-01 Thread Hynek Schlawack
Hynek Schlawack added the comment: > Previous timeout was effectively infinite. Oi, well then 60s are an improvement indeed. :) -- ___ Python tracker <https://bugs.python.org/issu

[issue18108] shutil.chown should support dir_fd and follow_symlinks keyword arguments

2013-05-31 Thread Hynek Schlawack
Changes by Hynek Schlawack : -- nosy: +hynek versions: +Python 3.4 -Python 3.3 ___ Python tracker <http://bugs.python.org/issue18108> ___ ___ Python-bugs-list m

[issue18652] Add a “first” function to the stdlib

2013-08-04 Thread Hynek Schlawack
New submission from Hynek Schlawack: Let met try to get you sold on adding the “first” function I released on PyPI roughly a year ago: https://github.com/hynek/first It’s a very nice complement to functions like `any()` or itertools. I consists effectively of 9 lines of code but it proved

[issue18652] Add a “first” function to the stdlib

2013-08-04 Thread Hynek Schlawack
Hynek Schlawack added the comment: `filter()` exhausts the full iterator which is potentially very expensive – like in conduction with regular expressions. -- ___ Python tracker <http://bugs.python.org/issue18

[issue18652] Add a “first” function to the stdlib

2013-08-04 Thread Hynek Schlawack
Hynek Schlawack added the comment: Ah ok sorry. Anyhow, it’s just a very common idiom that should be easy and readable. As said, I’m not married to any names at all and would happily add a compatibility package to PyPI with the new names/parameters

[issue18652] Add a “first”-like function to the stdlib

2013-08-04 Thread Hynek Schlawack
Hynek Schlawack added the comment: Martin, I don’t find the loop easier to read because you have to *remember* the `break` otherwise “weird stuff happens”. Coalesce seems common enough, I would +1 on that too. -- title: Add a “first” function to the stdlib -> Add a “first”-l

[issue18652] Add itertools.coalesce

2013-08-04 Thread Hynek Schlawack
Hynek Schlawack added the comment: > def coalesce(iterable, default=None, pred=None): >return next(filter(pred, iterable), default) > > Are you sure you want add this one-line function to the itertools module > rather then to recipes? Well, for many – including me – i

[issue18652] Add itertools.coalesce

2013-08-04 Thread Hynek Schlawack
Hynek Schlawack added the comment: > But why you want to have a separate function instead of just use two builtins? This question has been answered twice now, once from Nick – please refer above. It's a clunky and error-prone solution to a common problem. Maybe you can't emph

[issue18652] Add itertools.first_true (return first true item in iterable)

2013-08-05 Thread Hynek Schlawack
Hynek Schlawack added the comment: > +1 on the name 'first_true'. Does exactly what it says on the tin. I fully agree. *** I assume what's missing now is a permission from Raymond to mess with his turf? -- ___ Pyt

[issue18652] Add itertools.first_true (return first true item in iterable)

2013-08-11 Thread Hynek Schlawack
Hynek Schlawack added the comment: So I wanted to provide a first patch to move the discussion on and realized that itertools appears currently to be completely inside of `Modules/itertoolsmodule.c`. :-/ Any volunteers? :) -- assignee: hynek -> stage: -> needs

[issue18652] Add itertools.first_true (return first true item in iterable)

2013-08-17 Thread Hynek Schlawack
Hynek Schlawack added the comment: Well that's the point: it's extremely handy but simple. I wish Raymond would pronounce on this. I can keep using the PyPI version for all I care, so I'm not going fight for it. But with one exception there seems to be an agreement that it

[issue18959] Create a "Superseded modules" section in standard library ToC

2013-09-07 Thread Hynek Schlawack
Changes by Hynek Schlawack : -- nosy: +hynek ___ Python tracker <http://bugs.python.org/issue18959> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue14157] time.strptime without a year fails on Feb 29

2012-04-21 Thread Hynek Schlawack
Hynek Schlawack added the comment: I gave it a shot, doesn’t look like a hack to me, what do you think? -- keywords: +patch Added file: http://bugs.python.org/file25301/strptime-on-leap-years.diff ___ Python tracker <http://bugs.python.

[issue14662] shutil.move broken in 2.7.3 on OSX (chflags fails)

2012-04-24 Thread Hynek Schlawack
Hynek Schlawack added the comment: I guess a “best effort” approach would be best here. I presume Python 3.2+ have the same behavior? -- nosy: +hynek ___ Python tracker <http://bugs.python.org/issue14

[issue14662] shutil.move broken in 2.7.3 on OSX (chflags fails)

2012-04-24 Thread Hynek Schlawack
Hynek Schlawack added the comment: Now that’s odd. I just looked into the code at http://hg.python.org/cpython/file/2.7/Lib/shutil.py#l103 and there is a guard against EOPNOTSUPP: try: os.chflags(dst, st.st_flags) except OSError, why: if (not hasattr(errno, 'EOPNOTSUPP

[issue14662] shutil.move broken in 2.7.3 on OSX (chflags fails)

2012-04-26 Thread Hynek Schlawack
Hynek Schlawack added the comment: I had this text ready before ned chimed in, I’ll post it anyway because it was a lot of work ;): You're right, 2.7’s errnos are incomplete compared to 3.2. Antoine added ENOTSUP in c370866f30a7 and it runs as “Solaris-specific”. So it’s currently i

[issue14682] Backport missing errnos to 2.7

2012-04-27 Thread Hynek Schlawack
New submission from Hynek Schlawack : In order to fix issue14662, we need to back port at least ENOTSUP to 2.7 (presuming we don’t want to check for magic numbers). The question is, whether we should back port all/most of them when we’re at it? There doesn’t seem to be much harm to it

[issue4489] shutil.rmtree is vulnerable to a symlink attack

2012-04-27 Thread Hynek Schlawack
Hynek Schlawack added the comment: Anybody working on this one? I’d give it a shot otherwise. -- ___ Python tracker <http://bugs.python.org/issue4489> ___ ___

[issue14682] Backport missing errnos to 2.7

2012-04-27 Thread Hynek Schlawack
Hynek Schlawack added the comment: So what does that mean for issue14662? Backport only ENOTSUP, check against “45” or “won't fix”? -- ___ Python tracker <http://bugs.python.org/is

[issue14662] shutil.move broken in 2.7.3 on OSX (chflags fails)

2012-04-27 Thread Hynek Schlawack
Hynek Schlawack added the comment: This is a fix for 2.7. As Benjamin said in http://bugs.python.org/issue14682#msg159477 it’s okay to back port ENOTSUP, I did it as part of the patch here. I wasn’t sure whether we should document it? I’m porting the patch to tip right now, reviews/opinions

[issue14662] shutil.move broken in 2.7.3 on OSX (chflags fails)

2012-04-27 Thread Hynek Schlawack
Hynek Schlawack added the comment: This one is against tip. -- Added file: http://bugs.python.org/file25383/expand-chflags-catch-tip.diff ___ Python tracker <http://bugs.python.org/issue14

[issue14662] shutil.move broken in 2.7.3 on OSX (chflags fails)

2012-04-27 Thread Hynek Schlawack
Hynek Schlawack added the comment: And finally against 3.2 -- Added file: http://bugs.python.org/file25384/expand-chflags-catch-3.2.diff ___ Python tracker <http://bugs.python.org/issue14

  1   2   3   4   >