[issue13096] ctypes: segfault with large POINTER type names

2011-10-09 Thread Brian Brazil

Brian Brazil  added the comment:

The problem is around line 1734 of callproc.c in tip:

} else if (PyType_Check(cls)) {
typ = (PyTypeObject *)cls;
buf = alloca(strlen(typ->tp_name) + 3 + 1);
sprintf(buf, "LP_%s", typ->tp_name);   <-- segfault is here

Replacing the alloca with a malloc fixes it, so I presume it's hitting the 
stack size limit as 2^25 is 32MB (my stack limit is 8MB).

--
nosy: +bbrazil

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



[issue13050] RLock support the context manager protocol but this is not documented

2011-10-09 Thread Brian Brazil

New submission from Brian Brazil :

This is already documented:

http://docs.python.org/library/threading.html#using-locks-conditions-and-semaphores-in-the-with-statement

--
nosy: +bbrazil

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



[issue12923] test_urllib fails in refleak mode

2011-10-09 Thread Brian Brazil

Brian Brazil  added the comment:

This appears to fail every 9th, 19th, 29th, etc. repetition of the test. 

This seems to be something to do with the reference counting/close logic of the 
FakeSocket but I haven't managed to figure out what.

--
nosy: +bbrazil

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



[issue12923] test_urllib fails in refleak mode

2011-10-09 Thread Brian Brazil

Brian Brazil  added the comment:

The actual problem is that FancyURLOpener self.tries isn't being reset if the 
protocol is file://

I've attached a patch that'll help improve the test at least.

--
keywords: +patch
Added file: http://bugs.python.org/file23358/12923-unittest-improvement.patch

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



[issue12923] test_urllib fails in refleak mode

2011-10-09 Thread Brian Brazil

Brian Brazil  added the comment:

Here's a path to fix the problem.

--
Added file: http://bugs.python.org/file23359/12923-maxtries-reset.patch

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



[issue9921] os.path.join('x','') behavior

2011-06-23 Thread Brian Brazil

Brian Brazil  added the comment:

David's change sounds good to me.

--

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



[issue9758] ioctl mutable buffer copying problem

2010-09-04 Thread Brian Brazil

Brian Brazil  added the comment:

The attached patch fixes this.

--
keywords: +patch
nosy: +bbrazil
Added file: http://bugs.python.org/file18747/ioctl_1024_mutable.patch

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



[issue9747] os.getresgid() documentation mentions "user ids", not "group ids"

2010-09-04 Thread Brian Brazil

Brian Brazil  added the comment:

This mistake is also in the docstring, I've attached a path to fix both.

--
keywords: +patch
nosy: +bbrazil
Added file: http://bugs.python.org/file18748/getresgid_group_not_user.patch

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



[issue9776] Inconsistent spacing in fcntl.fcntl docstring

2010-09-04 Thread Brian Brazil

New submission from Brian Brazil :

The spacing in fcntl.fcntl's docstring isn't consistent, the attached patch 
fixes this.

--
assignee: d...@python
components: Documentation
files: fcntl_docstring_spacing.patch
keywords: patch
messages: 115582
nosy: bbrazil, d...@python
priority: normal
severity: normal
status: open
title: Inconsistent spacing in fcntl.fcntl docstring
versions: Python 3.2
Added file: http://bugs.python.org/file18749/fcntl_docstring_spacing.patch

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



[issue9758] ioctl mutable buffer copying problem

2010-09-04 Thread Brian Brazil

Brian Brazil  added the comment:

I'd already had a look around, and my knowledge of ioctls is not sufficient to 
answer that question but I suspect the answer is no. 

Does someone know of a ioctl that works across platforms, doesn't require 
specific hardware or privileges and that does some form of read operation?

--

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



[issue9921] os.path.join('x','') behavior

2010-09-23 Thread Brian Brazil

Brian Brazil  added the comment:

The behaviour is a bit more nuanced:
>>> os.path.join('x', '')
'x/'
>>> os.path.join('x', '', 'y')
'x/y'
>>> os.path.join('x', '', 'y', '', '')
'x/y/'
>>> os.path.join('', 'x')
'x'

I'm unsure how to word this best, maybe "non-trailing empty paths are ignored"?

--
nosy: +bbrazil

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



[issue9921] os.path.join('x','') behavior

2010-10-10 Thread Brian Brazil

Brian Brazil  added the comment:

That doesn't cover the os.path.join('', 'x') case, and I'm not sure it makes 
os.path.join('x//', 'y') clear - though that doesn't matter as much.

How about making (2) "the result is simply path2 when path1 is empty or path2 
is an absolute path?

--

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



[issue10245] Fix resource warnings in test_telnetlib

2010-10-30 Thread Brian Brazil

New submission from Brian Brazil :

Please see attached patch and "closing files and sockets in a timely manner in 
the stdlib" on python-dev.

--
components: Tests
files: test_telnetlib_fd_leak.patch
keywords: patch
messages: 119974
nosy: bbrazil, brett.cannon
priority: normal
severity: normal
status: open
title: Fix resource warnings in test_telnetlib
versions: Python 3.3
Added file: http://bugs.python.org/file19424/test_telnetlib_fd_leak.patch

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



[issue10246] uu.encode fd leak if arguments are filenames

2010-10-30 Thread Brian Brazil

New submission from Brian Brazil :

Please see attached patch, I'm not sure if this is the cleanest way to fix 
this. This also fixes the resource warnings in the test.

--
components: Library (Lib)
files: uu_fd_leak.patch
keywords: patch
messages: 119975
nosy: bbrazil, brett.cannon
priority: normal
severity: normal
status: open
title: uu.encode fd leak if arguments are filenames
versions: Python 3.3
Added file: http://bugs.python.org/file19425/uu_fd_leak.patch

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



[issue10246] uu.encode fd leak if arguments are filenames

2010-10-30 Thread Brian Brazil

Brian Brazil  added the comment:

How does v2 look?

--
Added file: http://bugs.python.org/file19426/uu_fd_leak_v2.patch

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



[issue10248] Fix resource warnings in test_xmlrpclib

2010-10-30 Thread Brian Brazil

New submission from Brian Brazil :

I'm not 100% comfortable with this patch as my knowledge of the xmlrpc 
interface is very limited, a simple p.close() would seem cleaner - but that 
doesn't work.

--
files: test_xmlrpclib_fd_leak.patch
keywords: patch
messages: 119983
nosy: bbrazil
priority: normal
severity: normal
status: open
title: Fix resource warnings in test_xmlrpclib
Added file: http://bugs.python.org/file19427/test_xmlrpclib_fd_leak.patch

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



[issue10249] Fix resource warnings in test_unicodedata

2010-10-30 Thread Brian Brazil

New submission from Brian Brazil :

Please see attached.

--
components: Library (Lib)
files: test_unicodedata_fd_leak.patch
keywords: patch
messages: 119984
nosy: bbrazil
priority: normal
severity: normal
status: open
title: Fix resource warnings in test_unicodedata
versions: Python 3.3
Added file: http://bugs.python.org/file19428/test_unicodedata_fd_leak.patch

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



[issue10250] Fix resource warnings in test_urllib2_localnet

2010-10-30 Thread Brian Brazil

New submission from Brian Brazil :

Please see attached, not sure this is quite right.

--
components: Tests
files: test_urllib2_localnet_fd_leak.patch
keywords: patch
messages: 119985
nosy: bbrazil
priority: normal
severity: normal
status: open
title: Fix resource warnings in test_urllib2_localnet
versions: Python 3.3
Added file: http://bugs.python.org/file19429/test_urllib2_localnet_fd_leak.patch

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



[issue10251] Fix resource warnings in test_file

2010-10-30 Thread Brian Brazil

New submission from Brian Brazil :

Please see attached.

--
components: Tests
files: test_file_fd_leak.patch
keywords: patch
messages: 119987
nosy: bbrazil
priority: normal
severity: normal
status: open
title: Fix resource warnings in test_file
versions: Python 3.3
Added file: http://bugs.python.org/file19430/test_file_fd_leak.patch

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



[issue10252] Fix resource warnings in distutil tests

2010-10-30 Thread Brian Brazil

New submission from Brian Brazil :

Please see attached.

--
assignee: tarek
components: Distutils
files: distutils_fd_leak.patch
keywords: patch
messages: 119988
nosy: bbrazil, eric.araujo, tarek
priority: normal
severity: normal
status: open
title: Fix resource warnings in distutil tests
versions: Python 3.3
Added file: http://bugs.python.org/file19431/distutils_fd_leak.patch

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



[issue10253] Fix fd leak in fileio.c and test resource warnings

2010-10-30 Thread Brian Brazil

New submission from Brian Brazil :

fileio_init will leak a fd if you open a file for append that isn't seekable. 
We should close this fd before returning the failure.

The attached patch fixes this and a resource warning in the tests, but I'm 
unsure if it'd be better to use internal_close. I'd want the error from the 
seek rather than any potential error from the close, so I think this is okay.

Regrtest is happy.

--
components: IO
files: fileio_fd_leak.patch
keywords: patch
messages: 119992
nosy: bbrazil
priority: normal
severity: normal
status: open
title: Fix fd leak in fileio.c and test resource warnings
versions: Python 3.3
Added file: http://bugs.python.org/file19432/fileio_fd_leak.patch

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



[issue10253] Fix fd leak in fileio.c and test resource warnings

2010-10-30 Thread Brian Brazil

Brian Brazil  added the comment:

Version 2 of the patch is attached.

This fixes a warning at line 256 in test_fileio.py:
f = _FileIO("/dev/tty", "a")
on my Hardy machine.

--
Added file: http://bugs.python.org/file19433/fileio_fd_leak_v2.patch

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



[issue10256] Fix resource warnings in test_pkgimport

2010-10-30 Thread Brian Brazil

New submission from Brian Brazil :

Please see attached patch.

--
components: Tests
files: test_pkgimport_fd_leak.patch
keywords: patch
messages: 120014
nosy: bbrazil
priority: normal
severity: normal
status: open
title: Fix resource warnings in test_pkgimport
versions: Python 3.3
Added file: http://bugs.python.org/file19436/test_pkgimport_fd_leak.patch

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



[issue10257] Fix resource warnings in test_os

2010-10-30 Thread Brian Brazil

New submission from Brian Brazil :

Please see attached.

--
components: Tests
files: test_os_fd_leak.patch
keywords: patch
messages: 120015
nosy: bbrazil
priority: normal
severity: normal
status: open
title: Fix resource warnings in test_os
versions: Python 3.3
Added file: http://bugs.python.org/file19437/test_os_fd_leak.patch

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



[issue10257] Fix resource warnings in test_os

2010-10-30 Thread Brian Brazil

Brian Brazil  added the comment:

I'm used to a slightly different style guide, v2 has the right indentation.

--
Added file: http://bugs.python.org/file19438/test_os_fd_leak_v2.patch

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



[issue10258] Fix resource warnings in distutil test_tokenize

2010-10-30 Thread Brian Brazil

New submission from Brian Brazil :

Please see attached patch.

--
components: Tests
files: test_tokenize_fd_leak.patch
keywords: patch
messages: 120019
nosy: bbrazil
priority: normal
severity: normal
status: open
title: Fix resource warnings in distutil test_tokenize
versions: Python 3.3
Added file: http://bugs.python.org/file19439/test_tokenize_fd_leak.patch

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



[issue10258] Fix resource warnings in test_tokenize

2010-10-31 Thread Brian Brazil

Brian Brazil  added the comment:

Fixing title.

--
title: Fix resource warnings in distutil test_tokenize -> Fix resource warnings 
in test_tokenize

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



[issue10264] Fix resource warnings in test_smtplib

2010-10-31 Thread Brian Brazil

New submission from Brian Brazil :

Please see attached.

--
components: Tests
files: test_smtplib_fd_leak.patch
keywords: patch
messages: 120047
nosy: bbrazil
priority: normal
severity: normal
status: open
title: Fix resource warnings in test_smtplib
versions: Python 3.3
Added file: http://bugs.python.org/file19444/test_smtplib_fd_leak.patch

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



[issue10265] Fix fd leak in sunau

2010-10-31 Thread Brian Brazil

New submission from Brian Brazil :

Please see attached.

It's possible that this change will lead to fds leaking if someone is passing 
in a fd, however a) this is consistent with how other modules (e.g. uu) do it 
and b) of the 2 (!) uses of this module I found on Google Codesearch, both pass 
in filenames.

