[issue11158] Parent process did not quit after sys.exit()

2011-02-09 Thread Pham Cong Dinh

New submission from Pham Cong Dinh :

Hi,

I was implementing a multiple process compatible logging which child processes 
are expected to send all messages to the parent process via a queue and then 
the parent process serializes and flushes them into a log file. The idea is 
built around multiprocessing.Queue()

The problem is the first child process is always blocked while subsequent ones 
can run smoothly. It seems to be blocked on semaphore_wait_signal_trap

Environment
===
Mac OS X 10.6.5 
Python 2.6.6

Reproduction script:

https://gist.github.com/818114

Command to run


python log.py

Console message
===
Dinh-Phams-MacBook-Pro:task dinhpham$ python log.py
Parent PID 90401
90403
Parent PID 90401
Parent PID 90401
90404
Parent PID 90401
90405
No child process exits
90406
Child process ID 90406
Child process ID 90404
Child process ID 90405
No child process exits
No child process exits
No child process exits
No child process exits
No child process exits
Child process PID 90404 will exits now
Child process PID 90406 will exits now
Child process PID 90405 will exits now
The child process 90406 exits
The child process 90405 exits
The child process 90404 exits
No child process exits
No child process exits
No child process exits
No child process exits
No child process exits
No child process exits
No child process exits
No child process exits
No child process exits
No child process exits
No child process exits
No child process exits
No child process exits
No child process exits
No child process exits
No child process exits
No child process exits
^C[90403]
Parent process exits
Dinh-Phams-MacBook-Pro:task dinhpham$ 
 


=> All the process exits except the first child process one (90403)

--
components: Interpreter Core
messages: 128206
nosy: pcdinh
priority: normal
severity: normal
status: open
title: Parent process did not quit after sys.exit()
type: behavior
versions: Python 2.6

___
Python tracker 

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



[issue11158] Python VM deadlock

2011-02-09 Thread Pham Cong Dinh

Changes by Pham Cong Dinh :


--
title: Parent process did not quit after sys.exit() -> Python VM deadlock

___
Python tracker 

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



[issue11153] urllib2 basic auth parser handle unquoted realm in WWW-Authenticate header

2011-02-09 Thread Senthil Kumaran

Changes by Senthil Kumaran :


--
assignee:  -> orsenthil
nosy: +orsenthil

___
Python tracker 

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



[issue11145] '%o' % user-defined instance

2011-02-09 Thread Armin Rigo

Armin Rigo  added the comment:

Eric: that's wrong, it is a magic method.  See for example "__oct__" in 
Objects/typeobject.c.  I'm not sure I understand why you would point this out, 
though.  A "SystemError: bad argument to internal function" or an "Assertion 
failed" are both bugs anyway.

--

___
Python tracker 

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



[issue11145] '%o' % user-defined instance

2011-02-09 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
nosy: +benjamin.peterson

___
Python tracker 

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



[issue11157] Use socket.accept4 syscall under linux

2011-02-09 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

This is a duplicate of issue10115.

--
nosy: +pitrou
resolution:  -> duplicate
status: open -> closed
superseder:  -> Support accept4() for atomic setting of flags at socket creation

___
Python tracker 

___
___
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

2011-02-09 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Duplicated in issue11157.

--
nosy: +mmarkk

___
Python tracker 

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



[issue11158] Python VM deadlock

2011-02-09 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
nosy: +vinay.sajip

___
Python tracker 

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



[issue4681] mmap offset should be off_t instead of ssize_t, and size calculation needs corrected

2011-02-09 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Thanks for doing this. Looking at the patch: Modules/_io/_iomodule.h has macros 
for dealing with off_t (it also defines Py_off_t for Windows), perhaps you want 
to use them.

Also, support.unlink() takes care of ignoring ENOENT for you.

Regardling the sizes used in the test: I think using hexadecimal literals (e.g. 
0x18000 instead of 6442450944) would make things a bit more readable :)

Part of the patch doesn't apply cleanly to latest py3k. Could you regenerate 
it, please?

--
nosy: +pitrou

___
Python tracker 

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



[issue11145] '%o' % user-defined instance

2011-02-09 Thread Benjamin Peterson

Benjamin Peterson  added the comment:

It's a magic method in 2.7 but not 3.x.

--

___
Python tracker 

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



[issue11159] Sax parser crashes if given unicode file name

2011-02-09 Thread Rickard Lindberg

New submission from Rickard Lindberg :

The error is the following:

Traceback (most recent call last):
  File "", line 4, in 
  File "/usr/lib64/python2.7/site-packages/_xmlplus/sax/__init__.py", line 
31, in parse
parser.parse(filename_or_stream)
  File "/usr/lib64/python2.7/site-packages/_xmlplus/sax/expatreader.py", 
line 109, in parse
xmlreader.IncrementalParser.parse(self, source)
  File "/usr/lib64/python2.7/site-packages/_xmlplus/sax/xmlreader.py", line 
119, in parse
self.prepareParser(source)
  File "/usr/lib64/python2.7/site-packages/_xmlplus/sax/expatreader.py", 
line 121, in prepareParser
self._parser.SetBase(source.getSystemId())
UnicodeEncodeError: 'ascii' codec can't encode character u'\xe5' in 
position 0: ordinal not in range(128)

The following bash script can be used to reproduce the error:

#!/bin/sh

