[issue1887] distutils doesn't support out-of-source builds

2011-10-03 Thread Matt Joiner

Changes by Matt Joiner :


--
nosy: +anacrolix

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



[issue13321] fstat doesn't accept an object with "fileno" method

2011-11-01 Thread Matt Joiner

New submission from Matt Joiner :

os.fstat doesn't not accept an object with the fileno() method.

Probably a bunch of other similar functions will not either.

In some parts of the standard library it's common practice to call 
PyObject_AsFileDescriptor on fd-wrapping arguments.

http://hg.python.org/cpython/file/d877d7f3b679/Modules/posixmodule.c#l7319
http://hg.python.org/cpython/file/d877d7f3b679/Objects/fileobject.c#l196

--
components: Library (Lib)
messages: 146823
nosy: anacrolix
priority: normal
severity: normal
status: open
title: fstat doesn't accept an object with "fileno" method
type: behavior
versions: Python 3.2, Python 3.3

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



[issue12684] profile does not dump stats on exception like cProfile does

2011-11-01 Thread Matt Joiner

Matt Joiner  added the comment:

Also affects 3.3.

--
versions: +Python 3.3

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



[issue12684] profile does not dump stats on exception like cProfile does

2011-11-01 Thread Matt Joiner

Changes by Matt Joiner :


--
resolution:  -> works for me
status: open -> languishing

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



[issue12822] NewGIL should use CLOCK_MONOTONIC if possible.

2011-11-25 Thread Matt Joiner

Changes by Matt Joiner :


--
nosy: +anacrolix

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



[issue13694] asynchronous connect in asyncore.dispatcher does not set addr

2012-01-01 Thread Matt Joiner

New submission from Matt Joiner :

Patch attached

--
components: Library (Lib)
files: dispatcher_connect_addr.patch
keywords: patch
messages: 150449
nosy: anacrolix
priority: normal
severity: normal
status: open
title: asynchronous connect in asyncore.dispatcher does not set addr
type: behavior
versions: Python 2.6, Python 2.7, Python 3.1, Python 3.2, Python 3.3
Added file: http://bugs.python.org/file24124/dispatcher_connect_addr.patch

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



[issue13694] asynchronous connect in asyncore.dispatcher does not set addr

2012-01-02 Thread Matt Joiner

Matt Joiner  added the comment:

I don't believe it is. dispatcher.addr is only set if the connection is 
immediately established. It's set explicitly in dispatcher.__init__ if a socket 
is provided that is already connected. It's *not* set after a connection 
completes.

There are 2 solutions as I see it:

1) Set addr after a successful call to socket.connect indicates that a 
connection is being established. Currently this only occurs if the connection 
is not delayed.
2) Set the addr when a connect event completes. This would require making 
getpeername calls like in dispatcher.__init__ and would be significantly more 
expensive.

My patch implements method 1. This conforms to existing addr-setting behaviour 
in dispatcher.bind.

--

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



[issue9674] make install DESTDIR=/home/blah fails when the prefix specified is /

2011-06-13 Thread Matt Joiner

Matt Joiner  added the comment:

Just ran into this bug myself with 3.2. Apparently this patch works: 
http://groups.google.com/group/comp.lang.python/msg/bd8818ab9d4af8d7

--
nosy: +anacrolix

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



[issue9674] make install DESTDIR=/home/blah fails when the prefix specified is /

2011-06-13 Thread Matt Joiner

Matt Joiner  added the comment:

Attached a patch that fixes it, only the line numbers have changed from Martin 
v. Loewis's patch. Used on 3.2.

--
Added file: http://bugs.python.org/file22360/fix-root-prefix.patch

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



[issue9674] make install DESTDIR=/home/blah fails when the prefix specified is /

2011-06-13 Thread Matt Joiner

Changes by Matt Joiner :


--
components: +Build, Library (Lib)
nosy: +alexis
type: behavior -> compile error

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



[issue12437] _ctypes.dlopen does not include errno in OSError

2011-06-28 Thread Matt Joiner

New submission from Matt Joiner :

_ctypes.dlopen is not including the errno when it raises OSError.

This occurs when attempting to load a library that doesn't exist, the error 
string given is clearly generated from an ENOENT.

joiner@dbssyd800:~$ python3 dlopen_raise.py
None
somelib.so: cannot open shared object file: No such file or directory

--
components: ctypes
files: dlopen_raise.py
messages: 139382
nosy: anacrolix
priority: normal
severity: normal
status: open
title: _ctypes.dlopen does not include errno in OSError
type: behavior
versions: Python 2.7, Python 3.2
Added file: http://bugs.python.org/file22512/dlopen_raise.py

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



[issue12447] ~True is not False

2011-06-29 Thread Matt Joiner

New submission from Matt Joiner :

Given there is no ! operator in Python, I next tried ~ (despite that I'm after 
a logical not). This came as a surprise:

>>> bool(~True)
True
>>> bool(~False)
True
>>> bool(~~False)
False
>>> ~True, ~~True, ~False, ~~False
(-2, 1, -1, 0)

Is there any consideration to "fixing" this? Is int(True) 1 due to C? Why is it 
preferred over -1?

It seems more appropriate to me that True have:

def __invert__(self): return False
def __int__(self): return 1 # or even -1

This also "fixes" this case too:

>>> -True
-1

--
components: Interpreter Core
messages: 139458
nosy: anacrolix
priority: normal
severity: normal
status: open
title: ~True is not False
type: behavior
versions: Python 2.6, Python 2.7, Python 3.1, Python 3.2, Python 3.3, Python 3.4

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



[issue12448] smtplib's __main__ doesn't flush when prompting

2011-06-29 Thread Matt Joiner

New submission from Matt Joiner :

The smptlib module's __main__ doesn't flush stdout when prompting:

sys.stdout.write(prompt + ": ")
return sys.stdin.readline().strip()

