[issue5088] optparse: inconsistent default value for append actions

2010-02-16 Thread Andrew McNabb
Andrew McNabb amcn...@mcnabbs.org added the comment: I think that optparse is doing the right thing here. I think that your code example should be changed to: import optparse parser = optparse.OptionParser() parser.add_option(-o, --option, action = append) options, args

[issue7953] RawIOBase.read fails with an AttributeError

2010-02-17 Thread Andrew McNabb
New submission from Andrew McNabb amcn...@mcnabbs.org: I was trying to open stdin in binary mode and ran the following: RawIOBase(sys.stdin.fileno()).read() Traceback (most recent call last): File stdin, line 1, in module AttributeError: 'RawIOBase' object has no attribute 'readinto' I

[issue7955] TextIOWrapper Buffering Inconsistent Between _io and _pyio

2010-02-17 Thread Andrew McNabb
New submission from Andrew McNabb amcn...@mcnabbs.org: The following snippet behaves differently in the C IO implementation than in the Python IO implementation: import sys sys.stdout.write('unicode ') sys.stdout.buffer.write(b'bytes ') To test this, I have created two scripts

[issue7955] TextIOWrapper Buffering Inconsistent Between _io and _pyio

2010-02-18 Thread Andrew McNabb
Andrew McNabb amcn...@mcnabbs.org added the comment: This seems like a common need (particularly for stdout and stderr), and setting `stdout._CHUNK_SIZE = 1` is relying on an implementation detail. 1) Can the documentation for TextIOWrapper be updated to clearly describe this extra buffering

[issue7955] TextIOWrapper Buffering Inconsistent Between _io and _pyio

2010-02-18 Thread Andrew McNabb
Andrew McNabb amcn...@mcnabbs.org added the comment: I would imagine that this would come up in most programs that read data from a pipe or from a socket (which are binary data) and then output to stdout or stderr. I ran across the problem in my first non-trivial port to Python 3

[issue5315] signal handler never gets called

2010-03-02 Thread Andrew McNabb
Andrew McNabb amcn...@mcnabbs.org added the comment: I'm seeing something very similar to this. In my case, I have a single-threaded program, and select fails to be interrupted by SIGCHLD. I'm still tracking down more details, so I'll report back if I find more information. -- nosy

[issue5315] signal handler never gets called

2010-03-02 Thread Andrew McNabb
Andrew McNabb amcn...@mcnabbs.org added the comment: Sorry for the noise. It turns out that my problem was unrelated. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5315

[issue8127] Add link to PortingPythonToPy3k to What's New documentation

2010-03-12 Thread Andrew McNabb
New submission from Andrew McNabb amcn...@mcnabbs.org: The What's New documentation for Python 3.0 and 3.1 have sections called Porting to Python 3.0. It would be great to add a link to the Python wiki page about porting Python to Python 3: http://wiki.python.org/moin/PortingPythonToPy3k

[issue8127] Add link to PortingPythonToPy3k to What's New documentation

2010-03-12 Thread Andrew McNabb
Andrew McNabb amcn...@mcnabbs.org added the comment: What advice in particular do you consider bad? I would be happy to submit some changes to the wiki page for anything that's wrong. I think it would be great to have a reviewed version in the documentation directly, but I think the world

[issue8127] Add link to PortingPythonToPy3k to What's New documentation

2010-03-12 Thread Andrew McNabb
Andrew McNabb amcn...@mcnabbs.org added the comment: By the way, I just noticed your notes on the wiki page and added a response/question. It seems that the advice that you consider bad is the official porting story (upgrade to 2.6 and use 2to3). I agree that it's easier and better

[issue8127] Add link to PortingPythonToPy3k to What's New documentation

2010-03-12 Thread Andrew McNabb
Andrew McNabb amcn...@mcnabbs.org added the comment: Thanks for your advice. I just signed up for the python-porting list, and I'll start a discussion there. I'm trying to improve the wiki page to address your concerns. There are multiple valid approaches to take, and I'm trying to make

[issue4606] Passing 'None' if argtype is set to POINTER(...) doesn't always result in NULL

2009-07-29 Thread Andrew McNabb
Andrew McNabb amcn...@mcnabbs.org added the comment: I ran into this problem, too. It took me a long time to track down the segfaults. It's really bad to pass in None and have the system pick some random address instead of 0. I looked at the attached patch, and it seems to me the only

[issue4606] Passing 'None' if argtype is set to POINTER(...) doesn't always result in NULL

2009-07-30 Thread Andrew McNabb
Andrew McNabb amcn...@mcnabbs.org added the comment: On Thu, Jul 30, 2009 at 07:14:56PM +, Thomas Heller wrote: Thanks for bringing my attention to this problem again, and for the review. I'm just glad to help. The problem is that the patch changes the behaviour of the 'POINTER

[issue13881] Stream encoder for zlib_codec doesn't use the incremental encoder

2012-01-26 Thread Andrew McNabb
New submission from Andrew McNabb amcn...@mcnabbs.org: The stream encoder for the zlib_codec doesn't use the incremental encoder, so it has limited usefulness in practice. This is easiest to show with an example. Here is the behavior with the stream encoder: filelike = io.BytesIO() wrapped

[issue14191] argparse doesn't allow optionals within positionals

2013-02-13 Thread Andrew McNabb
Changes by Andrew McNabb amcn...@mcnabbs.org: -- nosy: +amcnabb ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14191 ___ ___ Python-bugs-list

[issue15258] argparse documentation: Improve optparse section regarding allow_interspersed_args