cat > å.timeline <

  0.13.0devb38ace0a572b+
  
  
  

  2011-02-01 00:00:00
  2011-02-03 08:46:00
  asdsd

  
  

  2011-01-24 16:38:11
  2011-02-23 16:38:11



  

EOF

python <>> sys.getfilesystemencoding()
'UTF-8'

I heard from another user that this was not a problem with Python 3.1.2.

--
components: XML
messages: 128212
nosy: ricli85
priority: normal
severity: normal
status: open
title: Sax parser crashes if given unicode file name
type: crash
versions: Python 2.7

___
Python tracker 

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



[issue11156] email.encoders.encode_base64 create a single long line

2011-02-09 Thread Yves Dorfsman

Yves Dorfsman  added the comment:

In case this does not get fixed for a long time, here is a work around 
(re-implement the encoder yourself):


.
.
.
def myencoder(msg):
  from base64 import encodebytes as _bencode

  orig = msg.get_payload()
  encdata = str(_bencode(orig), 'ascii')
  msg.set_payload(encdata)
  msg['Content-Transfer-Encoding'] = 'base64'
.
.
.
# here is an example of how to use it
fp = 
open('/usr/share/openclipart/png/animals/mammals/happy_monkey_benji_park_01.png',
 'rb')

bindata = fp.read()

x = email.mime.image.MIMEImage(bindata, _subtype='png', _encoder=myencoder)

y = x.get_payload()
print (y)
.
.
.

--

___
Python tracker 

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



[issue941346] AIX shared library fix

2011-02-09 Thread Michael Haubenwallner

Michael Haubenwallner  added the comment:

Sébastien, why did you need to add '-L$(srcdir)' to BLDSHARED in these patches?

As LDLIBRARY points to the immediate file 'libpython$(VERSION).so' instead of 
'-lpython$(VERSION)', I don't see the need for '-L$(srcdir)' at all.

The problem is that '-L$(srcdir)' adds '$(srcdir)' to the runpath too (as there 
is no '-blibpath' argument), opening a security hole for libpythonX.Y.so as 
well as the modules.so.

--
nosy: +haubi

___
Python tracker 

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



[issue4681] mmap offset should be off_t instead of ssize_t, and size calculation needs corrected

2011-02-09 Thread Ross Lagerwall

Ross Lagerwall  added the comment:

OK, this new patch applies cleanly, uses support.unlink and hexadecimal 
constants.

I left the off_t handling as is (it seems to work on *nix testing). Perhaps 
someone can handle the Windows side?

--
Added file: http://bugs.python.org/file20722/mmap_revised.patch

___
Python tracker 

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



[issue10694] zipfile.py end of central directory detection not robust

2011-02-09 Thread Xuanji Li

Xuanji Li  added the comment:

I've attached a patch copying rep's patch from issue 10298, as i think it is 
cleaner (but it seems to do the same thing as kevin's patch) together with 2 
test cases. 

David Murray: I'm not really sure what you mean by "test comments with trailing 
data"; as I understand, the way to fix the problem is simply to remove the 
excessively strict check that the length the zip file claims to have is equal 
to the actual amount of comments found by truncating comments to the claimed 
size; if that's the case my (new) test should be enough to exercise that logic. 
Please correct me if I misunderstand.

--
Added file: http://bugs.python.org/file20723/reps_patch_and_two_tests.diff

___
Python tracker 

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



[issue11160] ZipFile.comment expects bytes

2011-02-09 Thread Xuanji Li

New submission from Xuanji Li :

The documentation for zipfile describes ZipFile.comment as "The comment text 
associated with the ZIP file." From reading this I expect that setting it to a 
string is ok; however ZipFile.comment must actually be set to bytes (or a 
bytes-like object, I am not very sure).

This may also unexpectedly affect old code because I saw one patch on the bug 
tracker that was written just last year that set ZipFile.comment to a string. 

IMO there are 2 ways to fix:

1) Change docs to mention that ZipFile.comment only accepts bytes
2) Patch zipfile.py to accept string and try to convert, throwing an error if 
the conversion fails

--
assignee: docs@python
components: Documentation, Library (Lib)
messages: 128217
nosy: docs@python, haypo, xuanji
priority: normal
severity: normal
status: open
title: ZipFile.comment expects bytes
versions: Python 3.2

___
Python tracker 

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



[issue10694] zipfile.py end of central directory detection not robust

2011-02-09 Thread R. David Murray

R. David Murray  added the comment:

Xuanji: yes, your test_ignores_stuff_appended_past_comments is exactly what I 
was asking for.  I've put this patch on my review list, but I may not get to it 
until after 3.2 final.

--

___
Python tracker 

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



[issue11156] email.encoders.encode_base64 create a single long line

2011-02-09 Thread R. David Murray

R. David Murray  added the comment:

This appears to be a duplicate of issue 9298.  Yves, if you disagree let me 
know what's different.

--
nosy: +r.david.murray
resolution:  -> duplicate
stage:  -> committed/rejected
status: open -> closed
type:  -> behavior
versions: +Python 3.2, Python 3.3

___
Python tracker 

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



[issue9298] binary email attachment issue with base64 encoding

2011-02-09 Thread R. David Murray

R. David Murray  added the comment:

See also duplicate issue 11156.

--
nosy: +y...@zioup.com

___
Python tracker 

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



[issue9298] binary email attachment issue with base64 encoding

2011-02-09 Thread R. David Murray