stdout is usually line buffered, and so running python3 smptlib.py doesn't 
actually prompt the user.

The line `sys.stdout.flush()` needs to be added.

--
components: Library (Lib)
messages: 139461
nosy: anacrolix
priority: normal
severity: normal
status: open
title: smtplib's __main__ doesn't flush when prompting
type: behavior
versions: Python 3.2

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



[issue4768] email.generator.Generator object bytes/str crash - b64encode() bug?

2011-07-05 Thread Matt Joiner

Changes by Matt Joiner :


--
nosy: +anacrolix

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



[issue10278] add time.wallclock() method

2011-07-07 Thread Matt Joiner

Matt Joiner  added the comment:

What's the status of this bug? This is a very useful feature, I've had to use 
and add bindings to monotonic times for numerous applications. Can it make it 
into 3.3?

--

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



[issue5505] sys.stdin.read() doesn't return after first EOF on Windows

2011-07-13 Thread Matt Joiner

Matt Joiner  added the comment:

I get this on Linux with ^D

--
nosy: +anacrolix

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



[issue5505] sys.stdin.read() doesn't return after first EOF on Windows

2011-07-18 Thread Matt Joiner

Matt Joiner  added the comment:

Feel like a total noob: Where do I get the latest source? I can't find any 
pre-release tarballs for 3.3, and the suggested py3k checkout doesn't work: $ 
hg clone http://hg.python.org/cpython#py3k py3k
abort: unknown revision 'py3k'!

--

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



[issue5505] sys.stdin.read() doesn't return after first EOF on Windows

2011-07-18 Thread Matt Joiner

Matt Joiner  added the comment:

This version is fixed for me:

$ ./python
Python 3.3.0a0 (default:7520f1bf0a81, Jul 18 2011, 17:12:12)
[GCC 4.1.2 20070115 (SUSE Linux)] on linux2

--
versions: +Python 3.2

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



[issue12591] configparser can't read_file the output of subprocess.Popen

2011-07-19 Thread Matt Joiner

New submission from Matt Joiner :

>>> a = subprocess.Popen(['cat', '/path/to/text.ini'], stdout=subprocess.PIPE, 
>>> universal_newlines=True)
>>> b = configparser.ConfigParser()
>>> b.read_file(a.stdout)
Traceback (most recent call last):
  File "", line 1, in 
  File "/hostname/sig/local/lib/python3.2/configparser.py", line 708, in 
read_file
self._read(f, source)
  File "/hostname/sig/local/lib/python3.2/configparser.py", line 994, in _read
for lineno, line in enumerate(fp, start=1):
AttributeError: '_io.FileIO' object has no attribute 'read1'

Also this fails without universal_readlines, which is not so bad except that 
the name 'read_file' doesn't exactly indicate this.

I found one mildly related bug: http://bugs.python.org/issue11670

--
components: IO, Interpreter Core, Library (Lib)
messages: 140720
nosy: anacrolix
priority: normal
severity: normal
status: open
title: configparser can't read_file the output of subprocess.Popen
versions: Python 3.2

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



[issue12679] ThreadError is not in threading.__all__

2011-08-01 Thread Matt Joiner

New submission from Matt Joiner :

>>> from threading import *
>>> ThreadError
Traceback (most recent call last):
  File "", line 1, in 
NameError: name 'ThreadError' is not defined

--
components: Library (Lib)
files: export-thread-error.patch
keywords: patch
messages: 141546
nosy: anacrolix
priority: normal
severity: normal
status: open
title: ThreadError is not in threading.__all__
versions: Python 3.2
Added file: http://bugs.python.org/file22827/export-thread-error.patch

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



[issue12684] profile does not dump stats on exception like cProfile does

2011-08-02 Thread Matt Joiner

New submission from Matt Joiner :

Here's a patch that fixes it.

--
components: Library (Lib)
files: exception-in-profile.patch
keywords: patch
messages: 141591
nosy: anacrolix
priority: normal
severity: normal
status: open
title: profile does not dump stats on exception like cProfile does
type: behavior
versions: Python 3.2
Added file: http://bugs.python.org/file22829/exception-in-profile.patch

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



[issue12437] _ctypes.dlopen does not include errno in OSError

2011-08-02 Thread Matt Joiner

Matt Joiner  added the comment:

Should I just submit a patch for this myself? Can someone confirm the behaviour 
is incorrect so I don't waste time fixing it?

--

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



[issue12437] _ctypes.dlopen does not include errno in OSError

2011-08-08 Thread Matt Joiner

Matt Joiner  added the comment:

I didn't notice there was no use of errno. It's quite possible that dlopen 
might be used without the C library present, so perhaps this is why it wasn't 
included. The error strings however are very C-like, which made me think of 
this in the first place. Thanks all.

--
status: pending -> open

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



[issue9723] Add shlex.quote

2011-08-12 Thread Matt Joiner

Matt Joiner  added the comment:

Why can't pipes.quote can't be moved to shlex.quote verbatim as I originally 
proposed?

Is there justification to also change it as part of the relocation? I think any 
changes to its behaviour should be a separate issue.

--

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



[issue12813] uuid4 is not tested if a uuid4 system routine isn't present

2011-08-21 Thread Matt Joiner

New submission from Matt Joiner :

The uuid.uuid4 function is not tested if a C system routine is not present, 
despite that uuid4 has several fallback clauses. This patch will test at least 
the first fallback.

--
components: Library (Lib)
files: uuid4-test-no-system-routine-fallback.patch
keywords: patch
messages: 142688
nosy: anacrolix
priority: normal
severity: normal
status: open
title: uuid4 is not tested if a uuid4 system routine isn't present
type: behavior
versions: Python 3.3
Added file: 
http://bugs.python.org/file22993/uuid4-test-no-system-routine-fallback.patch

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



[issue5421] Irritating error message by socket's sendto method

2011-02-25 Thread Matt Joiner

