[issue6173] Minor typo in socket.py

2009-06-01 Thread Pablo Torres Navarrete

New submission from Pablo Torres Navarrete :

Index: socket.py
===
--- socket.py   (revision 73134)
+++ socket.py   (working copy)
@@ -16,7 +16,7 @@
 gethostbyname() -- map a hostname to its IP number
 gethostbyaddr() -- map an IP number or hostname to DNS info
 getservbyname() -- map a service name and a protocol name to a port number
-getprotobyname() -- mape a protocol name (e.g. 'tcp') to a number
+getprotobyname() -- map a protocol name (e.g. 'tcp') to a number
 ntohs(), ntohl() -- convert 16, 32 bit int from network to host byte order
 htons(), htonl() -- convert 16, 32 bit int from host to network byte order
 inet_aton() -- convert IP addr string (123.45.67.89) to 32-bit packed
format

--
components: Library (Lib)
files: socket.patch
keywords: patch
messages: 88715
nosy: ptn
severity: normal
status: open
title: Minor typo in socket.py
versions: Python 2.6
Added file: http://bugs.python.org/file14153/socket.patch

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



[issue6173] Minor typo in socket.py

2009-06-01 Thread Pablo Torres Navarrete

Changes by Pablo Torres Navarrete :


--
versions: +Python 2.7

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



[issue1184112] Missing trailing newline with comment raises SyntaxError

2009-06-07 Thread Pablo Torres Navarrete

Pablo Torres Navarrete  added the comment:

Confirmed on versions 2.6.2, 3.0.1 and 3.1rc1.  On the three of them, I
tried this:

>>> import parser 
>>> test = 'def foo():\n\tpass\n\n# comment'
>>> parser.suite(test)
Traceback (most recent call last):
  File "", line 1, in 
  File "", line 4
# comment
   ^
SyntaxError: invalid syntax
>>>

--
nosy: +ptn

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



[issue1184112] Missing trailing newline with comment raises SyntaxError

2009-06-07 Thread Pablo Torres Navarrete

Changes by Pablo Torres Navarrete :


--
versions: +Python 3.1

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



[issue5313] multiprocessing.process using os.close(sys.stdin.fileno) instead of sys.stdin.close()

2009-06-10 Thread Pablo Torres Navarrete

Pablo Torres Navarrete  added the comment:

Wouldn't it be more pythonic to just try sys.stdin.fileno() and catch 
the AtributeError too?

def _bootstrap(self):
   
try:
os.close(sys.stdin.fileno())
except AtributeError:
sys.stdin.close()
except (OSError, ValueError):
pass

--
nosy: +ptn

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



[issue5800] make wsgiref.headers.Headers accept empty constructor

2009-06-17 Thread Pablo Torres Navarrete

Pablo Torres Navarrete  added the comment:

Patch attached.  While I was at it, I also removed stupid whitespace and 
generally made the module more PEP8-compliant.

--
nosy: +ptn
Added file: http://bugs.python.org/file14311/patch

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



[issue5801] spurious empty lines in wsgiref code

2009-06-17 Thread Pablo Torres Navarrete

Pablo Torres Navarrete  added the comment:

The patch for issue #5800 solves this.

--
nosy: +ptn

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



[issue6064] Add "daemon" argument to threading.Thread constructor

2009-06-17 Thread Pablo Torres Navarrete

Pablo Torres Navarrete  added the comment:

+1, but I can't apply the patch cleanly:

$ patch -p0 < threading.diff
patching file Doc/library/threading.rst
Hunk #1 succeeded at 198 (offset -17 lines).
Hunk #2 succeeded at 211 (offset -17 lines).
Hunk #3 succeeded at 230 (offset -17 lines).
patching file Lib/threading.py
Hunk #1 succeeded at 407 with fuzz 1 (offset -16 lines).
Hunk #2 FAILED at 416.
1 out of 2 hunks FAILED -- saving rejects to file Lib/threading.py.rej
patching file Lib/test/test_threading.py
Hunk #1 succeeded at 350 with fuzz 2 (offset 14 lines).

--
nosy: +ptn

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



[issue1685] linecache .updatecache fails on utf8 encoded files

2009-06-17 Thread Pablo Torres Navarrete