--
components: Library (Lib)
messages: 120049
nosy: bbrazil
priority: normal
severity: normal
status: open
title: Fix fd leak in sunau
versions: Python 3.3

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



[issue10266] uu.decode fd leak if in_file is a filename

2010-10-31 Thread Brian Brazil

New submission from Brian Brazil :

I missed this when fixing issue 10246. The attached patch fixes this and adds a 
test that produces a resource warning with the old code.

--
components: Library (Lib)
files: uu_decode_fd_leak.patch
keywords: patch
messages: 120054
nosy: bbrazil
priority: normal
severity: normal
status: open
title: uu.decode fd leak if in_file is a filename
versions: Python 3.3
Added file: http://bugs.python.org/file19445/uu_decode_fd_leak.patch

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



[issue10265] Fix fd leak in sunau

2010-10-31 Thread Brian Brazil

Brian Brazil  added the comment:

That'd help alright.

--
keywords: +patch
Added file: http://bugs.python.org/file19446/sunau_fd_leak.patch

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



[issue10266] uu.decode fd leak if in_file is a filename

2010-10-31 Thread Brian Brazil

Brian Brazil  added the comment:

The patch is against current SVN.

--

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



[issue10265] Fix fd leak in sunau

2010-10-31 Thread Brian Brazil