Changes by Matt Joiner :


--
nosy: +anacrolix

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



[issue5421] Irritating error message by socket's sendto method

2011-03-17 Thread Matt Joiner

Matt Joiner  added the comment:

This bug is very misleading in Py3, as the TypeError makes one think that a 
string is being passed rather than bytes (how else do you get a 2 argument 
function call wrong?). Very difficult to determine that this is not in fact the 
bug in a dynamically typed language :P

--

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



[issue3136] [PATCH] logging.config.fileConfig() compulsivly disable all existing loggers

2011-04-08 Thread Matt Joiner

Changes by Matt Joiner :


--
nosy: +anacrolix

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



[issue3831] Multiprocessing: Expose underlying pipe in queues

2011-04-08 Thread Matt Joiner

Changes by Matt Joiner :


--
nosy: +anacrolix

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



[issue3831] Multiprocessing: Expose underlying pipe in queues

2011-04-08 Thread Matt Joiner

Matt Joiner  added the comment:

I look forward to this, or something similar. Inspiration can be taken from 
Golangs's select behaviour on channels.

select {
case i1 = <-c1:
print("received ", i1, " from c1\n")
case c2 <- i2:
print("sent ", i2, " to c2\n")

default:
print("no communication\n")
}

--

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



[issue4761] create Python wrappers for openat() and others

2010-12-20 Thread Matt Joiner

Changes by Matt Joiner :


--
nosy: +anacrolix

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



[issue10278] add time.wallclock() method

2011-01-14 Thread Matt Joiner

Matt Joiner  added the comment:

This is sorely needed. IMO the current behaviour of time.clock works for 
Windows, and clock_gettime(CLOCK_MONOTONIC) on POSIX or 
clock_gettime(CLOCK_MONOTONIC_RAW) on Linux>=2.6.28.

There are some related discussions on StackOverflow that may contain useful 
ideas also:
http://stackoverflow.com/questions/1205722/how-do-i-get-monotonic-time-durations-in-python
http://stackoverflow.com/questions/4687408/retrieve-wall-time-in-python-using-the-standard-library

--
nosy: +anacrolix

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



[issue2987] RFC2732 support for urlparse (IPv6 addresses)

2011-01-20 Thread Matt Joiner

Changes by Matt Joiner :


--
nosy: +anacrolix

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



[issue9723] pipes.quote() needs to be documented

2011-01-20 Thread Matt Joiner

Matt Joiner  added the comment:

I agree, I discovered this function (pipes.quote) only through recommendation 
here:

http://stackoverflow.com/questions/4748344/whats-the-reverse-of-shlex-split

I suggest that it be added to shlex, perhaps as shlex.quote. While the quoting 
style it performs, and the module it's found in are specific to Unix tools, the 
shlex module is available on non-Unix platforms. To this end, adding the 
function to shlex would make it available elsewhere, as well as be 
appropriately shell-related.

--
nosy: +anacrolix

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



[issue9723] pipes.quote() needs to be documented

2011-01-22 Thread Matt Joiner

Matt Joiner  added the comment:

Two reasons: The pipes module is Unix only, but pipes.quote is useful on all 
platforms. Secondly pipes.quote pertains to shell command-lines, this is also 
the domain of shlex which already cross platform. In pipes, an import 
shlex.quote would more than sufficient.

If this belongs in another separate bug I shall submit one. Please advise.

--

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



[issue10882] Add os.sendfile()

2011-01-24 Thread Matt Joiner

Matt Joiner  added the comment:

I notice Linux is described as not taking count=0 to mean to send until the end 
of "in" is reached. Is it possible to pass (size_t)-1 to this field if None is 
given, or do a loop on non-zero counts from sendfile to emulate this?

I poked around the linux source for 2.6.32, and it appears sendfile() is 
emulated on top of splice(), but this doesn't provide undocumented count=0 
handling as I was hoping.

--
nosy: +anacrolix

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



[issue10882] Add os.sendfile()

2011-01-28 Thread Matt Joiner

Matt Joiner  added the comment:

I have a few problems with these parts of the latest patch:

+   The second case may be used on Mac OS X and FreeBSD where *headers*
+   and *trailers* are arbitrary sequences of buffers that are written before 
and
+   after the data from *in* is written. It returns the same as the first case.

Why special case these? Why can't Mac OS X and FreeBSD write those manually 
into the output file descriptor. It's presumptious but I don't see why 
something so easy to do explicitly is mashed into the interface here, just 
pretend it doesn't exist. For the sake of simplicity (and sendfile might become 
very popular in future code), just drop this "feature".

for h in headers: out.write(h)
os.sendfile(out, in, offset, count)
for t in trailers: out.write(t)

+   On Mac OS X and FreeBSD, a value of 0 for *count* specifies to send until
+   the end of *in* is reached.

Again this should be emulated where it's not available, as it's very common, 
and a logical feature to have. However as indicated earlier, if os.sendfile is 
a minimal syscall wrapper, some thought needs to be given to a "higher-level" 
function, that also includes my other suggestions.

+   On Solaris, *out* may be the file descriptor of a regular file or the file
+   descriptor of a socket. On all other platforms, *out* must be the file
+   descriptor of an open socket

