[issue12523] 'str' object has no attribute 'more' [/usr/lib/python3.2/asynchat.py|initiate_send|245]

2014-04-16 Thread Caelyn McAulay

Caelyn McAulay added the comment:

Here is a small script that runs fine under 2.7 but demonstrates the error when 
run at 3.5.

If, at all the points annotated with '#not bytes :-(', the unicode strings are 
replaced with bytes objects, the example then successfully runs at 3.5.

--
nosy: +math_foo
Added file: http://bugs.python.org/file34910/asynchat_example.py

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12523
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue12523] 'str' object has no attribute 'more' [/usr/lib/python3.2/asynchat.py|initiate_send|245]

2014-04-16 Thread Caelyn McAulay

Caelyn McAulay added the comment:

I was unable to locate a point in the code where we could be certain that the 
error was ultimately caused by trying to use (unicode) strings instead of bytes 
object.

The patch adds a logging statement suggesting what the trouble is when the 
error is (probably) encountered.

Someone with more experience than me will need to make the call about whether 
this is a useful addition or not.

--
keywords: +patch
Added file: http://bugs.python.org/file34913/issue12523.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12523
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue12523] 'str' object has no attribute 'more' [/usr/lib/python3.2/asynchat.py|initiate_send|245]

2014-04-16 Thread Caelyn McAulay

Caelyn McAulay added the comment:

I like that approach decidedly more than my original one. Suggested revision 
patch attached.

The sample script will not produce the following:

error: uncaptured python exception, closing channel __main__.fake_asynchat 
127.0.0.1:8000 at 0x7f10a85b4ae8 (class 'TypeError':data must be a bytes 
object [/home/caelyn/CPython/async_chat_error/Lib/asyncore.py|write|91] 
[/home/caelyn/CPython/async_chat_error/Lib/asyncore.py|handle_write_event|460] 
[/home/caelyn/CPython/async_chat_error/Lib/asyncore.py|handle_connect_event|448]
 [asynchat_example.py|handle_connect|16] 
[/home/caelyn/CPython/async_chat_error/Lib/asynchat.py|push|185])

Which is, I think, is a bit more useful.

--
Added file: http://bugs.python.org/file34923/issue12523_r2.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12523
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue12523] 'str' object has no attribute 'more' [/usr/lib/python3.2/asynchat.py|initiate_send|245]

2014-04-16 Thread Caelyn McAulay

Caelyn McAulay added the comment:

*will now produce.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12523
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue20928] xml.etree.ElementInclude does not include nested xincludes

2014-04-16 Thread Caelyn McAulay

Caelyn McAulay added the comment:

xml.etree.ElementInclude.include now checks the inserted subtree to see if 
contains any Xincludes itself. And adds them.

Also added a unit test to check for the new functionality (which will fail 
without the change to ElementInclude.py).

--
keywords: +patch
nosy: +math_foo
Added file: http://bugs.python.org/file34927/issue20928.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20928
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue12148] Clarify or-ing together doctest option flags

2014-04-16 Thread Caelyn McAulay

Caelyn McAulay added the comment:

I grepped for 's together' and found two instances of or's together in the 
docs which I reworded to use bitwise-or instead, in the attached patch.

--
keywords: +patch
nosy: +math_foo
Added file: http://bugs.python.org/file34938/issue12148.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12148
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue5904] strftime docs do not explain locale effect on result string

2014-04-16 Thread Caelyn McAulay

Caelyn McAulay added the comment:

Added to Docs that strftime will return a locale dependent byte string.

--
keywords: +patch
nosy: +math_foo
Added file: http://bugs.python.org/file34940/issue5904.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue5904
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10523] argparse has problem parsing option files containing empty rows

2014-04-15 Thread Caelyn McAulay

Caelyn McAulay added the comment:

I've attached a patch making the changes I suggested, assuming that the current 
behaviour is desirable. It documents the behaviour of argparse on files with 
blank lines and changes the way the error message that argparse generates when 
encountering unrecognized arguments is generated.

When a blank line is included at the end of a file, the resulting error message 
is now: argparse_example.py: error: unrecognized arguments: ''. This also 
makes it obvious when the problem is white space, e.g. if an argument has 
trailing spaces, this also makes that obvious.

