[issue23863] Fix EINTR Socket Module issues in 2.7

2015-04-13 Thread Jeff McNeil
Jeff McNeil added the comment: Added a flag to allow for at least one run -- I know nothing of non-Linux clock resolution. That should handle that. As for the thread safety of the socket timeouts, yeah, that was why I didn't do that initially, I assumed the suggestion to take that approach

[issue23863] Fix EINTR Socket Module issues in 2.7

2015-04-13 Thread Jeff McNeil
Jeff McNeil added the comment: Actually, never mind that suggestion. Now that I think a bit more about it, that actually doesn't do anything since I'd still need to set the updated timeout on the current socket object anyway. Whoops. I'll leave it up to you as to whether we go

[issue23863] Fix EINTR Socket Module issues in 2.7

2015-04-21 Thread Jeff McNeil
Jeff McNeil added the comment: Fixing the underlying connect call should also address EINTR failing with a operation already in progress when a connect+timeout fails due to a signal. I can understand not addressing EINTR generically (though it is already partially addressed in 2.7's

[issue23863] Fix EINTR Socket Module issues in 2.7

2015-04-14 Thread Jeff McNeil
Jeff McNeil added the comment: I'm not a big fan of the settimeout approach myself (and only did it because it was mentioned as a possible approach). I think the existing implementations of EINTR retry also suffer from the same issue in which the timeout isn't adjusted per iteration

[issue23863] Fix EINTR Socket Module issues in 2.7

2015-04-03 Thread Jeff McNeil
Jeff McNeil added the comment: mcjeff@mcjeff:~/cpython_clean$ hg summary parent: 95416:fe34dfea16b0 Escaped backslashes in docstrings. branch: 2.7 commit: 3 modified, 3 unknown update: (current) -- keywords: +patch nosy: +gregory.p.smith Added file: http://bugs.python.org/file38826

[issue23863] Fix EINTR Socket Module issues in 2.7

2015-04-03 Thread Jeff McNeil
New submission from Jeff McNeil: There are a collection of places in the socket module that do not correctly retry on EINTR. Updated to wrap those calls in a retry loop. However, when fixing connect calls, I noticed that when EINTR is retried on a socket with a timeout specified, the retry

[issue23863] Fix EINTR Socket Module issues in 2.7

2015-04-04 Thread Jeff McNeil
Jeff McNeil added the comment: Whoops. Accidentally attached the wrong patch that I generated during testing. -- Added file: http://bugs.python.org/file38832/socket_eintr.1.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org

[issue23863] Fix EINTR Socket Module issues in 2.7

2015-04-08 Thread Jeff McNeil
Jeff McNeil added the comment: Missed check on _ex func. -- Added file: http://bugs.python.org/file38865/socket_eintr.2.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23863

[issue23863] Fix EINTR Socket Module issues in 2.7

2015-04-08 Thread Jeff McNeil
Jeff McNeil added the comment: So, yeah, that's right. In the attached patch, I'm closing the file descriptor if the timeout/error happens on a non-blocking call. It fails with an EBADF on reconnect at that point, but it doesn't potentially leave an FD in the proc's file table. Should

[issue23863] Fix EINTR Socket Module issues in 2.7

2015-04-09 Thread Jeff McNeil
Jeff McNeil added the comment: Updated to recalculate timeout at Python level. The current module already works this way on recv() calls. See attached. I'd be happy to churn through and fix the other modules (using the 3.5 work as a guide), though I think only addressing the higher level

[issue23863] Fix EINTR Socket Module issues in 2.7

2015-05-21 Thread Jeff McNeil
Jeff McNeil added the comment: Do we have a decision on this yet? I'm willing to rework bits that may need it, but I'd like to know whether this is going to be a fruitful effort or not. Thanks! -- ___ Python tracker rep...@bugs.python.org http

[issue1429] FD leak in SocketServer

2010-09-18 Thread Jeff McNeil
Jeff McNeil j...@jmcneil.net added the comment: I'll see if I can get it to reproduce and put a patch together. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1429

[issue8556] Confusing string formatting examples

2010-04-27 Thread Jeff McNeil
New submission from Jeff McNeil j...@jmcneil.net: I was going through the string formatting examples this evening and noticed this: print '%(language)s has %(#)03d quote types.' % \ {'language': Python, #: 2} The example uses a '#' as a map key. This is somewhat misleading as if we

[issue1666318] shutil.copytree doesn't preserve directory permissions

2010-04-27 Thread Jeff McNeil
Changes by Jeff McNeil j...@jmcneil.net: -- nosy: +mcjeff -j_mcneil ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1666318 ___ ___ Python-bugs-list

[issue8556] Confusing string formatting examples

2010-04-30 Thread Jeff McNeil
Jeff McNeil j...@jmcneil.net added the comment: Attaching a patch against the trunk, unified format, changed to 'number' as per suggestion. -- versions: +Python 2.7 -Python 2.6 Added file: http://bugs.python.org/file17155/stdtypes.rst.trunk.patch

[issue1429] FD leak in SocketServer

2010-05-02 Thread Jeff McNeil
Jeff McNeil j...@jmcneil.net added the comment: I was toying with adding Unix Socket support for one of our internal tools and I thought I ran into a leak in my own code. Searched the bug tracker and found this. I tried to reproduce, but wasn't able to. Though, if you look

[issue1429] FD leak in SocketServer

2011-03-13 Thread Jeff McNeil
Jeff McNeil j...@jmcneil.net added the comment: I entirely forgot I had signed up to look, my apologies. I'm going through this w/ what's lying on Mercurial's tip, I can't reproduce it at all. I can raise exceptions of various flavors from within the handle method of a StreamRequestHandler

[issue11563] test_urllibnet is triggering a ResourceWarning

2011-03-16 Thread Jeff McNeil
Changes by Jeff McNeil j...@jmcneil.net: -- nosy: +mcjeff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11563 ___ ___ Python-bugs-list mailing

[issue11563] test_urllibnet is triggering a ResourceWarning

2011-03-16 Thread Jeff McNeil
Jeff McNeil j...@jmcneil.net added the comment: So, I've been meaning to get more into contributing back to Python and I found this one somewhat interesting. As it turns out, even the following simple script raises the same warning: [jeff@martian cpython]$ ./python -c 'import urllib.request

[issue11563] test_urllibnet is triggering a ResourceWarning

2011-03-17 Thread Jeff McNeil
Jeff McNeil j...@jmcneil.net added the comment: So, it turned out to be more complicated than that. The HTTPConnection object returns an HTTPResponse, but never closes the underlying socket after calling makesock. Since persistent connections aren't supported, nothing actually closes

[issue11563] test_urllibnet is triggering a ResourceWarning

2011-03-17 Thread Jeff McNeil
Jeff McNeil j...@jmcneil.net added the comment: Sounds good. I'll look at doing that, too. -- versions: +Python 3.3 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11563

[issue10050] urllib.request still has old 2.x urllib primitives

2011-03-17 Thread Jeff McNeil
Changes by Jeff McNeil j...@jmcneil.net: -- nosy: +mcjeff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10050 ___ ___ Python-bugs-list mailing

[issue10050] urllib.request still has old 2.x urllib primitives

2011-03-18 Thread Jeff McNeil
Jeff McNeil j...@jmcneil.net added the comment: Alright, attaching a patch that reworks urlretrieve to use urlopen internal to urllib.request. 1. I dropped the local caching as it isn't turned on by default anyway (and isn't really documented). 2. Updated documentation to reflect caching

[issue10050] urllib.request still has old 2.x urllib primitives

2011-03-18 Thread Jeff McNeil
Jeff McNeil j...@jmcneil.net added the comment: Made recommended changes. Moved to NamedTemporaryFile. I don't think the spooled file makes sense here as the existing protocol provides a filename in the returned tuple, not a f.l.o. As far as the description? Here are a couple suggestions

[issue10050] urllib.request still has old 2.x urllib primitives

2011-03-18 Thread Jeff McNeil
Jeff McNeil j...@jmcneil.net added the comment: Made requested change to Synopsis/Description. -- Added file: http://bugs.python.org/file21287/issue10050.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10050

[issue10050] urllib.request still has old 2.x urllib primitives

2011-03-19 Thread Jeff McNeil
Jeff McNeil j...@jmcneil.net added the comment: I'll make those changes, sure. I had the same thought re: block size, but I was trying to keep inline with what the current function did. -- ___ Python tracker rep...@bugs.python.org http

[issue10050] urllib.request still has old 2.x urllib primitives

2011-03-19 Thread Jeff McNeil
Jeff McNeil j...@jmcneil.net added the comment: Take four! Includes Antoine's suggestions. I changed the callback to return (block num, read size, file size) as opposed to (block num, block size, file size) as this seems to make more sense. I appreciate the back and forth. I'd be happy

[issue10050] urllib.request still has old 2.x urllib primitives

2011-03-20 Thread Jeff McNeil
Jeff McNeil j...@jmcneil.net added the comment: I'm not exactly sure what the steps are with respect to the DeprecationWarning. Is the common case just to raise the warning in the __init__ method? Are there related documentation changes? Thanks again! Learning a ton. Hopefully the next patch

[issue10050] urllib.request still has old 2.x urllib primitives

2011-03-21 Thread Jeff McNeil
Jeff McNeil j...@jmcneil.net added the comment: Just wanted to check so this doesn't sit with people waiting on me. Is there anything else I need/should do to this patch? Little unclear on how to handle the deprecation process. -- ___ Python

[issue10050] urllib.request still has old 2.x urllib primitives

2011-03-30 Thread Jeff McNeil
Jeff McNeil j...@jmcneil.net added the comment: I'd be happy to pick some of that stuff up. I'd like to address separately as it keeps fewer concerns in this one patch. I'll grab them once they're created. -- ___ Python tracker rep

[issue12890] cgitb displays p tags when executed in text mode

2011-11-19 Thread Jeff McNeil
Jeff McNeil j...@jmcneil.net added the comment: Is there anything else needed here? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12890

[issue12890] cgitb displays p tags when executed in text mode

2011-11-19 Thread Jeff McNeil
Jeff McNeil j...@jmcneil.net added the comment: I didn't add one initially as I was just changing output format and not actual behavior. I guess I could add something to ensure it doesn't regress? I'll make sure there's coverage to begin

[issue12890] cgitb displays p tags when executed in text mode

2011-11-19 Thread Jeff McNeil
Jeff McNeil j...@jmcneil.net added the comment: Test to ensure html isn't included when the formatting is text. I don't seem to be able to update the stage. -- Added file: http://bugs.python.org/file23731/head-cgitb-display-tests.patch ___ Python

[issue12890] cgitb displays p tags when executed in text mode

2011-11-20 Thread Jeff McNeil
Jeff McNeil j...@jmcneil.net added the comment: Added everything to one file. Updated tests to also include a logdir argument as that is required to trigger the original bug. Weeded out a spurious write that occurred when format was set to text. -- Added file: http://bugs.python.org

[issue12890] cgitb displays p tags when executed in text mode

2011-11-21 Thread Jeff McNeil
Changes by Jeff McNeil j...@jmcneil.net: Added file: http://bugs.python.org/file23743/head-cgitb-display.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12890

[issue12365] URLopener should support context manager protocol

2011-06-19 Thread Jeff McNeil
New submission from Jeff McNeil j...@jmcneil.net: Per discussion within Issue10050, URLopener ought to support the context manager protocol. That allows more idiomatic usage and doesn't require calls to contextlib.closing for use with the 'with' statement. If agreed, I'll create a patch

[issue12365] URLopener should support context manager protocol

2011-06-19 Thread Jeff McNeil
Changes by Jeff McNeil j...@jmcneil.net: -- type: - feature request ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12365 ___ ___ Python-bugs-list

[issue12365] URLopener should support context manager protocol

2011-06-19 Thread Jeff McNeil
Jeff McNeil j...@jmcneil.net added the comment: In looking at this again, I may have spoken too soon. It seems that addinfobase HTTPResponse already handle this. As this is what's returned by the opener, then what I was shooting for should already be handled. -- status: open - closed

[issue12365] URLopener should support context manager protocol

2011-06-20 Thread Jeff McNeil
Jeff McNeil j...@jmcneil.net added the comment: Isn't that snippet (contextlib.closing(...)) passing the result of urllib.urlopen to closing? The urlopen call is a factory function of sorts, so there's really no context to manage on its part? Maybe it's just a matter of making that clear

[issue12890] cgitb displays p tags when executed in text mode

2011-09-02 Thread Jeff McNeil
New submission from Jeff McNeil j...@jmcneil.net: If cgitb.enable is ran with a logdir set and a format='text' argument, then a trailing message is printed that includes p tags. This should only happen if the format requested is HTML. The following tiny script shows the problem: import

[issue14134] xmlrpc.client.ServerProxy needs timeout parameter

2012-05-16 Thread Jeff McNeil
Jeff McNeil j...@jmcneil.net added the comment: I would think it might make more sense just to make the change to the Transport object. Since there's an argument for a transport on ServerProxy already, that seems more straightforward and keeps the network layer isolated. Otherwise, it seems

[issue14652] Better error messages for wsgiref validator failures

2012-05-16 Thread Jeff McNeil
Jeff McNeil j...@jmcneil.net added the comment: I went through the patch real quick and I noticed that your using single element tuples in your string formatting. That makes sense in situations where the argument might itself be a tuple, however, not on calls to len() as that will return

[issue14134] xmlrpc.client.ServerProxy needs timeout parameter

2012-05-17 Thread Jeff McNeil
Jeff McNeil j...@jmcneil.net added the comment: Yeah, that's a good point too. I still personally favor the transport encapsulation and related unit testing, but I think that's a call for someone with a snake icon next to their tracker name. Your English is just fine

[issue12890] cgitb displays p tags when executed in text mode

2012-03-13 Thread Jeff McNeil
Jeff McNeil j...@jmcneil.net added the comment: Did this ever get committed? Is there anything left for me to do here? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12890

[issue1666318] shutil.copytree doesn't give control over directory permissions

2012-03-13 Thread Jeff McNeil
Jeff McNeil j...@jmcneil.net added the comment: I made the change suggested in the last comment, patch is attached. Trying to clean up any bugs I've got my name on! -- keywords: +patch Added file: http://bugs.python.org/file24816/makedirs_function.patch

[issue12365] URLopener should support context manager protocol

2012-03-13 Thread Jeff McNeil
Jeff McNeil j...@jmcneil.net added the comment: Documentation patch to outline the use of context manager protocol attached. Trying to cleanup any bugs with my name on them. -- keywords: +patch Added file: http://bugs.python.org/file24817/urllib_request_doc.patch

[issue10050] urllib.request still has old 2.x urllib primitives

2012-03-13 Thread Jeff McNeil
Changes by Jeff McNeil j...@jmcneil.net: -- nosy: -mcjeff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10050 ___ ___ Python-bugs-list mailing

[issue1429] FD leak in SocketServer

2012-03-13 Thread Jeff McNeil
Jeff McNeil j...@jmcneil.net added the comment: In an effort to walk through bugs in my nosy list, I dug into this and tried to reproduce it to no avail. Also, as the handle_error method is supposed to handle problems gracefully, calling shutdown on handle_error exception is probably

[issue1666318] shutil.copytree doesn't give control over directory permissions

2012-03-13 Thread Jeff McNeil
Jeff McNeil j...@jmcneil.net added the comment: Ah, understood. I kind of like the idea of having the added functionality behind a custom callable, but if it's generally just a bug then copystat is a good solution, too. -- ___ Python tracker rep

[issue12365] URLopener should support context manager protocol

2012-03-13 Thread Jeff McNeil
Jeff McNeil j...@jmcneil.net added the comment: Yeah, updated with different wording and proper caps. I left the piece in regarding the use without the context manager as I think that's probably the more common use case still. -- Added file: http://bugs.python.org/file24832

[issue10050] urllib.request still has old 2.x urllib primitives

2012-03-13 Thread Jeff McNeil
Jeff McNeil j...@jmcneil.net added the comment: I'd be happy to do that (URLopener, to begin with), though I'm not familiar with the usual approach. Is it simply a matter of warning in __init__? -- nosy: +mcjeff ___ Python tracker rep

[issue14255] tempfile.gettempdir() didn't return the path with correct case.

2012-03-13 Thread Jeff McNeil
Jeff McNeil j...@jmcneil.net added the comment: The actual implementation calls os.path.normcase from tempfile._get_default_tempdir. In this scenario here, that resolves to the ntpath module triggers a lowercase conversion. On the other hand, the posixpath module is simply an identity

[issue14255] tempfile.gettempdir() didn't return the path with correct case.

2012-03-14 Thread Jeff McNeil
Jeff McNeil j...@jmcneil.net added the comment: The normcase call isn't exactly a no-op in ntpath.py as it also swaps / for \\. Removing the .lower() seems to simply make it a watered down version of normpath. There are a couple of options I guess. We could simply keep the altsep

[issue10050] urllib.request still has old 2.x urllib primitives

2012-03-14 Thread Jeff McNeil
Jeff McNeil j...@jmcneil.net added the comment: I don't see why we'd need to make these _private -- they're just accessors/mutators for the most part. I'd be happy to help clean this up if you need it. -- ___ Python tracker rep...@bugs.python.org

[issue14255] tempfile.gettempdir() didn't return the path with correct case.

2012-03-15 Thread Jeff McNeil
Jeff McNeil j...@jmcneil.net added the comment: Here's a tiny patch that just changes normcase-normpath. This fixes the casing issue at the 'gettempdir' level, though it doesn't address the 'normcase' function itself. Note that *both* macpath.py and ntpath.py use s.lower, which obviously

[issue14255] tempfile.gettempdir() didn't return the path with correct case.

2012-03-15 Thread Jeff McNeil
Jeff McNeil j...@jmcneil.net added the comment: It doesn't seem to me that the right approach on either platform is to simply downcase. Maybe just deprecate the call altogether as its not doing anything normpath isn't if the s.lower call is removed

[issue10050] urllib.request still has old 2.x urllib primitives

2012-03-25 Thread Jeff McNeil
Jeff McNeil j...@jmcneil.net added the comment: I was looking at a somewhat unrelated issue and I bumped up against a similar situation with the warnings system. I didn't look too much into it, but it appeared that warnings didn't get added to __warningregistry__ correctly. Though, when I

[issue10050] urllib.request still has old 2.x urllib primitives

2012-03-25 Thread Jeff McNeil
Jeff McNeil j...@jmcneil.net added the comment: Disregard. That was in concert with ntpath, which uses a funky approach to testing. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10050

[issue14425] Improve handling of 'timeout' parameter default in urllib.urlopen

2012-03-27 Thread Jeff McNeil
Jeff McNeil j...@jmcneil.net added the comment: Quick little patch to change the default to None and update the corresponding documentation. -- keywords: +patch nosy: +mcjeff Added file: http://bugs.python.org/file25044/urllib_urlopen_default.patch

[issue14487] Add pending() query method to Queue.Queue

2012-04-03 Thread Jeff McNeil
Jeff McNeil j...@jmcneil.net added the comment: I looked at doing this. The empty() and full() methods are marked with a disclaimer stating they're likely to be removed at some point? I'm curious, does just checking the value of Queue.unfinished_tasks satisfy the requirement? It could still

[issue14255] tempfile.gettempdir() didn't return the path with correct case.

2012-10-20 Thread Jeff McNeil
Jeff McNeil added the comment: Yeah clearly the wrong behavior on Winders. I think that moving to 'normpath' instead of 'normcase' is likely the right thing to do. Patch is attached, so if someone with commit powers could review real quick I'll address whatever needs to be addressed. IMHO

[issue5004] socket.getfqdn() doesn't cope properly with purely DNS-based setups

2012-10-27 Thread Jeff McNeil
Jeff McNeil added the comment: Gave this a go myself... $ ./python Python 3.4.0a0 (default:57a33af85407, Oct 27 2012, 21:26:30) [GCC 4.4.3] on linux Type help, copyright, credits or license for more information. import socket socket.getfqdn() 'host.domain.com' $ hostname -f

[issue13403] Option for XMLPRC Server to support HTTPS

2012-10-28 Thread Jeff McNeil
Jeff McNeil added the comment: I've hacked this support in myself a few times with a simple socket wrap call in SimpleXMLRPCServer's __init__. I'd be happy to put a quick patch together if that's a viable approach. Is there any desire to support client authentication or advanced features

[issue13403] Option for XMLPRC Server to support HTTPS

2012-10-28 Thread Jeff McNeil
Jeff McNeil added the comment: Attached... worked in the way I've done it in the past and updated documents. -- keywords: +patch Added file: http://bugs.python.org/file27773/ssl_xmlrpc_server.patch ___ Python tracker rep...@bugs.python.org http

[issue16357] SSLSocket created from SSLContext.wrap_socket doesn't include cert/keyfile

2012-10-29 Thread Jeff McNeil
New submission from Jeff McNeil: mcjeff@martian:~/cpython$ ./python -V Python 3.4.0a0 When an SSLSocket is created via SSLContext.wrap_socket, it is passed a _context parameter directly. SSLSocket.__init__ sets self.context at this point, but it does not set self.keyfile or self.certfile

[issue16357] SSLSocket created from SSLContext.wrap_socket doesn't include cert/keyfile

2012-10-29 Thread Jeff McNeil
Jeff McNeil added the comment: Ak! Yes, cut and paste error. Python 3.4.0a0 (default:57a33af85407, Oct 27 2012, 21:26:30) [GCC 4.4.3] on linux Type help, copyright, credits or license for more information. import ssl c = ssl.SSLContext(ssl.PROTOCOL_SSLv23) c.load_cert_chain('Lib

[issue16357] SSLSocket created from SSLContext.wrap_socket doesn't include cert/keyfile

2012-10-29 Thread Jeff McNeil
Jeff McNeil added the comment: Updated to pass in the parent context only actually, as it doesn't look like all of the attributes on SSLSocket will be set if a context was initially passed in. -- Added file: http://bugs.python.org/file27784/ssl_context_2.patch

[issue10050] urllib.request still has old 2.x urllib primitives

2012-11-10 Thread Jeff McNeil
Jeff McNeil added the comment: Reverting of the len(block) back to 'bs' here aside, does it even make sense to include block information at all? That's the attempted read size, so it might not be an accurate representation of the size of the data actually read. Thus the reason

[issue10050] urllib.request still has old 2.x urllib primitives

2012-11-10 Thread Jeff McNeil
Jeff McNeil added the comment: Ah, disregard. I followed up on the other bug. The legacy interface indeed should have stayed consistant. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10050

[issue5102] urllib2.py timeouts do not propagate across redirects for 2.6.1 (and 3.x?)

2009-06-12 Thread Jeff McNeil
Jeff McNeil j...@jmcneil.net added the comment: I ran into this problem this afternoon as well. The same issue appears to exist within the Basic Digest Auth retry code (though it's much less likely to surface). I wound up making the suggested fixes to my local install so I'm attaching the tiny