I'm pretty sure that Solaris isn't the only platform that supports non-socket 
file descriptors here, Linux (the platform I'm using), is one such case. As a 
general rule, we want to allow any file descriptors, and not restrict to 
sockets (except for awful platforms like Windows).

--

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



[issue10882] Add os.sendfile()

2011-01-28 Thread Matt Joiner

Matt Joiner  added the comment:

Thanks for catching that:

Presently  (Linux  2.6.9):  in_fd, must correspond to a file which sup‐
   ports mmap(2)-like operations (i.e., it cannot be a socket); and out_fd
   must refer to a socket.

Despite the fact the manpage hasn't changed since 2004, sendfile still only 
works for sockets. :(

--

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



[issue8300] Allow struct.pack to handle objects with an __index__ method.

2011-02-19 Thread Matt Joiner

Matt Joiner  added the comment:

Why isn't this implemented to work with __int__ as well?

--
nosy: +anacrolix

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



[issue8300] Allow struct.pack to handle objects with an __index__ method.

2011-02-19 Thread Matt Joiner

Matt Joiner  added the comment:

Thanks Mark for clearing that up. I found this link to be useful in explaining 
the purpose of __index__: 
http://docs.python.org/release/2.5.1/whatsnew/pep-357.html

I think the choice of allowing only __index__ was the right choice.

--

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



[issue11264] Format Specification Mini-Language missing type 'i'?

2011-02-20 Thread Matt Joiner

New submission from Matt Joiner :

The Format Specification Mini-Language is missing type 'i', generally the same 
as 'd', and ubiquitous in the libraries from which the specification is 
derived. See the 'd,i' conversion specifier in C: 
http://linux.die.net/man/3/printf, and the Old String Formatting Operations: 
http://docs.python.org/dev/py3k/library/stdtypes.html#old-string-formatting-operations.

>>> '{:d}'.format(3)
'3'
>>> '{:i}'.format(3)
Traceback (most recent call last):
  File "", line 1, in 
ValueError: Unknown format code 'i' for object of type 'int'

--
components: Interpreter Core
messages: 128934
nosy: anacrolix
priority: normal
severity: normal
status: open
title: Format Specification Mini-Language missing type 'i'?
versions: Python 2.6, Python 2.7, Python 3.2, Python 3.3

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



[issue11264] Format Specification Mini-Language missing type 'i'?

2011-02-21 Thread Matt Joiner

Matt Joiner  added the comment:

Is there any reason 'd' was chosen over 'i'? Is there a more appropriate place 
I can find this out?

--

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



[issue7916] zipfile.ZipExtFile passes long to fileobj.read()

2010-02-12 Thread Matt Joiner

New submission from Matt Joiner :

When reading from the fileobj passed in it's constructor, zipfile.ZipExtFile 
passes a long into fileobj.read(). This is not normally an issue, except in 
io.BytesIO, for which the source is in C, and throws TypeError for 
type(bufsize) != int.

>From what I can ascertain from the source, io.BytesIO.read() only expects an 
>int because this type is merged with long in Python3*. I also believe 
>io.BytesIO may have been backported and so this difference in the treatment of 
>int and long was not picked up.

I have attached a test demonstrating the type failure, with comments for it's 
testing under Python3, where this evidently doesn't occur. It also compares 
results with io.BytesIO's predecessors, StringIO and cStringIO.

I would attach a patch but I'm unsure of the general process, so here instead 
are relevant lines of interest from the 2.6.4 vanilla source:
zipfile.py:447 ZipExtFile.bytes_read is assigned a long
zipfile.py:594 a long is passed to a fileobj (such as io.BytesIO)
_bytesio.c:222 the type of the argument to io.BytesIO.read() is checked to be 
an int

--
components: Library (Lib)
files: zipfile_testcase.py
messages: 99260
nosy: anacrolix
severity: normal
status: open
title: zipfile.ZipExtFile passes long to fileobj.read()
type: behavior
versions: Python 2.6
Added file: http://bugs.python.org/file16217/zipfile_testcase.py

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



[issue13322] The io module doesn't support non-blocking files

2019-10-10 Thread Matt Joiner


Change by Matt Joiner :


--
nosy:  -anacrolix

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



[issue41564] Cannot access member "hex" for type "ByteString"

2020-08-16 Thread Matt Joiner


New submission from Matt Joiner :

I get this error when running pyright for a type of typing.ByteString. All the 
implementations of ByteString (bytes, bytearray, memoryview) have the hex 
method, so this seems unexpected?

--
components: Library (Lib)
messages: 375523
nosy: anacrolix
priority: normal
severity: normal
status: open
title: Cannot access member "hex" for type "ByteString"
type: behavior
versions: Python 3.8

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



[issue41564] Cannot access member "hex" for type "ByteString"

2020-08-17 Thread Matt Joiner


Matt Joiner  added the comment:

https://github.com/python/cpython/blob/48b069a003ba6c684a9ba78493fbbec5e89f10b8/Lib/_collections_abc.py#L953

https://github.com/python/cpython/blob/0e95bbf08571e98f4b688524efc2dcf20d315d91/Lib/typing.py#L1612

--
status: pending -> open

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



[issue41564] Cannot access member "hex" for type "ByteString"

2020-08-23 Thread Matt Joiner


Change by Matt Joiner :


Added file: https://bugs.python.org/file49423/hex.py

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



[issue41564] Cannot access member "hex" for type "ByteString"

2020-08-23 Thread Matt Joiner


Matt Joiner  added the comment:

$ pyright hex.py 
stubPath /Users/anacrolix/src/dht-scraper/typings is not a valid directory.
Assuming Python platform Darwin
Searching for source files
Found 1 source file
/Users/anacrolix/src/dht-scraper/hex.py
  3:9 - error: Cannot access member "hex" for type "ByteString"
  Member "hex" is unknown (reportGeneralTypeIssues)
1 error, 0 warnings 
Completed in 0.562sec
anacrolix@anacrolix-mbp-2018:~/src/dht-scraper$ mypy hex.py 
hex.py:3: error: "ByteString" has no attribute "hex"
Found 1 error in 1 file (checked 1 source file)
anacrolix@anacrolix-mbp-2018:~/src/dht-scraper$ python3 hex.py 
deadbeef

--

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



[issue41564] Cannot access member "hex" for type "ByteString"

2020-08-23 Thread Matt Joiner


Matt Joiner  added the comment:

I do not think so. mypy has the same issue. The ByteString type does not 
include the methods shared by all its implementations. I already linked to this 
in https://bugs.python.org/msg375553. I also showed that mypy doesn't work in 
my last comment.

--

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



[issue13791] Other versions

2012-01-15 Thread Matt Joiner

New submission from Matt Joiner :

The navigation region at http://docs.python.org/dev/ should list "Other 
versions" instead of "Old versions" as the in development docs are also 
available here.

Docs for other versions
Python 2.7 (stable)
Python 3.2 (stable)
Old versions

Unreleased, development versions of the documentation. This may contain more 
information than the current released documentation.

http://www.python.org/doc/versions/

--
assignee: docs@python
components: Documentation
messages: 151281
nosy: anacrolix, docs@python
priority: normal
severity: normal
status: open
title: Other versions
type: enhancement
versions: Python 2.6, Python 2.7, Python 3.1, Python 3.2, Python 3.3, Python 3.4

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



[issue13839] -m pstats should combine all the profiles given as arguments

2012-01-22 Thread Matt Joiner

New submission from Matt Joiner :

Frequently when profiling multiple threads, I need to combine several dump stat 
files. Currently -m pstats reads the profiling data at only the first path 
given. It should merge all the profiling data from all the paths given.

$ python3.3 -m pstats prof/5506-7f00f*

Minimalist patch attached.

--
components: Library (Lib)
files: m-pstats-merge-profiles.patch
keywords: patch
messages: 151795
nosy: anacrolix
priority: normal
severity: normal
status: open
title: -m pstats should combine all the profiles given as arguments
type: enhancement
versions: Python 2.6, Python 2.7, Python 3.1, Python 3.2, Python 3.3, Python 3.4
Added file: http://bugs.python.org/file24294/m-pstats-merge-profiles.patch

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



[issue12684] profile does not dump stats on exception like cProfile does

2012-01-22 Thread Matt Joiner

Changes by Matt Joiner :


--
resolution: works for me -> 
status: languishing -> open
versions: +Python 3.4

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



[issue13858] readline fails on nonblocking, unbuffered io.FileIO objects

2012-01-24 Thread Matt Joiner

New submission from Matt Joiner :

_io._IOBase.readline doesn't seem to like _io.FileIO.read returning None, which 
occurs when it's unbuffered and nonblocking. (Modules/_io/fileio.c:745 in 
trunk). Can this be handled some other way?

$ python3.3
Python 3.3.0a0 (default:fb0f4fe8123e+, Jan 24 2012, 11:21:36) 
[GCC 4.6.2] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import os, io
>>> r, w = os.pipe2(os.O_NONBLOCK)
>>> f = io.open(r, 'rb', 0)
>>> f.readline()
Traceback (most recent call last):
  File "", line 1, in 
OSError: read() should have returned a bytes object, not 'NoneType'

--
components: IO, Library (Lib)
messages: 151933
nosy: anacrolix
priority: normal
severity: normal
status: open
title: readline fails on nonblocking, unbuffered io.FileIO objects
type: behavior
versions: Python 3.3

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



[issue13322] buffered read() and write() does not raise BlockingIOError

2012-01-25 Thread Matt Joiner

Matt Joiner  added the comment:

The patches only fix write? What about read?

http://bugs.python.org/issue13858

--
nosy: +anacrolix

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



[issue13859] Lingering StandardError in logging module

2012-01-25 Thread Matt Joiner

New submission from Matt Joiner :

There's a lingering StandardError referenced in the logging module.

StandardError was removed in Python 3, and execution across this code path 
generates a NameError:

  File "/home/matt/src/cpython/Lib/logging/__init__.py", line 291, in __init__
except StandardError: #pragma: no cover
NameError: global name 'StandardError' is not defined

Patch attached.

--
components: 2to3 (2.x to 3.x conversion tool), Library (Lib)
files: logging-uncovered-standarderror.patch
keywords: patch
messages: 151948
nosy: anacrolix
priority: normal
severity: normal
status: open
title: Lingering StandardError in logging module
type: behavior
versions: Python 3.3
Added file: 
http://bugs.python.org/file24322/logging-uncovered-standarderror.patch

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



[issue13859] Lingering StandardError in logging module

2012-01-25 Thread Matt Joiner

Matt Joiner  added the comment:

Interesting this also occurs in 3.2 and 2.7, but not 2.6 or 3.1. It's probably 
not an error in 2.x tho.

--
versions: +Python 2.7, Python 3.2

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



[issue13859] Lingering StandardError in logging module

2012-01-25 Thread Matt Joiner

Matt Joiner  added the comment:

Cheers, thanks for the fast turn around.

--

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



[issue13872] socket.detach doesn't mark socket._closed

2012-01-26 Thread Matt Joiner

New submission from Matt Joiner :

socket.socket.detach doesn't mark the socket._closed flag. The flag is specific 
to the Python wrapper, so the fix is put there. Test included.

--
components: Library (Lib)
files: socket-detach-mark-closed.patch
keywords: patch
messages: 152005
nosy: anacrolix
priority: normal
severity: normal
status: open
title: socket.detach doesn't mark socket._closed
type: behavior
versions: Python 2.6, Python 2.7, Python 3.1, Python 3.2, Python 3.3
Added file: http://bugs.python.org/file24327/socket-detach-mark-closed.patch

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



[issue13894] threading._CRLock should not be tested if _thread.RLock isn't implemented

2012-01-28 Thread Matt Joiner

New submission from Matt Joiner :

_threading.RLock is optional, and threading._CRLock is set to None if it isn't 
available. If this happens, the test_threading unittests crash.

Some implementations don't provide _thread.RLock.

Patch attached.

--
components: Library (Lib)
files: skip-crlock-tests-if-not-implemented.patch
keywords: patch
messages: 152151
nosy: anacrolix
priority: normal
severity: normal
status: open
title: threading._CRLock should not be tested if _thread.RLock isn't implemented
type: behavior
versions: Python 3.3
Added file: 
http://bugs.python.org/file24345/skip-crlock-tests-if-not-implemented.patch

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



[issue12655] Expose sched.h functions

2012-02-16 Thread Matt Joiner

Matt Joiner  added the comment:

Please also expose sched_getcpu().

--
nosy: +anacrolix

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



[issue14003] __self__ on built-in functions is not as documented

2012-02-17 Thread Matt Joiner

Changes by Matt Joiner :


--
nosy: +anacrolix

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



[issue14059] Implement multiprocessing.Barrier

2012-02-19 Thread Matt Joiner

New submission from Matt Joiner :

There is no Barrier in multiprocessing corresponding to threading.Barrier.

--
components: Library (Lib)
messages: 153744
nosy: anacrolix
priority: normal
severity: normal
status: open
title: Implement multiprocessing.Barrier
type: enhancement
versions: Python 3.3

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



[issue14060] Implement a CSP-style channel

2012-02-19 Thread Matt Joiner

New submission from Matt Joiner :

>From the mailing list, there is some interest in a CSP-style channel. 
>http://mail.python.org/pipermail/python-ideas/2012-February/014073.html

--
components: Library (Lib)
messages: 153748
nosy: anacrolix
priority: normal
severity: normal
status: open
title: Implement a CSP-style channel
type: enhancement
versions: Python 3.3

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



[issue14060] Implement a CSP-style channel

2012-02-20 Thread Matt Joiner

Matt Joiner  added the comment:

As I see it, here are the desirable features of CSP-style concurrency as it 
pertains to channels:

1) At least an unbuffered mode
2) Can be marked closed
3) Block on multiple send/receives until one can proceed