Brian Brazil  added the comment:

Currently, if you pass in a fd it'll be closed by the __del__. My patch no 
longer does this so any use of the module depending on this behaviour could 
leak an fd. However, noone seems to use the module that way.

V2 attached.

--
Added file: http://bugs.python.org/file19447/sunau_fd_leak_v2.patch

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



[issue10246] uu.encode fd leak if arguments are filenames

2010-10-31 Thread Brian Brazil

Brian Brazil  added the comment:

The garbage collector should take care of the vast majority of these, it's only 
bugs in the C like issue 10253 that I'd worry about.

--

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



[issue10269] Fix some resource warnings in test_sax

2010-10-31 Thread Brian Brazil

New submission from Brian Brazil :

Please see attached.

--
components: Tests
files: test_sax_fd_leak.patch
keywords: patch
messages: 120077
nosy: bbrazil
priority: normal
severity: normal
status: open
title: Fix some resource warnings in test_sax
versions: Python 3.3
Added file: http://bugs.python.org/file19449/test_sax_fd_leak.patch

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



[issue10270] Fix resource warnings in test_threading

2010-10-31 Thread Brian Brazil

New submission from Brian Brazil :

Please see attached.

--
components: Tests
files: test_threading_fd_leak.patch
keywords: patch
messages: 120079
nosy: bbrazil
priority: normal
severity: normal
status: open
title: Fix resource warnings in test_threading
Added file: http://bugs.python.org/file19450/test_threading_fd_leak.patch

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