Changes by R. David Murray :


--
versions: +Python 3.3

___
Python tracker 

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



[issue11156] email.encoders.encode_base64 create a single long line

2011-02-09 Thread R. David Murray

Changes by R. David Murray :


--
superseder:  -> binary email attachment issue with base64 encoding

___
Python tracker 

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



[issue11154] Alternate name for __pycache__

2011-02-09 Thread Éric Araujo

Changes by Éric Araujo :


--
nosy: +eric.araujo

___
Python tracker 

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



[issue11154] Alternate name for __pycache__

2011-02-09 Thread Barry A. Warsaw

Barry A. Warsaw  added the comment:

Hmm. That's problematic.  How would that interact with a system Python that is 
already looking in __pycache__ for its pyc files?  Would it suddenly start 
ignoring those and wanting to write them to .pycache?

IIRC we thought about something like this during the PEP discussions and Guido 
nixed it.

-1

--

___
Python tracker 

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



[issue11154] Alternate name for __pycache__

2011-02-09 Thread Georg Brandl

Changes by Georg Brandl :


--
nosy: +georg.brandl

___
Python tracker 

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



[issue11154] Alternate name for __pycache__

2011-02-09 Thread Dave Malcolm

Dave Malcolm  added the comment:

On Wed, 2011-02-09 at 16:41 +, Barry A. Warsaw wrote:

> IIRC we thought about something like this during the PEP discussions and 
> Guido nixed it.

FWIW, the closest I could find was this mail:
  http://www.mail-archive.com/python-dev@python.org/msg45203.html
(doesn't seem to be in the mail.python.org archives)
where GvR said:
> Because we don't want to completely hide the pyc files. Also the dot
> naming convention is somewhat platform-specific.

(FWIW, I wish we'd gone for .pycache too, but I guess it's too late to change 
now)

--
nosy: +dmalcolm

___
Python tracker 

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



[issue10882] Add os.sendfile()

2011-02-09 Thread Giampaolo Rodola'

Giampaolo Rodola'  added the comment:

On a second thought I have two complaints.

There is no reason to return the file offset, also because this is only 
supported on Linux. On all other platforms we are calculating the file offset 
by making a sum of offset + number of bytes sent. Despite this would normally 
work it no longer makes sense when headers/trailers arguments are specified.

>>> sendfile(in, out, offset, 4096, headers=[b""])
(5000, 5000)

In this case the right offset is supposed to be 4096.
We might adjust this in the code but in my opinion knowing the file offset is 
not really necessary as what the user really needs is the number of bytes sent, 
as when using socket.send().

My second complaint is about headers/trailers data type.
Currently we are passing a sequence of buffers (tipically a list) but I think 
we should pass plain bytes instead.

--

___
Python tracker 

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



[issue11154] Alternate name for __pycache__

2011-02-09 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

I agree with barry's argument and also with Marc-André's argument on 
python-ideas. Your directories are far cleaner than before with pyc files all 
around, so what is the problem exactly?

--
nosy: +pitrou

___
Python tracker 

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



[issue11154] Alternate name for __pycache__

2011-02-09 Thread Raymond Hettinger

Raymond Hettinger  added the comment:

That makes sense.  Making it configurable would lose some of the benefits.

What we could do though, before 3.2 goes out, is change the name to ".pycache" 
to follow the dot-file naming convention and avoid cluttering directory 
listings.

--
priority: normal -> high
versions: +Python 3.2 -Python 3.3

___
Python tracker 

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



[issue10882] Add os.sendfile()

2011-02-09 Thread Ross Lagerwall

Ross Lagerwall  added the comment:

OK, I'm happy to not return the file offset. However, I still think that 
headers and trailers should remain as is since this matches the native 
interface very closely.

--

___
Python tracker 

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



[issue11154] Alternate name for __pycache__

2011-02-09 Thread Raymond Hettinger

Raymond Hettinger  added the comment:

I just saw a post from Guido saying that he doesn't want the directory to be 
invisible.

--
resolution:  -> rejected
status: open -> closed

___
Python tracker 

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



[issue11161] futures.ProcessPoolExecutor hangs

2011-02-09 Thread paul clinch

New submission from paul clinch :

The example ``16.4.3.1. ProcessPoolExecutor Example`` hangs in IDLE silently,  
and hangs the interactive python shell with ``AttributeError: 'module' object 
has no attribute 'is_prime'``.

is_prime(9) was tested before running.

Platform is windows XP.

``c:\Python32\python.exe -m test.test_concurrent_futures``

passes all tests.

--
components: IDLE
messages: 128228
nosy: pclinch
priority: normal
severity: normal
status: open
title: futures.ProcessPoolExecutor hangs
type: behavior
versions: Python 3.2

___
Python tracker 

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



[issue5833] readline update

2011-02-09 Thread Sandro Tosi

Sandro Tosi  added the comment:

How should we move forward with this issue?
J Evens: are you willing to split the patch in smaller ones that can be more 
easily managed/reviewed/applied?
Antoine: do you think it's worth the effort?

I can also try to split the patch, but what branch should I target: py3k?

--
nosy: +sandro.tosi

___
Python tracker 

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



[issue4696] email module does not unfold headers

2011-02-09 Thread Sandro Tosi

Sandro Tosi  added the comment:

Hi David, AFAIUI in py3k branch I see email module has version 5.1.0 so I guess 
the new email module will be targetting 3.3 - am I correct? what should we do 
with this issue?

--
nosy: +sandro.tosi
stage:  -> patch review

___
Python tracker 

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



[issue6544] Fix refleak in kqueue implementation

2011-02-09 Thread Sandro Tosi

Sandro Tosi  added the comment:

Hi Georg, are you planning to backport this patch also to 3.1 or else can we 
close this issue? Cheers!

--
nosy: +sandro.tosi
stage:  -> committed/rejected

___
Python tracker 

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



[issue11158] Python VM deadlock

2011-02-09 Thread Vinay Sajip

Vinay Sajip  added the comment:

I don't believe this is an interpreter or stdlib problem. See this post from 
September last year:

http://plumberjack.blogspot.com/2010/09/using-logging-with-multiprocessing.html

which shows how to use multiprocessing and logging together with rotating logs. 
The post includes the code for a complete working script which runs fine with 
Python 2.6 on Windows and Linux, but which I can't test on Mac OS X/Python 2.6 
as I have no access to a Snow Leopard system.

You're welcome to run that script on your system and update this issue with 
your results - so I'm marking as "invalid" for now (as I don't believe there's 
a valid Python issue) and "pending" awaiting your feedback. If I don't hear 
from you in the next week or so, I'll close this issue.