Specifically features 1 and 2 could be bolted onto queue.Queue with excellent 
backward compatibility with existing usage of Queue. As mentioned on the 
mailing list, maxsize=None would mean infinite queue, and maxsize=0 would 
become the unbuffered mode Currently maxsize<=0 means infinite. Existing code 
that assumed one or the other and explicitly created Queues this way would have 
to change (I'd suspect almost no code would be affected).

Feature 3 allows for all the awesomeness of CSP channels, but I think it 
requires a redesign under the covers of Queue to allow waiters to be woken from 
arbitrary Queues to which they are subscribed. The synchronization internals 
are quite complex.

There appears to be several ways to proceed:

1) Add unbuffered mode, closing, and other syntactical sugar to queue.Queue.
2) Do (1) and additionally rework the internals to allow blocking on on several 
Queue actions at once.
3) Add an unbuffered-only, closable threading.Channel for use with higher level 
primitives (as Guido suggested).
4) Make no changes to queue, and create a brand-new module with full blown CSP 
channels.

--

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



[issue10115] Support accept4() for atomic setting of flags at socket creation

2012-02-28 Thread Matt Joiner

Matt Joiner  added the comment:

Can we get this exposed as an os.accept4, and an optional flags parameter to 
socket.socket.accept?

--
nosy: +anacrolix

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