[issue10277] sax leaks a fd if source is a filename

2010-11-01 Thread Brian Brazil

New submission from Brian Brazil :

If saxutils.prepare_input_source is passed a filename or url, it'll end up 
leaking an fd via IncrementalParser.parse and ExpatParser.parse. This can be 
seen by enabling resource warnings and running test_sax.

This should be fixed.

--
components: Library (Lib)
messages: 120118
nosy: bbrazil
priority: normal
severity: normal
status: open
title: sax leaks a fd if source is a filename
versions: Python 3.3

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



[issue10252] Fix resource warnings in distutils

2010-11-02 Thread Brian Brazil

Brian Brazil  added the comment:

I don't see your patch on the other bug, so I've updated mine not to use with.

--
Added file: http://bugs.python.org/file19470/distutils_fd_leak_v2.patch

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



[issue11908] Weird `slice.stop or sys.maxint`

2012-07-07 Thread Brian Brazil

Brian Brazil  added the comment:

The attached patch fixes this

--
keywords: +patch
nosy: +bbrazil
Added file: http://bugs.python.org/file26283/issue11908-islice-docs.patch

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



[issue15130] remove redundant paragraph in socket howto

2012-07-07 Thread Brian Brazil

Brian Brazil  added the comment:

Issue confirmed, patch looks good.

