[issue11295] On Windows, Python crashes on ANSI / Windows-formatted source files

2011-02-22 Thread Jonathan Hayward

New submission from Jonathan Hayward :

So far as I can tell, Python 2.7 crashes on at least some ANSI / Windows 
\r\n-delimited source files. More specifically, as invoked by Apache as a CGI 
script, the source file line:

import cgi

generated an error logged by Apache, complaining that the module "cgi\r" 
couldn't be imported.

Email sent as follows:

--

Today I was visiting with a friend and installing OSS on his computer. On an 
x86_64 Windows 7 box, he had already installed Apache, and I installed Python 
with a python.org installer. I opened up Notepad and created a "Hello world" 
Python CGI script, put it in the cgi-bin directory, saw it crash, and looked in 
the logs.

The log message complained that I had tried to "import cgi\r": in other words, 
Python on Windows was choking because the file I made in Notepad used "\r\n" 
for line breaks. (The equivalent script made with vim, and presumably "\n" for 
line breaks worked predictably.)

Isn't it a defect/design flaw for Python on Windows to choke on 
"\r\n"-separated files? Should I file a bug, or is this a side effect of 
decisions that are now non-negotiable? (I wasn't thrilled, after trying to sell 
my friend on the idea that Python is a good language with a low barrier to 
entry, to find that it choked on a Notepad-edited "Hello world!" CGI script.)

--
components: Interpreter Core
messages: 129142
nosy: JonathanHayward
priority: normal
severity: normal
status: open
title: On Windows, Python crashes on ANSI / Windows-formatted source files
type: behavior
versions: Python 2.7

___
Python tracker 
<http://bugs.python.org/issue11295>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue11295] On Windows, Python crashes on ANSI / Windows-formatted source files

2011-02-24 Thread Jonathan Hayward

Jonathan Hayward  added the comment:

Thank you; noted. I'm closing the bug for now at least; I'll reopen it if need 
be.

--
resolution:  -> invalid
status: open -> closed

___
Python tracker 
<http://bugs.python.org/issue11295>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue5927] Typo in library on xmlrpc

2009-05-04 Thread Jonathan Hayward

New submission from Jonathan Hayward :

On http://docs.python.org/library/xmlrpclib.html , 21.23.1, at the end
of ServerProxy.system.methodSignature(name):

If no signature is defined for the method, a non-array value is
returned. In Python this means that the type of the returned value will
be something other that list.

I assume this should be:

If no signature is defined for the method, a non-array value is
returned. In Python this means that the type of the returned value will
be something other than list.

reading 'thaN' for 'thaT' in the second-to-last word?

Jonathan
http://JonathansCorner.com

--
assignee: georg.brandl
components: Documentation
messages: 87156
nosy: JonathansCorner.com, georg.brandl
severity: normal
status: open
title: Typo in library on xmlrpc

___
Python tracker 
<http://bugs.python.org/issue5927>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue5928] Missing space after period in xmlrpc library documentation

2009-05-04 Thread Jonathan Hayward

New submission from Jonathan Hayward :

Under http://docs.python.org/library/xmlrpclib.html , 21.23.1:

ServerProxy.system.methodSignature(name)ΒΆ
This method takes one parameter, the name of a method implemented by the
XML-RPC server.It

There should be a space before the second sentence in this paragraph.

Jonathan
http://JonathansCorner.com/

--
assignee: georg.brandl
components: Documentation
messages: 87158
nosy: JonathansCorner.com, georg.brandl
severity: normal
status: open
title: Missing space after period in xmlrpc library documentation

___
Python tracker 
<http://bugs.python.org/issue5928>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue5238] ssl makefile never closes socket

2009-05-08 Thread Jonathan Hayward

Jonathan Hayward  added the comment:

Is there a workaround to close a TLS socket and its underlying socket?

I was making something to use https for a simple operation, and it the
browser acted as if the socket never closed. If I followed the close of
the ssl socket by a close of the underlying socket, I didn't get errors,
but the browser throbber acted as if the connection was still open.

Jonathan, http://JonathansCorner.com/

--
nosy: +JonathansCorner.com

___
Python tracker 
<http://bugs.python.org/issue5238>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue5238] ssl makefile never closes socket

2009-05-11 Thread Jonathan Hayward

Jonathan Hayward  added the comment:

Constantine Sapuntzakis wrote:
> import ssl
> 
> # Work around python bug #5328
> def SSLSocket_makefile_fixed(self, mode='r', bufsize=-1):
> from socket import _fileobject
> 
> self._makefile_refs += 1
> return _fileobject(self, mode, bufsize, True)
> 
> ssl.SSLSocket.makefile = SSLSocket_makefile_fixed

Is it possible this workaround has a bug?

In my production code the socket remains open both after this
monkeypatch and after manually closing the underlying socket. In the
attached test case (TLS certificate and keyfile referenced but not
included), a server does the following:

1: listens to a single HTTPS request on port 8443.
2: Serves a "Hello, world!" page.
3: Closes the connection.
4: Sleeps for five seconds.
5: Exits the process.

The server incorporates the quoted patch, and the behavior from within
Firefox is that it serves up a "Hello world!" page via
https://localhost:8443/ and the connection remains open for five seconds
until the server process exits, apparently indicating a connection that
remains open as long as the process is running.

Closing the underlying connection manually seems to work.

--
Added file: http://bugs.python.org/file13958/test.py

___
Python tracker 
<http://bugs.python.org/issue5238>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6023] Search does not intelligently handle module.function queries on docs.python.org

2009-05-14 Thread Jonathan Hayward

New submission from Jonathan Hayward :

The search function on docs.python.org does not intelligently search the
library for a query in the form "module.function". For instance, in
searching for information on (say) socket.bind(), neither a search query
of "socket.bind()" nor "socket.bind" finds any results. I need to search
for "socket bind" / "bind socket" to get results (or possibly "socket"
or "bind" alone to get a larger number of less focused results.) This is
particularly interesting as the page I am interested in contains the
string "socket.bind" and in fact the snippet that appears on the search
result page for the #1 match is: "...onnection, and *address* is the
address bound to the socket on the other end of the connection. ..
method:: socket.bind(address) Bind the socket to *address*. The socket
must not already be bound. (The format of *address* depen..."

It would be nice if searches for module.function, module.CONSTANT,
module.object, module.object.function, etc. would work for search terms
as objects are named in the API.

(A much easier, if imperfect approximation, would be to treat \W as
breaking words as spaces are treated now, so that e.g. periods in
queries would be internally treated as spaces and a search for
"socket.bind" would be treated as "socket bind" and possibly get
surprisingly good results; see
http://docs.python.org/search.html?q=socket+bind .)

Jonathan
http://JonathansCorner.com/

--
assignee: georg.brandl
components: Documentation
messages: 87755
nosy: JonathansCorner.com, georg.brandl
severity: normal
status: open
title: Search does not intelligently handle module.function queries on 
docs.python.org

___
Python tracker 
<http://bugs.python.org/issue6023>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com