[issue14156] argparse.FileType for '-' doesn't work for a mode of 'rb'

2012-02-29 Thread Matt Joiner

New submission from Matt Joiner :

If an argument of '-' is handled by argparse.FileType, it defaults to 
sys.stdin. However a mode of 'rb' is ignored, the returned file object does not 
work with raw bytes.

--
components: Library (Lib)
messages: 154612
nosy: anacrolix
priority: normal
severity: normal
status: open
title: argparse.FileType for '-' doesn't work for a mode of 'rb'
type: behavior
versions: Python 3.3

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



[issue14156] argparse.FileType for '-' doesn't work for a mode of 'rb'

2012-03-14 Thread Matt Joiner

Matt Joiner  added the comment:

Roger that. I'll start on a patch for this in a month or two if all goes well.

--

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



[issue14222] Using time.time() in Queue.get breaks when system time is changed

2012-03-14 Thread Matt Joiner

Changes by Matt Joiner :


--
nosy: +anacrolix

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



[issue12684] profile does not dump stats on exception like cProfile does

2012-03-15 Thread Matt Joiner

Matt Joiner  added the comment:

Jim the code was lifted verbatim from Lib/cProfile.py, line 47.

That code in cProfile.py has not changed since 2006 when it was committed by 
Armin Rigo.

I can modernize it if it's a requirement to get it committed, but I'm also okay 
with my conservative patch as is.

--
nosy: +arigo, mwh

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



[issue14320] set.add can return boolean indicate newly added item

2012-03-15 Thread Matt Joiner

New submission from Matt Joiner :

set.add can return True to indicate a newly added item to the set, or False if 
the item was already present.

The C function PySet_Add returns -1 on error, and 0 on success currently. This 
is extended to return 1 if the item is newly added, and 0 if it was already 
present. Precedents exist for PySet_Contains and PySet_Discard with the same 
semantics. There are only 3 calls that need to be patched in the entire core, 
these are included in the patch.

The Python function set.add currently returns None. This is extended to return 
True if if the item is new to the set, and False otherwise. No object overhead 
is introduced as set.add is already currently executing Py_RETURN_NONE.

Benchmarks indicate that set.add if the item isn't already present (returning 
True in the patched instance) reduces time by 5-9%. set.add if the item already 
exists increases time by 1-3%. I'm happy to put these down to effects of 
touching True and False instead of None on return from set.add.

Patch and primitive performance test attached.

--
components: Interpreter Core
files: set-add-return-bool.patch
keywords: patch
messages: 155909
nosy: anacrolix, eric.araujo, gvanrossum, petri.lehtinen
priority: normal
severity: normal
status: open
title: set.add can return boolean indicate newly added item
type: enhancement
versions: Python 3.3
Added file: http://bugs.python.org/file24862/set-add-return-bool.patch

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



[issue14320] set.add can return boolean indicate newly added item

2012-03-15 Thread Matt Joiner

Changes by Matt Joiner :


Added file: http://bugs.python.org/file24863/bench_set_add.py

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