--
resolution:  -> invalid
status: open -> pending

___
Python tracker 

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



[issue11158] Python VM deadlock

2011-02-09 Thread Vinay Sajip

Changes by Vinay Sajip :


--
assignee:  -> vinay.sajip
status: pending -> open

___
Python tracker 

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



[issue11161] futures.ProcessPoolExecutor hangs

2011-02-09 Thread Brian Curtin

Changes by Brian Curtin :


--
assignee:  -> bquinlan
nosy: +bquinlan

___
Python tracker 

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



[issue4216] subprocess.Popen hangs at communicate() when child exits

2011-02-09 Thread Arty

Arty  added the comment:

You can try subprocess.call() with close_fds=True.
It helped me, at least.

--
nosy: +elmysnail

___
Python tracker 

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



[issue11158] Python VM deadlock

2011-02-09 Thread Vinay Sajip

Changes by Vinay Sajip :


--
status: open -> pending

___
Python tracker 

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



[issue11162] Add tuple/list sep to string split method

2011-02-09 Thread Tshepang Lekhonkhobe

New submission from Tshepang Lekhonkhobe :

I was hoping that I could use a list/tuple of separators for the split method:

"abcde".split(["b", "d"])

vs.

import re
re.split("b|d", "abcde")

That's one extra LOC, and (worse still) forces me to learn regexp.

Does this suggested 'improvement' make sense?

--
components: Library (Lib)
messages: 128234
nosy: tshepang
priority: normal
severity: normal
status: open
title: Add tuple/list sep to string split method

___
Python tracker 

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



[issue11162] Add tuple/list sep to string split method

2011-02-09 Thread Tshepang Lekhonkhobe

Changes by Tshepang Lekhonkhobe :


--
components: +Interpreter Core -Library (Lib)

___
Python tracker 

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



[issue11162] Add tuple/list sep to string split method

2011-02-09 Thread Raymond Hettinger

Raymond Hettinger  added the comment:

> Does this suggested 'improvement' make sense?

Sorry, it doesn't make sense for a number of reasons.

* First the str.split() is already too complex.  It took years to get the docs 
for it to be correct and informative (two different algorithms, etc).

* Second, it would overly complicate the implementation and preclude various 
kinds of string search optimizations (i.e. that is why fgrep, grep, and egrep 
are still separate).

* Third, at some point, when you need a regex, you just need to use a regex.  
It would be a mistake to reinvent regex capabilities in string objects.

--
nosy: +rhettinger
resolution:  -> rejected
status: open -> closed

___
Python tracker 

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



[issue4681] mmap offset should be off_t instead of ssize_t, and size calculation needs corrected

2011-02-09 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

> I left the off_t handling as is (it seems to work on *nix testing).
> Perhaps someone can handle the Windows side?

Ok, after looking at the code, it appears Windows already should have proper 
handling of 64-bit sizes under 32-bit builds.

--

___
Python tracker 

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



[issue11144] int(float) may return a long for no reason

2011-02-09 Thread Mark Dickinson

Mark Dickinson  added the comment:

This turns out to be a one-line fix (modulo comments and tests); see attached 
patch.  The new code depends on the assumption that C longs are represented 
using two's complement, but note that this assumption is (a) already present 
elsewhere in the Python core (e.g., in the definition of bitwise operations for 
ints), and (b) universally true in practice (as far as I'm aware).  For 
theoretical completeness, it would be easy to write a different test for ones' 
complement and sign-magnitude machines, but in practice that seems pointless, 
and given the near-impossibility of testing that code, I left it out.

--
keywords: +patch
Added file: http://bugs.python.org/file20724/issue11144.patch

___
Python tracker 

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



[issue11163] iter() documentation code doesn't work

2011-02-09 Thread Michael Grazebrook

New submission from Michael Grazebrook :

This code fragment from the documentation of iter() doesn't work as intended. 
Change "STOP" to "STOP\n". Maybe also check for EOF as it hangs.

with open("mydata.txt") as fp:
for line in iter(fp.readline, "STOP"):
process_line(line)

Or maybe this makes a better example because it's clearer wha'ts going on:

square_generator = (i * i for i in range(10))
for n in iter( square_generator.next, 144):
print n

--
assignee: docs@python
components: Documentation
messages: 128238
nosy: docs@python, mgrazebrook
priority: normal
severity: normal
status: open
title: iter() documentation code doesn't work
type: behavior
versions: Python 2.6

___
Python tracker 

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



[issue4696] email module does not unfold headers

2011-02-09 Thread R. David Murray

R. David Murray  added the comment:

Yes, when I said "new version", I meant "new major version", as in email6.  I 
have plans for this, but I'm waiting until after the release of 3.2 to make a 
presentation about it to the email-sig.

--
versions: +Python 3.3 -Python 3.2

___
Python tracker 

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



[issue11144] int(float) may return a long for no reason

2011-02-09 Thread Martin v . Löwis

Martin v. Löwis  added the comment:

Very smart!

--

___
Python tracker 

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



[issue11161] futures.ProcessPoolExecutor hangs

2011-02-09 Thread Brian Quinlan

Brian Quinlan  added the comment:

ProcessPoolExecutor is not expected to work with any interactive shell on 
Windows because it uses the multiprocessing module behind the scenes, which has 
that limitation.

I'm reclassifying this as a documentation bug since either a reference to 
http://docs.python.org/dev/library/multiprocessing.html#programming-guidelines 
should appear in the futures docs or (better) the content should be rewritten 
specifically for ProcessPoolExecutor.

--
components: +Documentation -IDLE

___
Python tracker 

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



[issue11164] xml shouldn't use _xmlplus

2011-02-09 Thread Arfrever Frehtes Taifersar Arahesis

New submission from Arfrever Frehtes Taifersar Arahesis 
:

Lib/xml/__init__.py since r16544 tries to replace xml package with _xmlplus 
package from PyXML. PyXML is no longer maintained and doesn't support Python 3, 
so it should be safe to remove PyXML-related code in Lib/xml/__init__.py in 
Python 3.1 / 3.2.

--
components: Library (Lib), XML
messages: 128242
nosy: Arfrever, akuchling, fdrake, jkloth, loewis
priority: normal
severity: normal
status: open
title: xml shouldn't use _xmlplus
versions: Python 3.1, Python 3.2

___
Python tracker 

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



[issue10517] test_concurrent_futures crashes with "--with-pydebug" on RHEL5 with "Fatal Python error: Invalid thread state for this thread"

2011-02-09 Thread Dave Malcolm

Changes by Dave Malcolm :


--
title: test_concurrent_futures crashes with "Fatal Python error: Invalid thread 
state for this thread" -> test_concurrent_futures crashes with "--with-pydebug" 
on RHEL5 with "Fatal Python error: Invalid thread state for this thread"

___
Python tracker 

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



[issue8652] Minor improvements to the "Handling Exceptions" part of the tutorial

2011-02-09 Thread Éric Araujo

Éric Araujo  added the comment:

> Removes the two instances I noticed of treating exception instances as 
> sequences.
Looks good.

> Adds a warning explaining ``except FooException, BarException:`` does not do 
> what you might think.
Ditto.

> There are two things I'm not entirely happy about:

> I initially wrote ``print "I/O error({0.errno}): {0.strerror}".format(e)``,
> but then noticed this string formatting trick is not mentioned in the 
> previous chapter
> of the tutorial. Dict access (``"{0[foo]}".format(d)``) is, but attribute 
> access
> is not. Is this worth adding to that chapter, so it can be used here?
It’s not at all a trick :)  Given that item access is already covered, I don’t 
think your use of attribute access would make the example harder for beginners, 
but I may not be the best judge.

> Binding an exception instance to a variable (using "as") is explained near 
> the bottom
> of the section on catching exceptions, well before it is used.
> Perhaps this could do with a bit of reordering?
+1.

A note about workflow: patches should usually apply to the py3k branch, the 
person who commits takes care of backporting to 3.1 and 2.7.  In this case, 
some of your editions are not relevant for 3.x, so I suggest you use one of 
those workflows:
1) Make one patch for py3k and one for 2.7
2) Make one for 2.7, with comments indicating parts that apply to py3k too
3) Make one patch with edits relevant for py3k and 2.7, and another one for 
2.7-only edits

--
nosy: +terry.reedy
stage:  -> patch review
versions: +Python 2.7, Python 3.1, Python 3.2, Python 3.3

___
Python tracker 

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



[issue2228] Imaplib speedup patch

2011-02-09 Thread Sandro Tosi

Sandro Tosi  added the comment:

Sean, could you please explain a bit more what are your concerns about this 
patch?

Anyhow, the code has slightly changed and currently John is not maintaining 
offlineimap anymore, but what seems the most recent version can be found at: 
https://github.com/nicolas33/offlineimap/

--
nosy: +sandro.tosi
stage:  -> patch review

___
Python tracker 

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



[issue10361] Fix issue 9995 - distutils forces developers to store password in cleartext (issue2874041)

2011-02-09 Thread Éric Araujo

Éric Araujo  added the comment:

self.distribution.username:
 I’d prefer a clearer comparison, please use “is [not] None” and
parens.
>>> Are you sure you want an empty username in config file to override
name set from
>>> 'register' command?
>> This is a crazy case.  PyPI won’t allow it to pass, so I’m okay with
it.
> That's why I don't want to make distinction between "None" username
and empty
> username. They are both the same in this context.