2013-02-13 Thread Andrew McNabb
Changes by Andrew McNabb amcn...@mcnabbs.org: -- nosy: +amcnabb ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15258 ___ ___ Python-bugs-list

[issue14702] os.makedirs breaks under autofs directories

2012-05-16 Thread Andrew McNabb
Andrew McNabb amcn...@mcnabbs.org added the comment: Andrew, are you still with us? I'm here, but it's been a busy few weeks. I'll see if I can spend some time on this today. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org

[issue14702] os.makedirs breaks under autofs directories

2012-05-16 Thread Andrew McNabb
Andrew McNabb amcn...@mcnabbs.org added the comment: Some interesting information. If I do `os.mkdir('/net/prodigy/tmp')`, it gives OSError: [Errno 13] Permission denied: '/net/prodigy/tmp'. However, if I instead do `os.mkdir('/net/prodigy/tmp/hi')`, it succeeds. (Note that I'm being careful

[issue14702] os.makedirs breaks under autofs directories

2012-05-16 Thread Andrew McNabb
Changes by Andrew McNabb amcn...@mcnabbs.org: Added file: http://bugs.python.org/file25611/mkdir-p.out ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14702

[issue14702] os.makedirs breaks under autofs directories

2012-05-16 Thread Andrew McNabb
Changes by Andrew McNabb amcn...@mcnabbs.org: Added file: http://bugs.python.org/file25612/makedirs.out ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14702

[issue14702] os.makedirs breaks under autofs directories

2012-05-17 Thread Andrew McNabb
Andrew McNabb amcn...@mcnabbs.org added the comment: This isn't fixed. All of the examples I've given were with a 3.3.0 kernel. Doing a stat would be a fix. -- status: closed - open ___ Python tracker rep...@bugs.python.org http://bugs.python.org

[issue14702] os.makedirs breaks under autofs directories

2012-05-17 Thread Andrew McNabb
Andrew McNabb amcn...@mcnabbs.org added the comment: Hmm. Maybe there's a difference between doing stat('/net/prodigy') vs. stat('/net/prodigy/tmp'). Just a guess, but maybe the former can succeed before the mount completes, but the latter has to wait for the mount to complete

[issue14702] os.makedirs breaks under autofs directories

2012-05-17 Thread Andrew McNabb
Andrew McNabb amcn...@mcnabbs.org added the comment: By the way, if my hunch about the difference in stat of '/net/prodigy' vs. '/net/prodigy/tmp' is correct, then this would explain why makedirs on deeper directories work. Specifically, one of the shallower stat calls would force the mount

[issue14702] os.makedirs breaks under autofs directories

2012-05-18 Thread Andrew McNabb
Andrew McNabb amcn...@mcnabbs.org added the comment: I see no evidence that this is a bug in Linux, and I think it's ridiculous to close it when a trivial one-line fix is available. I won't reopen it because it's obvious no one wants to address

[issue14702] os.makedirs breaks under autofs directories

2012-05-18 Thread Andrew McNabb
Andrew McNabb amcn...@mcnabbs.org added the comment: I posted a bug report with the kernel here: https://bugzilla.kernel.org/show_bug.cgi?id=43262 -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14702

[issue14702] os.makedirs breaks under autofs directories

2012-05-21 Thread Andrew McNabb
Andrew McNabb amcn...@mcnabbs.org added the comment: Which one-line fix do you propose? Doing a stat(/net/prodigy/tmp) before mkdir(/net/prodigy/tmp) is an extremely simple workaround. Of course, I would love to see clear documentation of how the kernel is defined to behave

[issue14702] os.makedirs breaks under autofs directories

2012-05-21 Thread Andrew McNabb
Andrew McNabb amcn...@mcnabbs.org added the comment: Maybe I'm confused, but the presence of /net/prodigy is *not* the issue here, and what gets mounted is *not* /net/prodigy, but /net/prodigy/tmp (do mount to confirm or dispute). No, /net/prodigy is the mountpoint in this case: amcnabb

[issue13881] Stream encoder for zlib_codec doesn't use the incremental encoder

2012-02-14 Thread Andrew McNabb
Andrew McNabb amcn...@mcnabbs.org added the comment: It looks like encodings/zlib_codec.py defines a custom IncrementalEncoder and IncrementalDecoder, but its StreamWriter and StreamReader rely on the standard implementation of codecs.StreamWriter and codecs.StreamReader. One solution might

[issue14702] os.makedirs breaks under autofs directories

2012-04-30 Thread Andrew McNabb
New submission from Andrew McNabb amcn...@mcnabbs.org: When a os.makedirs is used under an autofs directory, it crashes. For example, on my machine, `os.makedirs('/net/prodigy/tmp')` crashes with the following traceback: Traceback (most recent call last): ... File /usr/lib64/python2.7

[issue9334] argparse does not accept options taking arguments beginning with dash (regression from optparse)

2012-08-22 Thread Andrew McNabb
Changes by Andrew McNabb amcn...@mcnabbs.org: -- nosy: +amcnabb ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9334 ___ ___ Python-bugs-list

[issue1180] Option to ignore or substitute ~/.pydistutils.cfg

2012-11-26 Thread Andrew McNabb
Andrew McNabb added the comment: The --no-user-cfg option works for me in Python 2.7, but it does not seem to be in Python 3.2 or 3.3: error: option --no-user-cfg not recognized Am I doing something wrong, or was this feature only added to Python 2.7? -- nosy: +amcnabb