--
keywords: +patch
Added file: http://bugs.python.org/file34875/argparse_blanklines.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10523
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18229] attribute headers of http.server.BaseHTTPRequestHandler sometimes does not exists

2014-04-15 Thread Caelyn McAulay

Caelyn McAulay added the comment:

Added comment to documentation concerning when the headers attribute gets set. 

I confirmed that the headers attribute is only ever set in the parse_request 
method of BaseHTTPRequestHandler and only if the request is successfully parsed 
as HTTP.

--
keywords: +patch
nosy: +math_foo
Added file: http://bugs.python.org/file34884/documentation18229.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18229
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue7850] platform.system() should be macosx instead of Darwin on OSX

2014-04-15 Thread Caelyn McAulay

Caelyn McAulay added the comment:

Added aliased option to platform.system(). I used the same system_alias method 
as platform.platform(), so the result of the aliased version will match the 
system entry of the aliased platform.platform(). 

Added to platform.system unit test to test new functionality. Updated 
Documentation.

I am not sure if there is anywhere else I need to update the documentation to 
add this, i.e. if it needs a whatsnews entry (and if so, a pointer to docs on 
how to add to a whatsnews entry would be appreciated).

--
keywords: +patch
nosy: +math_foo
Added file: http://bugs.python.org/file34891/aliased_system7850.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue7850
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue11983] Inconsistent hash and comparison for code objects

2014-04-14 Thread Caelyn McAulay

Caelyn McAulay added the comment:

Here is a patch to add the requested documentation to code.h - I expanded it to 
specify (as per the conversation in this issue) that co_name is used in both 
hash and comparisons while co_firstlineno is used only in comparisons. 

I do not attempt explain the inconsistency; but let the comment reflect reality.

--
keywords: +patch
nosy: +math_foo
Added file: http://bugs.python.org/file34828/comment11983.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue11983
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15840] Ambiguity with regard to the effect of accessing a closed IOBase instance

2014-04-14 Thread Caelyn McAulay

Caelyn McAulay added the comment:

Changed documentation to state that ValueError should be raised if any 
operation (excluding close()) is called on a closed stream.

This appears to be what is done in iobase.c; and some investigation of 
inheriting types (rawiobase, fileio, bufferedio, etc.) indicates that there is 
nowhere where an IOError is being raised instead.

Sphinx documentation appears to already be update to date.

Is there any known place where operations on a closed stream raise IOError? I 
am currently assuming no.

--
keywords: +patch
nosy: +math_foo
Added file: http://bugs.python.org/file34843/comment15840.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15840
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10523] argparse has problem parsing option files containing empty rows

2014-04-14 Thread Caelyn McAulay

Caelyn McAulay added the comment:

The current behaviour takes empty lines and interprets them as empty strings. 

The attached demonstration script shows the error occurring. The first case is 
a simple example to illustrate what happens in the general case. The second 
case shows empty lines being interpreted as empty strings and assigned to 
arguments.

The third case, despite being very similar to the first, results in argparse 
exiting with an error message. Internally, what is happening is, after taking 
the 'foo' and 'baz' arguments and assigning them 'bar' and 'quux' respectively, 
it reads in an argument , which it does not recognize. And produces the 
following error message:

argparse_example.py: error: unrecognized arguments:

The error message, in it's current form, is kind of opaque.

For the third case, if we move the blank line to between 'bar' and '-baz', the 
same error results, as again it tried to interpret the blank line as an 
argument. If we move the blank line to the start of the file, same thing again. 

If we move the blank line between '-foo' and 'bar', instead the error reads: 
argparse_example.py: error: unrecognized arguments: bar - which is at least 
somewhat comprehensible.

The question is, how should blank lines be handled? 

Should they be accepted as possible values for arguments? 

If they fall into spaces where arguments (versus values for arguments) are 
expected, should we skip them?

If the current handling is fine, I would propose updating the documentation to 
add the following after the paragraph that begins Arguments read from a file 
...:

By default, blank lines are interpreted as empty strings. An empty string is 
not an acceptable argument; but it is an acceptable value for an argument.

And changing the way that the error from argparse is displayed so that it is 
more obvious what argparse_example.py: error: unrecognized arguments: means.

--
nosy: +math_foo
Added file: http://bugs.python.org/file34860/argparse_example.py

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10523
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com