That’s not what I meant.  IMO, None means not provided and an empty
string (i.e. an empty value in the config file) is a bug introduced by
the user.

not
>> “password”.
> That's magically patched in setUp method.

I don’t understand.  The RawInput monkey-patch will give '1', 'tarek'
and 'n', which are anwsers to “choice”, “username” and “save password”,
but the code should ask for “choice”, “username”, “password”, “save
password”.

http://codereview.appspot.com/2874041/diff/13001/command/upload.py
File command/upload.py (right):

http://codereview.appspot.com/2874041/diff/13001/command/upload.py#newcode53
command/upload.py:53: if not self.username and
self.distribution.username:
A bugfix should not change the API like this.  Either make it a private
name like _username, or (better) use
dist.get_command_obj('register').username

http://codereview.appspot.com/2874041/

--

___
Python tracker 

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



[issue8797] urllib2 basicauth broken in 2.6.5: RuntimeError: maximum recursion depth exceeded in cmp

2011-02-09 Thread Ole Martin Handeland

Ole Martin Handeland  added the comment:

Thanks Sam! I can confirm that your patch is working well with basic auth. I 
have not tried other authentication methods, though. I'm not sure about the 
unredirected headers, but your fix looks like the cleanest.

--
nosy: +olemartinorg

___
Python tracker 

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



[issue6626] show Python mimetypes module some love

2011-02-09 Thread Sandro Tosi

Changes by Sandro Tosi :


--
stage:  -> patch review

___
Python tracker 

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



[issue10361] Fix issue 9995 - distutils forces developers to store password in cleartext (issue2874041)

2011-02-09 Thread Éric Araujo

Changes by Éric Araujo :


--
nosy:  -eric.araujo, tarek, techtonik

___
Python tracker 

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



[issue10361] Fix issue 9995 - distutils forces developers to store password in cleartext (issue2874041)

2011-02-09 Thread Éric Araujo

Changes by Éric Araujo :


--
Removed message: http://bugs.python.org/msg120776

___
Python tracker 

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



[issue10361] Fix issue 9995 - distutils forces developers to store password in cleartext (issue2874041)

2011-02-09 Thread Éric Araujo

Changes by Éric Araujo :


--
Removed message: http://bugs.python.org/msg120788

___
Python tracker 

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



[issue10361] Fix issue 9995 - distutils forces developers to store password in cleartext (issue2874041)

2011-02-09 Thread Éric Araujo

Changes by Éric Araujo :


--
Removed message: http://bugs.python.org/msg120791

___
Python tracker 

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



[issue10361] Fix issue 9995 - distutils forces developers to store password in cleartext (issue2874041)

2011-02-09 Thread Éric Araujo

Changes by Éric Araujo :


--
Removed message: http://bugs.python.org/msg120847

___
Python tracker 

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



[issue10361] Fix issue 9995 - distutils forces developers to store password in cleartext (issue2874041)

2011-02-09 Thread Éric Araujo

Changes by Éric Araujo :


--
Removed message: http://bugs.python.org/msg128245

___
Python tracker 

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



[issue9995] "setup.py register sdist upload" requires pass to be saved

2011-02-09 Thread Éric Araujo

Éric Araujo  added the comment:

Thanks for the editions.  Further comments on rietveld.

Miscellaneous things:

1) Storing passwords in an hashed form is false security.  An attacker that can 
read a config file with plain text passwords can also just run commands that 
use hashed passwords from the config file, so the security focus should be in 
forbidding access to your files, not worrying about passwords in plain text.

2) http://wiki.python.org/moin/Distutils/FixingBugs has the guidelines you’re 
asking for.

3) I do not need a CVE to evaluate if an issue is a security risk, because 
http://www.python.org/dev/workflow/ tells me that it’s when “somehow someone is 
able to gain escalated privileges when they shouldn't be able to.”

4) Could you remove rep...@bugs.python.org from the issue Cc?  It goes to the 
wrong bug report.


Comment from Tarek (which does not address my specific question about None vs. 
empty string):

Looks good to me:

the upload command will get the credentials from the session instead of using 
the existing config at all.

I remember that we changed the behavior to you'd had to set ONLY the user in 
the rc file, but allowing to pass the user is better since it make the config 
file optional

--
stage:  -> patch review
versions: +Python 3.3

___
Python tracker 

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



[issue11165] Document PyEval_Call* functions

2011-02-09 Thread Nick Coghlan

New submission from Nick Coghlan :

There are currently undocumented PyEval_Call* equivalents to a number of the 
PyObject_Call* functions.

Since there are resources out there on the web that direct people to use the 
currently undocumented PyEval functions, it would be good to document those 
properly, and recommend people typically use the PyObject_Call* variants 
instead (as the latter include all the stack and interpreter state integrity 
protection code, while the PyEval variants assume that has all already been 
handled).

--
assignee: docs@python
components: Documentation
keywords: easy
messages: 128248
nosy: docs@python, ncoghlan
priority: normal
severity: normal
stage: needs patch
status: open
title: Document PyEval_Call* functions
versions: Python 2.7, Python 3.2, Python 3.3

___
Python tracker 

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



[issue11165] Document PyEval_Call* functions

2011-02-09 Thread Nick Coghlan

Nick Coghlan  added the comment:

Removed the easy tag, since this may involve some python-dev discussion as to 
where to put them in C API docs (they don't really fit in any of the current 
sections).