[issue13872] socket.detach doesn't mark socket._closed

2012-03-15 Thread Matt Joiner

Matt Joiner  added the comment:

Yes it should.

A cursory glance shows that __repr__ returns incorrect if _closed is not 
marked, and an unnecessary mop-up call to socket.close is avoided.

--
nosy: +giampaolo.rodola, haypo, stutzbach

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



[issue13694] asynchronous connect in asyncore.dispatcher does not set addr

2012-03-15 Thread Matt Joiner

Matt Joiner  added the comment:

I should mention that this failure to set addr is unusual seeing as most socket 
instances are wrapping AF_INET* domain sockets, and aren't likely to connect 
without blocking. This is quite likely a reason nobody has observed it until 
now.

It *is* desirable to save addr at this point, as mentioned in previous comments.

Additionally addr is public API insofar as asyncore.sockets are concerned.

--
nosy: +akuchling

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



[issue14156] argparse.FileType for '-' doesn't work for a mode of 'rb'

2012-03-15 Thread Matt Joiner

Matt Joiner  added the comment:

Steven, patch attached. I lost steam in the unittests with all the meta, 
suffice it that the names match the file descriptors of the stream sources. 
i.e. FileType('rb') would give a file with name=0, and so forth. My chosen 
method also allows other mode flags as well as custom bufsizes.

--
keywords: +patch
Added file: http://bugs.python.org/file24868/argparse-filetype-stdio-modes.patch

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



[issue14320] set.add can return boolean indicate newly added item

2012-03-16 Thread Matt Joiner

Matt Joiner  added the comment:

Is there still some value to at least exposing this in the C API, per the 
precedents I mentioned? 

The patch also contains some adjustment to the set_add_entry/set_add_key 
abstraction dance, and some future proofing of PySet_Add return values that 
have merit on their own.

--

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



[issue14333] queue unittest errors

2012-03-16 Thread Matt Joiner

New submission from Matt Joiner :

$ python3.3 -m unittest test.test_queue

Generates errors in the unit test code of the form

AttributeError: 'BaseQueueTest' object has no attribute 'type2test'

--
components: Tests
messages: 156006
nosy: anacrolix, benjamin.peterson, rhettinger
priority: normal
severity: normal
status: open
title: queue unittest errors
type: behavior
versions: Python 3.3

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



[issue14230] Delegating generator is not always visible to debugging tools such as inspect & pdb

2012-03-16 Thread Matt Joiner

Matt Joiner  added the comment:

This changeset has broken something. All I get is a confusing backtrace ending 
with:

  File "/home/matt/src/python-torrent/torrent/bencode.py", line 15, in encode
yield from encode(k)
AttributeError: 'list_iterator' object has no attribute 'send'

Backing out the changeset, and there is no problem. Let me know if there's some 
way to provide more information.

--
nosy: +anacrolix

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



[issue14333] queue unittest errors

2012-03-17 Thread Matt Joiner

Matt Joiner  added the comment:

Yes, FWIW much of the standard library tests are callable this way without 
issue. I have patches that fix the discoverability of a few test modules. I'll 
submit these in another issue.

--

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



[issue12684] profile does not dump stats on exception like cProfile does

2012-03-17 Thread Matt Joiner

Matt Joiner  added the comment:

I will submit a patch for this soon.

--

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



[issue13448] PEP 3155 implementation

2012-03-18 Thread Matt Joiner

Matt Joiner  added the comment:

Doc/library/dis.rst wasn't updated for the extra pop introduced to MAKE_CLOSURE 
opcode.

--
nosy: +anacrolix

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



[issue14373] C implementation of functools.lru_cache

2012-03-20 Thread Matt Joiner

New submission from Matt Joiner :

functools.lru_cache is optimized to the point that it may benefit from a C 
implementation.

--
components: Interpreter Core, Library (Lib)
messages: 156405
nosy: anacrolix, rhettinger
priority: normal
severity: normal
status: open
title: C implementation of functools.lru_cache
type: performance
versions: Python 3.3

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



[issue14373] C implementation of functools.lru_cache

2012-03-20 Thread Matt Joiner

Changes by Matt Joiner :


Added file: http://bugs.python.org/file24958/functools.lru_cache-in-c

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



[issue12684] profile does not dump stats on exception like cProfile does

2012-03-20 Thread Matt Joiner

Changes by Matt Joiner :


Added file: http://bugs.python.org/file24961/profiler-unhandled-exceptions.patch

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



[issue13694] asynchronous connect in asyncore.dispatcher does not set addr

2012-03-20 Thread Matt Joiner

Matt Joiner  added the comment:

This patch is a shoo-in, can someone review and commit this?

--

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



[issue12684] profile does not dump stats on exception like cProfile does

2012-03-20 Thread Matt Joiner

Matt Joiner  added the comment:

I attached a minimal patch that additionally tidies the exception handling for 
{cP,p}rofile.runctx.

--

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



[issue14373] C implementation of functools.lru_cache

2012-03-21 Thread Matt Joiner

Matt Joiner  added the comment:

Updated patch to fix a crash if maxsize isn't given, and add a unit test for 
that.

Possible issues:

 * I've tried to emulate object() by calling PyBaseObject_Type. Not sure if 
there's a more lightweight object for this that just provides the needed 
__hash__ and __eq__ attributes.
 * Not sure if kwd_mark is deallocated correctly.
 * Can't quite work out the best way to wrap the C cache_info() method to 
output the _CacheInfo named tuple. The current mechanism might not be wrapping 
the attributes correctly.

--
keywords: +patch
Added file: http://bugs.python.org/file24984/functools.lru_cache-in-c.patch

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



[issue9528] Add pure Python implementation of time module to CPython

2012-03-22 Thread Matt Joiner

Changes by Matt Joiner :


--
nosy: +anacrolix

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



[issue4331] Can't use _functools.partial() created function as method

