[issue1492] BaseHTTPServer hard-codes Content-Type for error messages

2007-11-23 Thread samwyse
Changes by samwyse: -- components: +Library (Lib) type: - behavior versions: +Python 2.4, Python 2.5, Python 2.6, Python 3.0 __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1492

[issue1491] BaseHTTPServer incorrectly implements response code 100

2007-11-23 Thread samwyse
New submission from samwyse: RFC 2616 sec 8.2.3 states, An origin server that sends a 100 (Continue) response MUST ultimately send a final status code, once the request body is received and processed, unless it terminates the transport connection prematurely. The obvious way to do

[issue1492] BaseHTTPServer hard-codes Content-Type for error messages

2007-11-23 Thread samwyse
New submission from samwyse: The send_error method always sends a Content-Type of 'text/html'. Other content types are both possible and desirable. For example, someone writing a REST server might wish to send XML error messages. Following the example of DEFAULT_ERROR_MESSAGE, I propose

[issue1491] BaseHTTPServer incorrectly implements response code 100

2007-12-06 Thread samwyse
samwyse added the comment: Refactoring sounds like a good idea. Someone would need to check how other web servers log this, if at all. You're probably right about the HTTP/0.9 as well. The main reason to send a 100 response is because the client sent an Expect: 100-continue header, and won't

[issue3058] Let SimpleXMLRPCServer pass client_address to called functions.

2010-07-11 Thread samwyse
samwyse samw...@gmail.com added the comment: More importantly, the dispatch method is now part of the SimpleXMLRPCDispatcher, which (as a mix-in class) has no direct access to the RequestHandler instance that comprises the request. This breaks Victor's and my idea, unless one is willing

[issue6321] Reload Python modules when running programs

2010-08-15 Thread samwyse
samwyse samw...@gmail.com added the comment: As it happens, I do use Windows and almost exclusively start IDLE via right-clicks on .py files. I've never seen the behavior you describe documented anywhere. On Aug 15, 2010, at 1:37 PM, Cherniavsky Beni rep...@bugs.python.org wrote

[issue10178] PEP 378 uses replace where translate may work better

