[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

[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
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

[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

[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-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

[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.

[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

[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

[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-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

[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-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

[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

[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-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 -

[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

[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: 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
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
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
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
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
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-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-07 Thread Hynek Schlawack
Changes by Hynek Schlawack : -- nosy: +hynek ___ Python tracker <http://bugs.python.org/issue10287> ___ ___ Python-bugs-list mailing list Unsubscribe:

[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:

[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.

[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-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-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

[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: 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

[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:

[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

[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

[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

[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.

[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

[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

[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-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-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-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-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: 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/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: 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/file24067/c92c4d936255.diff ___ Python tracker <http://bugs.python.org/issue12715> ___ ___ 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

[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
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 : 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
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
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

[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

[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 |

[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.

[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-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-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')

[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:

[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

[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

[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

[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

[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-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

[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-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-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

[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

[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
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
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
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(

<    1   2   3   4