Pablo Torres Navarrete  added the comment:

Cannot reproduce on Ubuntu 9.04 with py3k at revision 73267:

$ ./python
Python 3.1rc1+ (py3k:73267, Jun  7 2009, 14:45:03) 
[GCC 4.3.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import pdb
[49404 refs]
>>> d = pdb.Pdb()
[49446 refs]
>>> fname = r"temp/test.py"
[49448 refs]
>>> print(d.set_break(fname,1))
None
[49505 refs]

--
nosy: +ptn

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



[issue6064] Add "daemon" argument to threading.Thread constructor

2009-06-17 Thread Pablo Torres Navarrete

Pablo Torres Navarrete  added the comment:

Nope.  Our working copies seem to be different.  I'm uploading mine, 
which I just update to revision 73468.  Please diff yours against that 
and against HEAD too, just in case.

Hunk 2 on threading.py fails because your attributes use two leading 
underscores and mine use only one.  I have no idea why hunk4 fails.

--
Added file: http://bugs.python.org/file14313/threading.py

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



[issue6064] Add "daemon" argument to threading.Thread constructor

2009-06-17 Thread Pablo Torres Navarrete

Pablo Torres Navarrete  added the comment:

> I'm diffing against the 2.7 branch, I guess your comes from the 3.2?
*forehead meets desktop*

Patch applies cleanly and all tests pass.  I used it for a while and 
everything seemed OK.  After someone else tests, I say we go for it :)

--

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



[issue6064] Add "daemon" argument to threading.Thread constructor

2009-06-17 Thread Pablo Torres Navarrete

Pablo Torres Navarrete  added the comment:

+1 on making it a keyword-only argument.

--

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



[issue5800] make wsgiref.headers.Headers accept empty constructor

2009-06-17 Thread Pablo Torres Navarrete

Pablo Torres Navarrete  added the comment:

Added a pointer from #5801 to here.

--

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



[issue5801] spurious empty lines in wsgiref code

2009-06-19 Thread Pablo Torres Navarrete

Pablo Torres Navarrete  added the comment:

I added the patch for #5800

--
Added file: http://bugs.python.org/file14321/patch

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



[issue6372] Make all switches keyword-only

2009-06-29 Thread Pablo Torres Navarrete

New submission from Pablo Torres Navarrete :

I propose that all formal parameters that really act as options/switches
be made keyword-only.  Examples of switches are all flags, timeouts,
'verbose' bools, maximums and minimums, etc.

This stresses the difference between needed input for a function and an
argument that changes/extends the behavior.  Besides, the code would be
more readable, because instead of having some cryptic function call like
register('Pablo Torres', 2, 4, 5, False) you would have the prettier
register('Pablo Torres', hour=2, min=4, sec=5, had_reservation=False).

The implementation would just require putting a star '*' before all
options, according to pep 3102.

If needed, I can rewrite this as a PEP.

--
components: Library (Lib)
messages: 89850
nosy: ptn
severity: normal
status: open
title: Make all switches keyword-only
type: feature request
versions: Python 3.2

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



[issue6372] Make all switches keyword-only

2009-06-29 Thread Pablo Torres Navarrete

Pablo Torres Navarrete  added the comment:

OK, bad idea it is then.  Thank you for your time.

--

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



[issue5801] spurious empty lines in wsgiref code

2009-06-30 Thread Pablo Torres Navarrete

Pablo Torres Navarrete  added the comment:

I cleaned the rest of the module by shortening lines that are too long,
removing useless blocks of empty lines and adding whitespace around
operators and after commas.  Nothing in the programming logic was changed.

--
Added file: http://bugs.python.org/file14410/wsgiref-patch

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



[issue5801] spurious empty lines in wsgiref code

2009-06-30 Thread Pablo Torres Navarrete

Pablo Torres Navarrete  added the comment:

The patch applies to rev 73702 of the py3k branch.

--

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



[issue5801] spurious empty lines in wsgiref code

2009-06-30 Thread Pablo Torres Navarrete

Pablo Torres Navarrete  added the comment:

Oops, forgot to add the .diff extension so web browsers don't get
confused.  Their contents are the same though.

--
keywords: +patch
Added file: http://bugs.python.org/file14411/wsgiref-patch.diff

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