2010-10-23 Thread samwyse
New submission from samwyse samw...@gmail.com: PEP 378 states; format(n, 6,f).replace(,, X).replace(., ,).replace(X, .) This is complex and relatively slow. A better technique, which IMHO the proposal should high-lighted, would be: swap_commas_and_periods = bytes.maketrans(b',.', b

[issue10178] PEP 378 uses replace where translate may work better

2010-10-23 Thread samwyse
samwyse samw...@gmail.com added the comment: The text in question is also talking about the problems with using 'replace' to swap pairs of characters, so a better, alternate, process would be valuable, especially for anyone unaware of the translate method

[issue1491] BaseHTTPServer incorrectly implements response code 100

2008-05-10 Thread samwyse
samwyse [EMAIL PROTECTED] added the comment: Although any given implementation of an HTTP server is likely to serve up its headers in a predicable, repeatable, order, I don't think that we should specify a particular order in the test suite. Section 4.2 of RFC 2616 specifically states

[issue1491] BaseHTTPServer incorrectly implements response code 100

2008-05-10 Thread samwyse
samwyse [EMAIL PROTECTED] added the comment: In the attached file, I've refactored the entire BaseHTTPRequestHandlerTestCase class. In doing so, I couldn't help but notice that we're expecting HTTP/1.1 responses when sending HTTP/1.0 requests. RFC 2616 is unclear about whether

[issue6321] Reload Python modules when running programs

2009-06-21 Thread samwyse
New submission from samwyse samw...@gmail.com: Every time IDLE is asked to run a program, it doesn't ensure that the modules referenced by the program are completely loaded. This can cause problems if one of those modules is also being edited, because once it is loaded, any subsequent

[issue6321] Reload Python modules when running programs

2011-12-20 Thread samwyse
samwyse samw...@gmail.com added the comment: [issue5847] fixed in 2.7/3.1 -- resolution: - out of date status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6321

[issue17229] unable to discover preferred HTTPConnection class

2013-02-18 Thread Samwyse
New submission from Samwyse: When a URL is opened, the opener-director is responsible for locating the proper handler for the specified protocol. Frequently, an existing protocol handler will be subclassed and then added to the collection maintained by the director. When urlopen is called

[issue15289] Adding __getitem__ as a class method doesn't work as expected

2012-07-07 Thread samwyse
New submission from samwyse samw...@gmail.com: I'm using a class as a decorator, and saving information in a class variable. I wanted to access the information via a __getitem__ class method, but using conventional syntax doesn't work on a class. The following exception is thrown when

[issue15289] Adding __getitem__ as a class method doesn't work as expected

2012-07-10 Thread samwyse
samwyse samw...@gmail.com added the comment: Thanks, Eric. Based on what you said, I was able to get the desired behavior by creating a metaclass. -- Added file: http://bugs.python.org/file26343/Issue15289.py ___ Python tracker rep

[issue13866] {urllib, urllib.parse}.urlencode should not use quote_plus

2012-07-13 Thread samwyse
Changes by samwyse samw...@gmail.com: -- nosy: +samwyse ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13866 ___ ___ Python-bugs-list mailing list

[issue13866] {urllib, urllib.parse}.urlencode should not use quote_plus

2012-07-14 Thread samwyse
samwyse samw...@gmail.com added the comment: Since no one else seems willing to do it, here's a patch that adds a 'quote_via' keyword parameter to the urlencode function. import urllib.parse query={foo: + } urllib.parse.urlencode(query) 'foo=%2B+' urllib.parse.urlencode(query, quote_via

[issue15350] {urllib,urllib.parse}.urlencode.__doc__ is unclear

2012-07-14 Thread samwyse
New submission from samwyse samw...@gmail.com: The doc string for url encode states: The query arg may be either a string or a bytes type. When query arg is a string, the safe, encoding and error parameters are sent to the quote_via function for encoding IMHO, this implies

[issue15327] Argparse: main arguments and subparser arguments indistinguishable

2012-07-14 Thread samwyse
samwyse samw...@gmail.com added the comment: The Namespace object contains a combined list of all of the arguments, from both the main parser and the subparser. I don't see any way to resolve identically name augments without breaking a lot of code that relies on the current behavior. I

[issue15327] Argparse: main arguments and subparser arguments indistinguishable

2012-07-14 Thread samwyse
samwyse samw...@gmail.com added the comment: One change and one minor problem with my suggestion. First, you don't need the second alias, since it's a prefix of the argument name. Also, HelpFormatter._format_actions_usage ends with a bit of code labeled clean up separators for mutually

[issue18191] urllib2/urllib.parse.splitport does not handle IPv6 correctly

2013-07-22 Thread Samwyse
Samwyse added the comment: Fixes Serhiy Storchaka's complaints, removes duplicate test. -- nosy: +samwyse Added file: http://bugs.python.org/file31013/test_urlparse.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18191

[issue18191] urllib2/urllib.parse.splitport does not handle IPv6 correctly

2013-07-22 Thread Samwyse
Samwyse added the comment: Handles raw IPv6 URLs -- Added file: http://bugs.python.org/file31015/urllib.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18191

[issue16122] Allow *open* to accept file-like objects

2012-10-03 Thread samwyse
New submission from samwyse: I'm once again frustrated by a third-party module that only accepts filenames, not already-opened file-like objects. This prevents me from passing in StringIO objects or any of the standard file streams. Currently, *open()* function accepts strings or (in Python

[issue15350] {urllib,urllib.parse}.urlencode.__doc__ is unclear

2012-10-12 Thread samwyse
samwyse added the comment: Look good. I'd fix the last line, however: sent the quote_plus - sent to the quote_plus function, maybe. On Fri, Sep 28, 2012 at 6:18 AM, Brian Brazil rep...@bugs.python.org wrote: Brian Brazil added the comment: How does the attached patch look? I also

[issue3058] Let SimpleXMLRPCServer pass client_address to called functions.

2009-05-16 Thread samwyse
samwyse samw...@gmail.com added the comment: A more general solution would be to pass the RequestHandler instance as a parameter to the dispatch function. This would allow the function to pick out more than just the client address. To avoid breaking pre-existing code, this should be made

[issue21413] urllib.request.urlopen dies on non-basic/digest auth schemes

2014-05-01 Thread Samwyse
New submission from Samwyse: In Python 2.x, this opens an NTLM protected URL: opener = urllib2.build_opener(proxy_handler, auth_NTLM, auth_digest, auth_basic) urllib2.install_opener(opener) response = urllib2.urlopen(url) In Python 3.x, this raises an error: opener

[issue23041] csv needs more quoting rules

2014-12-12 Thread Samwyse
New submission from Samwyse: The csv module currently implements four quoting rules for dialects: QUOTE_MINIMAL, QUOTE_ALL, QUOTE_NONNUMERIC and QUOTE_NONE. These rules treat values of None the same as an empty string, i.e. by outputting two consecutive quotes. I propose the addition of two

[issue23041] csv needs more quoting rules

2014-12-12 Thread Samwyse
Samwyse added the comment: David: That's not a problem for me. Sorry I can't provide real patches, but I'm not in a position to compile (much less test) the C implementation of _csv. I've looked at the code online and below are the changes that I think need to be made. My use cases don't

[issue23041] csv needs more quoting rules

2014-12-15 Thread Samwyse
Samwyse added the comment: Yes, it's based on a real-world need. I work for a Fortune 500 company and we have an internal tool that exports CSV files using what I've described as the QUOTE_NOTNULL rules. I need to create similar files for re-importation. Right now, I have to post-process

[issue23059] sort misc help topics in cmd

2014-12-15 Thread Samwyse
New submission from Samwyse: I've discovered that do_help method of cmd.Cmd prints the documented and undocumented commands in sorted order, but does not sort the miscellaneous topics. This would be an easy fix, just change self.print_topics(self.misc_header, help.keys(),15,80) to use

[issue23041] csv needs more quoting rules

2014-12-15 Thread Samwyse
Samwyse added the comment: Skip, I don't have any visibility into how the Java program I'm feeding data into works, I'm just trying to replicate the csv files that it exports as accurately as possible. It has several other quirks, but I can replicate all of them using Dialects

[issue23059] cmd module should sort misc help topics

2014-12-15 Thread Samwyse
Changes by Samwyse samw...@gmail.com: -- title: sort misc help topics in cmd - cmd module should sort misc help topics ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23059

[issue25760] TextWrapper fails to split 'two-and-a-half-hour' correctly

2015-11-28 Thread Samwyse
New submission from Samwyse: Single character words in a hyphenated phrase are not split correctly. The root issue it the wordsep_re class variable. To reproduce, run the following: >>> import textwrap >>> textwrap.TextWrapper.wordsep_re.split('two-and-a-hal

[issue26299] wsgiref.util FileWrapper raises ValueError: I/O operation on closed file.

2016-02-05 Thread Samwyse
New submission from Samwyse: While developing, I am using wsgiref.simple_server. Using to serve static content isn't working. The attached program demonstrates the issue. Run it and connect to http://127.0.0.1:8000/. You will see three buttons. Clicking on 'wsgi.filewrapper' causes

[issue29940] Add follow_wrapped=True option to help()

2017-03-29 Thread Samwyse
New submission from Samwyse: The help(obj) function uses the type of obj to create its result. This is less than helpful when requesting help on a wrapped object. Since 3.5, inspect.signature() and inspect.from_callable() have a follow_wrapped option to get around similar issues. Adding

[issue33158] Add fileobj property to csv reader and writer objects

2018-03-27 Thread Samwyse
New submission from Samwyse <samw...@gmail.com>: Many objects have properties that allow access to the arguments used to create them. In particular, file objects have a name property that returns the name used when opening a file. A fileobj property would be convenient, as you oth

[issue43556] fix attr names for ast.expr and ast.stmt

2021-03-19 Thread Samwyse
New submission from Samwyse : In Doc/library/ast.rst, the lineno and end_col attributes are repeated; the second set should have 'end_' prefixed to them. Also, there's a minor indentation error in the RST file. # diff ast.rst ast.rst~ 78c78 < col_off

[issue44882] add FileInput.rollback() for in-place filters

2021-08-10 Thread Samwyse
Change by Samwyse : -- title: add .rollback() for in-place filters -> add FileInput.rollback() for in-place filters ___ Python tracker <https://bugs.python.org/issu

[issue44882] add .rollback() for in-place filters

2021-08-10 Thread Samwyse
New submission from Samwyse : Sometimes bad things happen when processing an in-place filter, leaving an empty or incomplete input file and a backup file that needs to recovered. The FileInput class has all the information needed to do this, but it is in private instance variables

[issue45656] argparse bug: prefix_chars argument to add_argument_group doesn't really work

2021-10-28 Thread Samwyse
New submission from Samwyse : Using the prefix_chars argument to parser.add_argument_group causes usage information to print correctly, but the resulting parser doesn't recognize the options. The included program reproduces the issue; it produces the following output on my system

[issue23041] csv needs more quoting rules

2022-02-23 Thread Samwyse
Samwyse added the comment: I just signed the contributor agreement. (Thought I had done that last year but I don’t see any emails. Is there any place to check?) I agree that round-tripping should Bebe possible for any value of quoting. Hopefully this will finally get done before its eighth