--
nosy: +bbrazil

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



[issue15094] Incorrectly placed #endif in _tkinter.c.

2012-07-07 Thread Brian Brazil

Brian Brazil  added the comment:

Issue confirmed, patch looks good.

--
nosy: +bbrazil

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



[issue15002] urllib2 does not download 4 MB file completely using ftp

2012-07-07 Thread Brian Brazil

Brian Brazil  added the comment:

I've tested this on head, and the issue appears to be buggy ftp code in python.

>From the attached tcpdump for fetching delegated-ripencc-20120706:

12:57:19.933607 IP myhost.39627 > ftp.ripe.net.ftp: Flags [.], ack 511, win 
115, options [nop,nop,TS val 129353190 ecr 1632444059], length 0
12:57:19.934853 IP myhost.39627 > ftp.ripe.net.ftp: Flags [F.], seq 97, ack 
511, win 115, options [nop,nop,TS val 129353191 ecr 1632444059], length 0

and a bit later:

12:57:20.043701 IP ftp.ripe.net.42707 > myhost.50818: Flags [.], seq 
46337:47785, ack 1, win 227, options [nop,nop,TS val 2552550247 ecr 129353204], 
length 1448
12:57:20.043717 IP myhost.50818 > ftp.ripe.net.42707: Flags [.], ack 47785, win 
353, options [nop,nop,TS val 129353218 ecr 2552550247], length 0
12:57:20.043816 IP ftp.ripe.net.42707 > myhost.50818: Flags [FP.], seq 
47785:49153, ack 1, win 227, options [nop,nop,TS val 2552550247 ecr 129353204], 
length 1368
12:57:20.043992 IP myhost.50818 > ftp.ripe.net.42707: Flags [F.], seq 1, ack 
49154, win 376, options [nop,nop,TS val 129353218 ecr 2552550247], length 0
12:57:20.094067 IP ftp.ripe.net.42707 > myhost.50818: Flags [.], ack 2, win 
227, options [nop,nop,TS val 2552550299 ecr 129353218], length 0

As you can see we're sending a FIN without sending a close command to the 
control connection, and in response the server stops sending data about 49k in. 
Per RFC 959 section 2.3: "The server may abort data transfer if the control 
connections are closed without command." so this is acceptable behaviour on the 
part of the server, and means we need to keep the control connection open for 
longer.

--
nosy: +bbrazil
Added file: http://bugs.python.org/file26290/issue15002-tcpdump-early-fin

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



[issue15002] urllib2 does not download 4 MB file completely using ftp

2012-07-07 Thread Brian Brazil

Brian Brazil  added the comment:

More particularly, the ftpwrapper's ftp member is being GCed sometime after 
FtpHandler.ftp_open returns.

--

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



[issue10248] Fix resource warnings in test_xmlrpclib

2012-07-07 Thread Brian Brazil

Brian Brazil  added the comment:

Looks like someone else has already fixed this.

--
resolution:  -> out of date
status: open -> closed

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



[issue15277] Fix resource leak in support.py:_is_ipv6_enabled

2012-07-07 Thread Brian Brazil

New submission from Brian Brazil :

I'm running Ubuntu Precise and have net.ipv6.conf.all.disable_ipv6 = 1 in my 
sysctl.conf. With this configuration at head there's a fd leak in 
_is_ipv6_enabled in support.py when the bind fails, which the attached patch 
should fix.

--
components: Tests
files: ipv6-enabled-fd-leak-fix.patch
keywords: patch
messages: 164855
nosy: bbrazil
priority: normal
severity: normal
status: open
title: Fix resource leak in support.py:_is_ipv6_enabled
type: resource usage
versions: Python 3.4
Added file: http://bugs.python.org/file26299/ipv6-enabled-fd-leak-fix.patch

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



[issue15280] Don't use builtins as variable names in urllib.request

2012-07-07 Thread Brian Brazil

New submission from Brian Brazil :

See attached patch, there's still self.type in places. I also converted one map 
to a list comprehension.

--
components: Library (Lib)
files: urllib-request-cleanup-builtin-names.patch
keywords: patch
messages: 164874
nosy: bbrazil
priority: normal
severity: normal
status: open
title: Don't use builtins as variable names in urllib.request
versions: Python 3.4
Added file: 
http://bugs.python.org/file26304/urllib-request-cleanup-builtin-names.patch

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