Perhaps an "advanced APIs" section, for things that most C extensions or 
embedding applications really shouldn't be using.

--

___
Python tracker 

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



[issue8853] getaddrinfo should accept port of type long

2011-02-09 Thread Sandro Tosi

Sandro Tosi  added the comment:

Hi Mark, would you like to write some tests about the proposed change? Antoine 
gave a fast look at the issue and believe it's acceptable for 2.7.

--
nosy: +sandro.tosi
stage:  -> test needed
versions: +Python 2.7 -Python 2.6

___
Python tracker 

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



[issue10361] Fix issue 9995 - distutils forces developers to store password in cleartext (issue2874041)

2011-02-09 Thread Éric Araujo

Changes by Éric Araujo :


--
Removed message: http://bugs.python.org/msg120860

___
Python tracker 

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



[issue11163] iter() documentation code doesn't work

2011-02-09 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
nosy: +rhettinger

___
Python tracker 

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



[issue6626] show Python mimetypes module some love

2011-02-09 Thread Éric Araujo

Éric Araujo  added the comment:

Thanks for working on cleaning up that module.  I have to agree with Nick 
though (see also minor comments on Rietveld): code in the stdlib just can’t 
move as freely as outside of it.

I’m updating the version to 3.3, given that this patch adds new features and 
refactors things (stable branches only get bug fixes).

--
versions: +Python 3.3 -Python 2.7, Python 3.2

___
Python tracker 

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



[issue1208304] urllib2's urlopen() method causes a memory leak

2011-02-09 Thread gdub

Changes by gdub :


--
nosy: +gdub

___
Python tracker 

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



[issue4676] python3 closes + home keys

2011-02-09 Thread Éric Araujo

Éric Araujo  added the comment:

Can this bug be closed?

--
nosy: +eric.araujo

___
Python tracker 

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



[issue11038] Some commands should stop if Name and Version are missing

2011-02-09 Thread Éric Araujo

Éric Araujo  added the comment:

gawel confirmed on IRC that this was an oversight.  On second thought, I 
decided to remove the constant, which I deemed unneeded: it doesn’t save time 
for programmers (there is code checking various subsets of the fields 
everywhere, just one constant does not reduce code significantly), and I don’t 
think it saves computer time either (local literals vs. global 
lookup—unprofiled though).  Alexis pulled my change (7e1118583e5f).

--

___
Python tracker 

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



[issue9298] binary email attachment issue with base64 encoding

2011-02-09 Thread Yves Dorfsman

Yves Dorfsman  added the comment:

Solution:
In /usr/lib/python3.1/email/encoders.py, use encodebytes instead of b64encode:

--- encoders.py 2011-02-08 09:37:21.025030051 -0700
+++ encoders.py.yves2011-02-08 09:38:04.945608365 -0700
@@ -12,7 +12,7 @@
 ]
 
 
-from base64 import b64encode as _bencode
+from base64 import encodebytes as _bencode
 from quopri import encodestring as _encode

--

___
Python tracker 

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



[issue9298] binary email attachment issue with base64 encoding

2011-02-09 Thread Yves Dorfsman

Yves Dorfsman  added the comment:

#!/usr/bin/python3.1

import unittest
import email.mime.image


class emailEncoderTestCase(unittest.TestCase):
  def setUp(self):

# point to an image
binaryfile = 
'/usr/share/openclipart/png/animals/mammals/happy_monkey_benji_park_01.png'

while len(binaryfile) == 0:
  print('Enter the name of an image: ')
  binaryfile = raw_input()

fp = 
open('/usr/share/openclipart/png/animals/mammals/happy_monkey_benji_park_01.png',
 'rb')
self.bindata = fp.read()


  def test_convert(self):

mimed = email.mime.image.MIMEImage(self.bindata, _subtype='png')

base64ed = mimed.get_payload()
# print (base64ed)

# work out if any line within the string is > 76 chars
chopped = base64ed.split('\n')
lengths = [ len(x) for x in chopped ]
toolong = [ x for x in lengths if x > 76 ]

msg = 'There is at least one line of ' + str(max(lengths)) + ' chars.'
self.assertEqual(0, len(toolong), msg)



if __name__ == '__main__':
  unittest.main()

--

___
Python tracker 

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



[issue9298] binary email attachment issue with base64 encoding

2011-02-09 Thread Yves Dorfsman

Yves Dorfsman  added the comment:

Here's a better version (sorry I don't know how to remove msg128255:

--

___
Python tracker 

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



[issue9298] binary email attachment issue with base64 encoding

2011-02-09 Thread Yves Dorfsman

Yves Dorfsman  added the comment:

#!/usr/bin/python3.1

import unittest
import email.mime.image


class emailEncoderTestCase(unittest.TestCase):
  def setUp(self):

# point to an image
binaryfile = ''
#binaryfile = 
'/usr/share/openclipart/png/animals/mammals/happy_monkey_benji_park_01.png'

while len(binaryfile) == 0:
  print('Enter the name of an image: ')
  binaryfile = input()

fp = open(binaryfile, 'rb')
self.bindata = fp.read()


  def test_convert(self):

mimed = email.mime.image.MIMEImage(self.bindata, _subtype='png')

base64ed = mimed.get_payload()
# print (base64ed)