2012-03-24 Thread Matt Joiner

Changes by Matt Joiner :


--
nosy: +anacrolix

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



[issue4331] Can't use _functools.partial() created function as method

2012-03-24 Thread Matt Joiner

Matt Joiner  added the comment:

I've attached a patch that implements the descriptor protocol for 
functools.partial with minimum changes.

--
Added file: http://bugs.python.org/file25016/functools.partial-descrget.patch

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



[issue14406] Race condition in concurrent.futures

2012-03-25 Thread Matt Joiner

New submission from Matt Joiner :

There's a race condition in concurrent.futures in _AllCompletedWaiter, which 
affects wait(return_when=ALL_COMPLETED).

The attached test will go into an infinite wait.

--
components: Library (Lib)
files: concurrent.futures._AllCompletedWaiter-race-condition-test.py
messages: 156764
nosy: anacrolix
priority: normal
severity: normal
status: open
title: Race condition in concurrent.futures
type: behavior
versions: Python 3.2, Python 3.3
Added file: 
http://bugs.python.org/file25019/concurrent.futures._AllCompletedWaiter-race-condition-test.py

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



[issue14406] Race condition in concurrent.futures

2012-03-25 Thread Matt Joiner

Matt Joiner  added the comment:

Patch attached.

--
keywords: +patch
Added file: 
http://bugs.python.org/file25020/concurrent.futures._AllCompletedWaiter-race-condition.patch

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



[issue14406] Race condition in concurrent.futures

2012-03-25 Thread Matt Joiner

Changes by Matt Joiner :


--
nosy: +bquinlan, loewis, pitrou, rosslagerwall

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



[issue14407] concurrent.futures tests don't adher to test_cases protocol

2012-03-25 Thread Matt Joiner

New submission from Matt Joiner :

matt@matt-1005P:~/src/cpython$ ./python -m unittest test.test_concurrent_futures
Ran 79 tests in 62.554s

FAILED (errors=18)

Failures are due to test discovery picking up unintentionally exposed tests. By 
adhering to the test_cases protocol introduced in 3.2, this doesn't occur.

Patch attached.

--
components: Tests
files: test_concurrent_futures-load_tests-protocol.patch
keywords: patch
messages: 156766
nosy: anacrolix
priority: normal
severity: normal
status: open
title: concurrent.futures tests don't adher to test_cases protocol
versions: Python 3.2, Python 3.3
Added file: 
http://bugs.python.org/file25021/test_concurrent_futures-load_tests-protocol.patch

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



[issue14407] concurrent.futures tests don't adher to test_cases protocol

2012-03-25 Thread Matt Joiner

Changes by Matt Joiner :


--
type:  -> enhancement

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



[issue14373] C implementation of functools.lru_cache

2012-03-25 Thread Matt Joiner

Changes by Matt Joiner :


--
nosy: +nedbat

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



[issue14408] Support the test_cases protocol in the stdlib tests

2012-03-25 Thread Matt Joiner

New submission from Matt Joiner :

Python 3.2 added the test_cases protocol. Many of the stdlib tests won't run 
using the `$ python3 -m unittest test.test_blah` method due to select unit test 
class names, and some regrtest arcanity. Defining test_cases makes these tests 
work as expected.

A patch is attached for several of the unit tests I've dealt with more often.

--
components: Tests
files: stdlib-tests-test_cases-protocol.patch
keywords: patch
messages: 156797
nosy: anacrolix
priority: normal
severity: normal
status: open
title: Support the test_cases protocol in the stdlib tests
type: enhancement
versions: Python 3.2, Python 3.3
Added file: 
http://bugs.python.org/file25023/stdlib-tests-test_cases-protocol.patch

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



[issue14373] C implementation of functools.lru_cache

2012-03-26 Thread Matt Joiner

Matt Joiner  added the comment:

I've fixed the commenting, and cache_info use.

I've left the element management in pure C as it reduces memory use (56 bytes 
for 4 element list, vs. 16 for lru_cache_elem), and avoids ref counting 
overhead (3 refs per link, plus GC). The difference might become quite marked 
for very large caches. There's also a nice invariant that links the key to the 
cache dict, and the result object to the lru_cache_elem. I'm happy to change 
this if it doesn't matter.

My only concern now is the wrapping of the lru cache object. In the Python 
version, @wraps allows the lru_cache to masquerade as the wrapped function wrt 
str/repr. The C version is wrapped, but str/repr remain unchanged. Not sure if 
this is a problem.

--
Added file: http://bugs.python.org/file25026/functools.lru_cache-in-c.patch

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



[issue14373] C implementation of functools.lru_cache

2012-03-26 Thread Matt Joiner

Changes by Matt Joiner :


Removed file: http://bugs.python.org/file24958/functools.lru_cache-in-c

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



[issue14408] Support the load_tests protocol in the stdlib tests

2012-03-27 Thread Matt Joiner

Matt Joiner  added the comment:

I think if you can correctly construct the same test case list using discovery 
then that's far superior. But I haven't tried this, and don't know if you can 
correctly predicate the support classes using only class decorators.

--

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



[issue14408] Support ./python -m unittest in the stdlib tests

2012-03-28 Thread Matt Joiner

Matt Joiner  added the comment:

Michael:

The thread setup and cleanup is not required, AFAICT. You are also correct in 
that these particular test modules do not run correctly without modification 
(although test_queue does now that the bug I reported there was fixed).

Sorry by predicated, I mean that we could mask out the base classes that many 
of the tests are enumerated on top of. Some kind of decorator for the base 
could prevent the base class being discovered unless it's inherited from. This 
is the source of the errors one currently gets running the tests via -m 
unittest.

Eric:

I'm not sure what you mean by the files being long. I've taken the existing 
test case list and exposed this directly to both load_tests and unittest.main. 
The load_tests boilerplate is disappointing, but explicit.

--

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



  1   2   >