[issue15284] Handle ipv6 not being enabled in test_socket

2012-07-07 Thread Brian Brazil

New submission from Brian Brazil :

If ipv6 is compiled in but disabled in the kernel then test_socket attempts to 
bind to ports and gets lots of stack traces. The attached patch skips the 
relevant tests.

--
components: Tests
files: ipv6-disabled-test-socket.patch
keywords: patch
messages: 164893
nosy: bbrazil
priority: normal
severity: normal
status: open
title: Handle ipv6 not being enabled in test_socket
versions: Python 3.4
Added file: http://bugs.python.org/file26305/ipv6-disabled-test-socket.patch

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



[issue15228] os.utime() docs not clear on behavior on nonexistant files

2012-07-07 Thread Brian Brazil

Brian Brazil  added the comment:

Here's a patch that should clarify this.

--
keywords: +patch
nosy: +bbrazil
Added file: http://bugs.python.org/file26306/issue15228-utime-touch-doc.patch

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



[issue15285] test_timeout failure when system on IPv4 10.x.x.x subnet

2012-07-08 Thread Brian Brazil

Brian Brazil  added the comment:

I don't think anything in 127/8 is going to work, all Debian/Ubuntu systems I'm 
aware of have all of 127/8 equivalent to 127.0.0.1.

Maybe 192.0.2.0/24 per RFC 5737?

A better solution might be to chose some host/port on a python.org server and 
set it to DROP tcp syn packets.

--
nosy: +bbrazil

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



[issue15284] Handle ipv6 not being enabled in test_socket

2012-07-08 Thread Brian Brazil

Changes by Brian Brazil :


--
resolution:  -> fixed
status: open -> closed

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



[issue15280] Don't use builtins as variable names in urllib.request

2012-07-14 Thread Brian Brazil

Brian Brazil  added the comment:

This patch is a result of frustration encountered when debugging #15002.
Not being able to use 'type' directly is rather annoying, so after figuring
that bug out I set some time aside to make it easier for the next person.

This could be considered a bug that urllib is hard to debug and breaks
vim's syntax highlighting.

--

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



[issue15285] test_timeout failure when system on IPv4 10.x.x.x subnet

2012-07-24 Thread Brian Brazil

Brian Brazil  added the comment:

There's already existing infrastructure not to run certain tests when
there's no internet connection, no ipv6, no tk etc.

--

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



[issue16081] Fix compile warnings in thread_pthread.h

2012-09-28 Thread Brian Brazil

New submission from Brian Brazil:

Please see attached patch to fix warnings about error being set but not used, 
I've eliminated error except for the one function that was using it.

--
components: Interpreter Core
files: pthread-warnings.patch
keywords: patch
messages: 171432
nosy: bbrazil
priority: normal
severity: normal
status: open
title: Fix compile warnings in thread_pthread.h
type: compile error
versions: Python 3.4
Added file: http://bugs.python.org/file27327/pthread-warnings.patch

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



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

2012-09-28 Thread Brian Brazil

Brian Brazil added the comment:

How does the attached patch look?

I also reworded the first line to be a bit clearer, and be under 80 chars.

--
keywords: +patch
nosy: +bbrazil
Added file: http://bugs.python.org/file27329/issue15350.patch

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



[issue15677] Gzip/zlib allows for compression level=0

2012-09-28 Thread Brian Brazil

Brian Brazil added the comment:

The attached patch fixes this.

--
keywords: +patch
nosy: +bbrazil
Added file: http://bugs.python.org/file27330/issue15677.patch

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



[issue16081] Fix compile warnings in thread_pthread.h

2012-09-30 Thread Brian Brazil

Brian Brazil added the comment:

I'm on gcc (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3, this was the only warning I 
saw (though I don't have all the optional libraries installed).

--

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



[issue9339] threading is_alive documnetation is unclear

2010-07-23 Thread Brian Brazil

New submission from Brian Brazil :

http://docs.python.org/py3k/library/threading.html

"Roughly, a thread is alive from the moment the start() method returns until 
its run() method terminates."

Using "Roughly" in relation to threading is a bit unspecific. I've had a look 
through _bootstrap_inner() and attached a patch to clarify this.

--
assignee: d...@python
components: Documentation
files: threading-roughly-doc-fix.patch
keywords: patch
messages: 111278
nosy: bbrazil, d...@python
priority: normal
severity: normal
status: open
title: threading is_alive documnetation is unclear
versions: Python 2.5, Python 2.6, Python 2.7, Python 3.1, Python 3.2, Python 3.3
Added file: http://bugs.python.org/file18140/threading-roughly-doc-fix.patch

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



[issue9339] threading is_alive documnetation is unclear

2010-07-23 Thread Brian Brazil

Changes by Brian Brazil :


Removed file: http://bugs.python.org/file18140/threading-roughly-doc-fix.patch

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



[issue9339] threading is_alive documnetation is unclear

2010-07-23 Thread Brian Brazil

Brian Brazil  added the comment:

Here's a slightly cleaner version.

--
Added file: http://bugs.python.org/file18141/threading-roughly-doc-fix.patch

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



[issue9346] Improve threading tests

2010-07-23 Thread Brian Brazil

New submission from Brian Brazil :

The attached patch:
Remove unused "self-test" from threading.py that doesn't really test much.

Add better testing for Thread.__repr__.

This brings coverage as measured by regrtest from 40% to 45%.

--
components: Interpreter Core
files: threading_test_cleanup.patch
keywords: patch
messages: 111313
nosy: bbrazil
priority: normal
severity: normal
status: open
title: Improve threading tests
type: feature request
versions: Python 3.2
Added file: http://bugs.python.org/file18145/threading_test_cleanup.patch

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



[issue9356] Improved tests and style for fnmatch

2010-07-23 Thread Brian Brazil

New submission from Brian Brazil :

The attached path adds tests for translate and filter, and also fixes a few 
style issues in fnmatch itself.

--
components: Interpreter Core
files: fnmatch_test_and_cleanup.patch
keywords: patch
messages: 111340
nosy: bbrazil
priority: normal
severity: normal
status: open
title: Improved tests and style for fnmatch
type: feature request
versions: Python 3.2
Added file: http://bugs.python.org/file18150/fnmatch_test_and_cleanup.patch

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



[issue9356] Improved tests and style for fnmatch

2010-07-23 Thread Brian Brazil

Changes by Brian Brazil :


Removed file: http://bugs.python.org/file18150/fnmatch_test_and_cleanup.patch

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



[issue9356] Improved tests and style for fnmatch

2010-07-23 Thread Brian Brazil

Brian Brazil  added the comment:

It helps if the diff is from the root...

--
Added file: http://bugs.python.org/file18151/fnmatch_test_and_cleanup.patch

___
Python tracker 
<http://bugs.python.org/issue9356>
___
___
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

2010-07-23 Thread Brian Brazil

Brian Brazil  added the comment:

I've updated the patch for 3.2 and improved the documentation formatting.

--
nosy: +bbrazil

___
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

2010-07-23 Thread Brian Brazil

Brian Brazil  added the comment:

Looks like it lost my patch, but Steven's does the same.

One tweak: in threading.rst put all of the class signature on one line or the 
html formatting will be a bit off.

--

___
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



[issue9357] Improve queue tests

2010-07-23 Thread Brian Brazil

New submission from Brian Brazil :

The attached patch improves the code coverage of queue to 98% by testing empty, 
full, put_nowait, get_nowait and some error conditions.

--
components: Library (Lib)
files: test_queue.patch
keywords: patch
messages: 111354
nosy: bbrazil
priority: normal
severity: normal
status: open
title: Improve queue tests
versions: Python 3.2
Added file: http://bugs.python.org/file18154/test_queue.patch

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



[issue9358] Document fnmatch.translate's lack of support for escaping

2010-07-23 Thread Brian Brazil

New submission from Brian Brazil :

fnmatch.translate's docstraing says "There is no way to quote 
meta-characters.", but this isn't in the html docs. The attached patch fixes 
that.

--
assignee: d...@python
components: Documentation
files: fnmatch_translate_doc.patch
keywords: patch
messages: 111358
nosy: bbrazil, d...@python
priority: normal
severity: normal
status: open
title: Document fnmatch.translate's lack of support for escaping
versions: Python 2.7, Python 3.2
Added file: http://bugs.python.org/file18156/fnmatch_translate_doc.patch

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



[issue4608] urllib.request.urlopen does not return an iterable object

2010-08-08 Thread Brian Brazil

Brian Brazil  added the comment:

This looks as though its a short write:

[pid 28343] recvfrom(5, "GET / HTTP/1.1\r\nAccept-Encoding:"..., 8192, 0, NULL, 
NULL) = 118
[pid 28343] poll([{fd=5, events=POLLOUT, revents=POLLOUT}], 1, 1) = 1
[pid 28343] sendto(5, "HTTP/1.0 200 OK\r\n", 17, 0, NULL, 0) = 17
[pid 28343] poll([{fd=5, events=POLLOUT, revents=POLLOUT}], 1, 1) = 1
[pid 28343] sendto(5, "Server: TestHTTP/ Python/3.2a1+\r"..., 33, 0, NULL, 0) = 
33
[pid 28343] poll([{fd=5, events=POLLOUT, revents=POLLOUT}], 1, 1) = 1
[pid 28343] sendto(5, "Date: Sun, 08 Aug 2010 09:41:08 "..., 37, 0, NULL, 0) = 
37
[pid 28343] poll([{fd=5, events=POLLOUT, revents=POLLOUT}], 1, 1) = 1
[pid 28343] sendto(5, "Content-type: text/plain\r\n", 26, 0, NULL, 0) = 26
[pid 28343] poll([{fd=5, events=POLLOUT, revents=POLLOUT}], 1, 1) = 1
[pid 28343] sendto(5, "\r\n", 2, 0, NULL, 0) = 2
[pid 28343] poll([{fd=5, events=POLLOUT, revents=POLLOUT}], 1, 1) = 1
[pid 28343] sendto(5, "verylongverylongverylongverylong"..., 56001, 0, NULL, 0) 
= 49054
[pid 28343] shutdown(5, 1 /* send */)   = 0

--
nosy: +bbrazil

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



[issue4608] urllib.request.urlopen does not return an iterable object

2010-08-08 Thread Brian Brazil

Brian Brazil  added the comment:

The attached patch handles short writes, and adds ajaksu2's tests.

--
Added file: http://bugs.python.org/file18433/tests-iter-urllib-py3k.patch

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



[issue6005] Bug in socket example

2010-08-08 Thread Brian Brazil

Brian Brazil  added the comment:

I've updated this patch to apply cleanly to 2.7, and also adapted it to for 
py3k. I added a small tweak to the example description in socket.rst.

I've tested the instructions for both 2.7 and 3k and verified they still work 
as expected.

--
nosy: +bbrazil
versions: +Python 2.7, Python 3.3 -Python 2.6
Added file: http://bugs.python.org/file18435/socket-sendall-doc-2.7.patch

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



[issue6005] Bug in socket example

2010-08-08 Thread Brian Brazil

Changes by Brian Brazil :


Added file: http://bugs.python.org/file18436/socket-sendall-doc-py3k.patch

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



[issue1076515] shutil.move clobbers read-only files.

2010-08-08 Thread Brian Brazil

Brian Brazil  added the comment:

Here's a quick test:

Python 3.2a1+ (py3k:83811, Aug  8 2010, 09:00:22) 
[GCC 4.2.4 (Ubuntu 4.2.4-1ubuntu4)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import os, shutil
>>> open('a', 'w').write('a')
1
>>> open('b', 'w').write('b')
1
>>> os.chmod('b', 000)
>>> shutil.move('a', 'b')
>>> open('b').read()
'a'
>>> 

This is the correct behaviour on Unix, so I'd say this can be closed off.

--
nosy: +bbrazil

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



[issue9292] Dead code in Modules/pyexpat.c

2010-08-08 Thread Brian Brazil

Brian Brazil  added the comment:

The attached patch removes the dead code, regrtest is happy.

--
keywords: +patch
nosy: +bbrazil
Added file: http://bugs.python.org/file18438/xmlparse_ParseFile-dead-code.patch

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