# work out if any line within the string is > 76 chars
chopped = base64ed.split('\n')
lengths = [ len(x) for x in chopped ]
toolong = [ x for x in lengths if x > 76 ]

msg = 'There is at least one line of ' + str(max(lengths)) + ' chars.'
self.assertEqual(0, len(toolong), msg)



if __name__ == '__main__':
  unittest.main()

--

___
Python tracker 

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



[issue10966] eliminate use of ImportError implicitly representing TestSkipped

2011-02-09 Thread Brett Cannon

Brett Cannon  added the comment:

Here is a patch which has added the necessary changes to 
test.support.import_module() and placed the necessary changes in the test 
suites themselves. I still need to rip out the (un)expected test stuff from 
regrtest before I consider the patch complete.

--
assignee:  -> brett.cannon
keywords: +patch
Added file: http://bugs.python.org/file20725/issue10966.diff

___
Python tracker 

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



[issue4681] mmap offset should be off_t instead of ssize_t, and size calculation needs corrected

2011-02-09 Thread wrobell

wrobell  added the comment:

will this patch support off_t for "mmap.resize" as well? ftruncate uses off_t 
for the length of a file as well.

--
nosy: +wrobell

___
Python tracker 

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



[issue10966] eliminate use of ImportError implicitly representing SkipTest

2011-02-09 Thread Brett Cannon

Changes by Brett Cannon :


--
title: eliminate use of ImportError implicitly representing TestSkipped -> 
eliminate use of ImportError implicitly representing SkipTest

___
Python tracker 

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



[issue11166] No exit when daemon thread is running.

2011-02-09 Thread Dan Mahn

New submission from Dan Mahn :

I have a python-based test script that creates a daemon thread.  The foreground 
basically runs a loop of commands, while the daemon thread sends some UDP data 
on the network.  To stop the script, I use Control-C.  This is running under 
64-bit Windows (Vista) with 64-bit Python.

This script was developed under Python version 3.0, and has been running fine 
with 3.1.  I downloaded 3.2RC1 and noticed that the script does not exit with 
the typical Ctrl-C.  I also tried 3.2RC2, which had the same effect.  If I do 
not start the background thread, the test exits normally.

If I use Python 3.1, but I don't set the daemon attribute on the background 
thread, the operation duplicates the problem.  Therefore, I believe there is a 
problem with 3.2 handling of daemon threads.

--
components: None
messages: 128260
nosy: dmahn
priority: normal
severity: normal
status: open
title: No exit when daemon thread is running.
type: behavior
versions: Python 3.2

___
Python tracker 

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



[issue4681] mmap offset should be off_t instead of ssize_t, and size calculation needs corrected

2011-02-09 Thread Ross Lagerwall

Ross Lagerwall  added the comment:

> will this patch support off_t for "mmap.resize" as well?
> ftruncate uses off_t for the length of a file as well.

No, it doesn't because resize() resizes the amount mmapped in memory which 
can't be more than ssize_t anyway. However, resizing does work on a 12GiB file 
with a large offset, e.g. 6GiB.

--

___
Python tracker 

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



[issue11158] Python VM deadlock

2011-02-09 Thread Pham Cong Dinh

Pham Cong Dinh  added the comment:

I just simplified my script into a smaller one that can be easier to understand 
and find out what happens

https://gist.github.com/819979

Thanks

--
resolution: invalid -> 
status: pending -> open

___
Python tracker 

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



[issue11158] Python VM deadlock

2011-02-09 Thread Pham Cong Dinh

Pham Cong Dinh  added the comment:

Sorry, just ignore my latest comment. It is for another issue

--

___
Python tracker 

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



[issue11148] Crash and error message from Python VM

2011-02-09 Thread Pham Cong Dinh

Pham Cong Dinh  added the comment:

I just simplified my script into a smaller one that can be easier to understand 
and find out what happens

https://gist.github.com/819979

Thanks

--

___
Python tracker 

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



[issue11158] Python VM deadlock

2011-02-09 Thread Pham Cong Dinh

Pham Cong Dinh  added the comment:

Hi Vinay,

Your example use a child process to receive log messages. I am implementing a 
thread-based solution. Do you think that multiprocessing.Queue() has major 
issues with threads or this problem happens only on Mac OSX implementations?

I still reproduce it quite easily on my system: Mac OS 10.6 and Python 2.6.6

--

___
Python tracker 

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



[issue9334] argparse does not accept options taking arguments beginning with dash (regression from optparse)

2011-02-09 Thread Steven Bethard

Steven Bethard  added the comment:

Maybe dont_assume_everything_that_looks_like_a_flag_is_intended_to_be_one 
should actually be a new class, e.g.

parser = AllowFlagsAsPositionalArgumentsArgumentParser()

Then you just wouldn't provide parse_known_args on that parser.

--

___
Python tracker 

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



[issue9399] Provide a 'print' action for argparse

2011-02-09 Thread Steven Bethard

Steven Bethard  added the comment:

Argparse's wrapping behavior is determined by the formatter_class:

http://docs.python.org/library/argparse.html#formatter-class

Is it reasonable to assume that if you're wrapping your own messages you're 
already specifying formatter_class=argparse.RawTextHelpFormatter? If so, then 
perhaps the message should be printed via something like:

formatter = parser._get_formatter()
formatter.add_text(self.message)
file.write(formatter.format_help())

This is what we do in _VersionAction, so I guess it's probably what we should 
do here.

--

___
Python tracker 

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