[issue8062] PEP 3101 string formatting missing hexadecimal separator _ for every 4 hex digits

2010-03-06 Thread Mark Dickinson

Mark Dickinson  added the comment:

I'm confused:  are you talking about producing underscores when formatting an 
integer for hexadecimal output, or allowing numeric literals to contain 
underscores?

Your perl example produces:

305441741

with not an underscore in sight.  I'm failing to understand the relevance of 
this example to your request.

--

___
Python tracker 

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



[issue7319] Silence DeprecationWarning by default

2010-03-06 Thread Florent Xicluna

Florent Xicluna  added the comment:

The -Qwarn/-Qwarnall options are unexpectedly silenced in 2.7.

--
nosy: +flox
stage:  -> commit review
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



[issue1731717] race condition in subprocess module

2010-03-06 Thread Florent Xicluna

Florent Xicluna  added the comment:

Sometimes IA64 Ubuntu bot fails on this one.
http://www.python.org/dev/buildbot/all/builders/ia64%20Ubuntu%20trunk/builds/571

--
keywords: +buildbot

___
Python tracker 

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



[issue6906] Tkinter sets an unicode environment variable on win32

2010-03-06 Thread Florent Xicluna

Florent Xicluna  added the comment:

confirmed on Win7 buildbot, when the tcl or tk test is run before test_wsgiref:

==
FAIL: test_simple_validation_error (test.test_wsgiref.IntegrationTests)
--
Traceback (most recent call last):
  File 
"D:\cygwin\home\db3l\buildarea\trunk.bolen-windows7\build\lib\test\test_wsgiref.py",
 line 159, in test_simple_validation_error
"AssertionError: Headers (('Content-Type', 'text/plain')) must"
AssertionError: "AssertionError: Environmental variable TCL_LIBRARY is not a 
string:  (value: 
u'D:cygwinhomedb3lbuildareatrunk.bolen-windows7tcltklibtcl8.5')"
 != "AssertionError: Headers (('Content-Type', 'text/plain')) must be of type 
list: "


http://www.python.org/dev/buildbot/all/builders/x86%20Windows7%20trunk/builds/171

This error was introduced with patch for #3881.

--
keywords: +buildbot
nosy: +flox
stage: test needed -> needs patch
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



[issue4180] warnings.simplefilter("always") does not make warnings always show up

2010-03-06 Thread Mark Dickinson

Mark Dickinson  added the comment:

+1 for Benjamin's patch, having just been bitten by this exact problem.

I'm trying to do unit testing, checking both that a piece of code produces a 
DeprecationWarning and that it gives the correct result, with something like:

with warnings.catch_warnings():
warnings.filterwarnings("ignore", category=DeprecationWarning)
self.assertEqual(my_func(my_args), expected_result)

with warnings.catch_warnings():
warnings.filterwarnings("error", category=DeprecationWarning)
self.assertRaises(DeprecationWarning, my_func, *my_args)

The first call still registers the warning, even though it's ignored, so the 
second assertRaises fails.  Benjamin's patch would seem to provide a way to fix 
this.

Perhaps I'm missing an obvious better way to do this.

N.B. The above is a too simple version of the real problem: it actually works 
as intended, for fragile reasons:  the "ignore"d warning is registered on 
__name__, while the "always"d warning ends up being registered on 
unittest.case, so there's no conflict.

--
nosy: +mark.dickinson

___
Python tracker 

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



[issue4180] warnings.simplefilter("always") does not make warnings always show up

2010-03-06 Thread Florent Xicluna

Changes by Florent Xicluna :


--
components: +Interpreter Core
nosy: +flox
stage:  -> patch review
versions: +Python 2.7 -Python 2.4, Python 2.5

___
Python tracker 

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



[issue7849] Improve "test_support.check_warnings()"

2010-03-06 Thread Mark Dickinson

Mark Dickinson  added the comment:

This is somewhat orthogonal, but it might also be nice to have some way to tell 
check_warnings not to touch __warningregistry__.  See also issue 4180.

--
nosy: +mark.dickinson

___
Python tracker 

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



[issue7449] A number tests "crash" if python is compiled --without-threads

2010-03-06 Thread STINNER Victor

STINNER Victor  added the comment:

> I think the latest (v3) patch is in pretty good shape. (...)
> I'll break up the patch into multiple files as well.
> It will make it easier to deal with if I cause a regression.

I'm already doing that (apply the patch file by file). The patch v3 is not 
perfect, some tests are still disabled whereas they can be executed without 
tests. Give me a few days to work on a new version of the patch.

--

___
Python tracker 

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



[issue5604] imp.find_module() mixes UTF8 and MBCS

2010-03-06 Thread Florent Xicluna

Florent Xicluna  added the comment:

Thanks for fixing this. Now Win7 buildbot is green on trunk.

--
stage: needs patch -> committed/rejected

___
Python tracker 

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



[issue5604] imp.find_module() mixes UTF8 and MBCS

2010-03-06 Thread Ezio Melotti

Ezio Melotti  added the comment:

The Linux buildbots were running the tests using ./python 
./Lib/test/regrtest.py instead of ./python -m test.regrtest and '' was missing 
from sys.path, so imp.find_module couldn't find the module.
This is now fixed in r78711 and backported r78716.
Thanks to Florent that noticed that those buildbots were using a different 
command to run the tests.

--
assignee:  -> ezio.melotti
resolution:  -> fixed
status: open -> closed

___
Python tracker 

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



[issue6906] Tkinter sets an unicode environment variable on win32

2010-03-06 Thread Florent Xicluna

Florent Xicluna  added the comment:

Fixed with r78722 on trunk. Pending backport to 2.6.

--
resolution:  -> fixed
stage: needs patch -> committed/rejected
status: open -> pending

___
Python tracker 

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



[issue8080] os.uname failing in windows

2010-03-06 Thread Stuart Axon

New submission from Stuart Axon :

I'm not sure why this is happening, but os.uname() is failing on my computer in 
XP Home 32bit.  Tested in the normal shell and MSys

The code in platform.py looks like it should work to me.


[C:\usr\Python26\Lib]python
Python 2.6.4 (r264:75708, Oct 26 2009, 08:23:19) [MSC v.1500 32 bit (Intel)] on 
win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import os
>>> os.uname()
Traceback (most recent call last):
  File "", line 1, in 
AttributeError: 'module' object has no attribute 'uname'
>>>

--
components: Library (Lib), Windows
messages: 100531
nosy: stuaxo
severity: normal
status: open
title: os.uname failing in windows
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



[issue8080] os.uname failing in windows

2010-03-06 Thread Brian Curtin

Brian Curtin  added the comment:

As documented, this is not supported on Windows.

http://docs.python.org/dev/library/os#os.uname
os.uname is generated in Modules/posixmodule.c, not in platform.py

--
nosy: +brian.curtin
resolution:  -> invalid
status: open -> closed

___
Python tracker 

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



[issue8080] os.uname failing in windows

2010-03-06 Thread Florent Xicluna

Florent Xicluna  added the comment:

Use platform.uname(), it is available on all platforms.

--
nosy: +flox
priority:  -> normal

___
Python tracker 

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



[issue1054943] Python may contain NFC/NFKC bug per Unicode PRI #29

2010-03-06 Thread Ezio Melotti

Changes by Ezio Melotti :


--
nosy: +ezio.melotti
resolution:  -> remind
stage: test needed -> committed/rejected
status: open -> pending
versions: +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



[issue6509] re.py - encounter unexpected str-object

2010-03-06 Thread Ezio Melotti

Ezio Melotti  added the comment:

Fixed in r78729 (py3k) and r78730 (release31-maint). I also added a test for 
callbacks.

--
resolution:  -> fixed
stage: patch review -> committed/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



[issue6815] UnicodeDecodeError in os.path.expandvars

2010-03-06 Thread Ezio Melotti

Ezio Melotti  added the comment:

This is a shorter snippet to reproduce the issue:
import os
os.environ['TEST'] = u'äö'.encode('iso-8859-1')
os.path.expandvars(u'%TEST%a')

If the var is a non-ASCII byte string, and the string passed to expandvars() is 
Unicode, the var is decoded implicitly using the ASCII codec and the decoding 
fails.

On Python 3 the situation looks even worse:
import os
os.environ['TEST'] = 'äö'.encode('iso-8859-1');
os.path.expandvars('%TEST%a')

This snippet returns "b'\\xe4\\xf6'a".

--
priority: normal -> high
versions: +Python 2.7, 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



[issue1054943] Python may contain NFC/NFKC bug per Unicode PRI #29

2010-03-06 Thread Martin v . Löwis

Changes by Martin v. Löwis :


--
status: pending -> open

___
Python tracker 

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



[issue6815] UnicodeDecodeError in os.path.expandvars

2010-03-06 Thread Brian Curtin

Brian Curtin  added the comment:

FWIW, _winreg.ExpandEnvironmentStrings does the right thing.

D:\python-dev\trunk>PCbuild\amd64\python.exe
Python 2.7a3+ (trunk, Feb 23 2010, 20:22:24) [MSC v.1500 64 bit (AMD64)] on 
win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import os, sys, _winreg
>>> os.environ["TEST"] = u"jalape\xf1o".encode(sys.getfilesystemencoding())
>>> print(os.path.expandvars(u"C:\\%TEST%"))
Traceback (most recent call last):
  File "", line 1, in 
  File "D:\python-dev\trunk\lib\ntpath.py", line 354, in expandvars
res = res + os.environ[var]
UnicodeDecodeError: 'ascii' codec can't decode byte 0xf1 in position 6: ordinal
not in range(128)
>>> print(_winreg.ExpandEnvironmentStrings(u"C:\\%TEST%"))
C:\jalapeño

--
nosy: +brian.curtin

___
Python tracker 

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



[issue8032] Add gdb7 hooks to make it easier to debug Python

2010-03-06 Thread Martin v . Löwis

Martin v. Löwis  added the comment:

Maybe I'm using it incorrectly, but my first attempt to use it failed:

gdb) b PyEval_EvalCodeEx
Breakpoint 1 at 0x80fc51d: file Python/ceval.c, line 3020.
(gdb) c
Continuing.
1+2

Breakpoint 1, PyEval_EvalCodeEx (co=0xb7d86928, globals=Traceback (most recent 
call last):
  File "/home/martin/work/27/python-gdb.py", line 574, in to_string
return stringify(proxyval)
  File "/home/martin/work/27/python-gdb.py", line 526, in stringify
return repr(val)
  File "/home/martin/work/27/python-gdb.py", line 271, in __repr__
for arg, val in self.attrdict.iteritems()])
AttributeError: 'FakeRepr' object has no attribute 'iteritems'
, locals=, args=0xb7d7eb00, argcount=1, kws=0x0, 
kwcount=0, defs=0x827c9b0, defcount=1, closure=)
at Python/ceval.c:3020
3020register PyObject *retval = NULL;

This was with the Python 2.7 trunk.

--

___
Python tracker 

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



[issue8032] Add gdb7 hooks to make it easier to debug Python

2010-03-06 Thread Martin v . Löwis

Martin v. Löwis  added the comment:

Attribution question: would it be ok if all mentioning of your name in the 
patch was removed accept for the one in Misc/ACKS? I'm concerned that 
statements of authorship may become incorrect over time (if people start 
contributing to it), yet nobody will dare to remove your copyright notice (for 
example).

--

___
Python tracker 

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



[issue6815] UnicodeDecodeError in os.path.expandvars

2010-03-06 Thread Brian Curtin

Brian Curtin  added the comment:

Here is a patch for trunk.
It works for me, but my Unicode knowledge isn't the strongest. I believe 
sys.getfilesystemencoding() is what we want here. Can anyone confirm?

--
keywords: +patch
nosy: +loewis
Added file: http://bugs.python.org/file16469/issue6815.diff

___
Python tracker 

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



[issue6953] readline documenation needs work

2010-03-06 Thread Alexander Belopolsky

Changes by Alexander Belopolsky :


--
nosy: +Alexander.Belopolsky

___
Python tracker 

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



[issue6815] UnicodeDecodeError in os.path.expandvars

2010-03-06 Thread Martin v . Löwis

Martin v. Löwis  added the comment:

I think the patch is incorrect. It shouldn't do any encoding conversion, but 
perform the expanding completely in Unicode strings.

For 2.x, I recommend to close this as "won't fix". Expanding a Unicode strings 
is just not supported. If it was supported, it should be supported correctly, 
i.e. allowing both environment variable names and environment variable values 
to have non-ASCII characters in them, and, on Windows, even non-MBCS characters.

--

___
Python tracker 

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



[issue6815] UnicodeDecodeError in os.path.expandvars

2010-03-06 Thread Martin v . Löwis

Changes by Martin v. Löwis :


--
priority: high -> normal

___
Python tracker 

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



[issue7319] Silence DeprecationWarning by default

2010-03-06 Thread Brett Cannon

Brett Cannon  added the comment:

So it isn't really unexpected as -Q uses DeprecationWarning which is being 
silenced by default.

So either -Q has to turn DeprecationWarning back on or a new subclass of 
DeprecationWarning (say IntegerDivisionWarning) needs to be introduced that -Q 
uses and adds to the warnings filter.

And FYI, I did backport the patch but forgot to close the issue.

--

___
Python tracker 

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



[issue7245] better Ctrl-C support in pdb (program can be resumed) (issue216067)

2010-03-06 Thread Ilya Sandler

Ilya Sandler  added the comment:

Another version of the patch is attached ( I think, I fixed all the remaining 
style issues).

I'll answer the testing question in a separate post

--
Added file: http://bugs.python.org/file16470/sig.patch.v3

___
Python tracker 

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



[issue7245] better Ctrl-C support in pdb (program can be resumed) (issue216067)

2010-03-06 Thread Ilya Sandler

Ilya Sandler  added the comment:

new version of the patch is uploaded to bugs.python.org

http://codereview.appspot.com/216067/diff/2001/2002
File Lib/pdb.py (right):

http://codereview.appspot.com/216067/diff/2001/2002#newcode63
Lib/pdb.py:63: def sigint_handler(self, signum, frame):
On 2010/02/28 20:12:00, gregory.p.smith wrote:
> Please move this below the __init__ definition.  It makes classes odd
to read
> when __init__ isn't the first method defined when people are looking
for the
> constructor to see how to use it.

Done.

http://codereview.appspot.com/216067/diff/2001/2002#newcode64
Lib/pdb.py:64: if self.allow_kbdint:
On 2010/02/28 20:12:00, gregory.p.smith wrote:
> Initialize self.allow_kdbint in __init__ so that a SIGINT coming in
before
> _cmdloop has run doesn't cause an AttributeError.

Done.

http://codereview.appspot.com/216067/diff/2001/2002#newcode215
Lib/pdb.py:215: # keyboard interrupts allow for an easy way to interrupt
On 2010/02/28 20:12:00, gregory.p.smith wrote:
> "to cancel the current command"

I changed the wording a bit, should be ok now.

http://codereview.appspot.com/216067/diff/2001/2002#newcode356
Lib/pdb.py:356: #it appears that that when pdb is reading input from a
pipe
On 2010/02/28 20:12:00, gregory.p.smith wrote:
> Space after the # please.

this code
> is?

particular
> interrupted command from the list of commands to run at the current
breakpoint
> but I may be misreading things as I haven't spent much time in pdb.py.

Done. I've also added a comment to explain what's going on.

http://codereview.appspot.com/216067/show

--

___
Python tracker 

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



[issue7670] _sqlite3: Block *all* operations on a closed Connection object

2010-03-06 Thread Benjamin Peterson

Changes by Benjamin Peterson :


--
versions:  -Python 2.7, 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



[issue7319] Silence DeprecationWarning by default

2010-03-06 Thread Brett Cannon

Brett Cannon  added the comment:

Posted to python-dev to solicit feedback on how to handle this.

--
stage: commit review -> needs patch
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



[issue6953] readline documenation needs work

2010-03-06 Thread Éric Araujo

Changes by Éric Araujo :


--
nosy: +merwok

___
Python tracker 

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



[issue7712] Add a context manager to change cwd in test.test_support and run the test suite in a temp dir.

2010-03-06 Thread Éric Araujo

Éric Araujo  added the comment:

Hello

One advice against using __file__: 
http://lists.debian.org/debian-python/2010/01/msg00172.html

Regards

--
nosy: +merwok

___
Python tracker 

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



[issue8045] test_tcl aborts on OS X 10.6 with "The application with bundle ID org.python.python is running setugid(), which is not allowed."

2010-03-06 Thread Benjamin Peterson

Benjamin Peterson  added the comment:

Ported Gregory's fix to py3k and 3.1.

--
nosy: +benjamin.peterson
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



[issue8078] add more baud constants to termios

2010-03-06 Thread Brian Curtin

Changes by Brian Curtin :


--
components: +Library (Lib)
priority:  -> normal
stage:  -> needs patch
versions: +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



[issue8045] test_tcl aborts on OS X 10.6 with "The application with bundle ID org.python.python is running setugid(), which is not allowed."

2010-03-06 Thread Ned Deily

Ned Deily  added the comment:

Moving the test to a child process does avoid the problem.
(BTW, so far I've only seen the failure when Tkinter is linked with the 
Apple-supplied Tk 8.5 in 10.6, not with Tk 8.4.)

--

___
Python tracker 

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



[issue8081] a.append appends reference , causing unexpected behaviour

2010-03-06 Thread hamish farrant

New submission from hamish farrant :

Causes modification of an list object to change the values of the object 
already inside the list.

Example code :

import random
a  =[]
b = [1 , 2 , 3 , 4]
for i in range (15):
random.shuffle(b)
a.append(b)
for j in a:
print j

Expected Behaviour : the list referenced by b , should be appended to a , 
creating a list of random permutations of b.

--
components: Interpreter Core
messages: 100548
nosy: hamish.farrant
severity: normal
status: open
title: a.append appends reference , causing unexpected behaviour
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



[issue8081] a.append appends reference , causing unexpected behaviour

2010-03-06 Thread Benjamin Peterson

Benjamin Peterson  added the comment:

Sorry, this is the expected behavior. Copy the list if you want a different one.

--
nosy: +benjamin.peterson
resolution:  -> invalid
status: open -> closed

___
Python tracker 

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



[issue1685453] email package should work better with unicode

2010-03-06 Thread Peter Kleiweg

Peter Kleiweg  added the comment:

In Python 3.1.1, email.mime.text.MIMEText accepts an 8-bit charset, but not 
utf-8.

I think you should not have to specify a charset. All strings are unicode now, 
so I think the package should choose an appropriate charset based on the 
characters in the text, us-ascii, some iso-8859 charset, or utf-8, whatever 
fits.


Python 3.1.1 (r311:74480, Oct  2 2009, 11:50:52)
  
[GCC 4.1.2 20061115 (prerelease) (Debian 4.1.1-21)] on linux2   
  
Type "help", "copyright", "credits" or "license" for more information.  
  
>>> from email.mime.text import MIMEText
>>>   
>>> text = 'H\u00e9'
>>>   
>>> msg = MIMEText(text, 'plain', 'iso-8859-1') 
>>>   
>>> print(msg.as_string())  
>>>   
Content-Type: text/plain; charset="iso-8859-1"  
  
MIME-Version: 1.0   
  
Content-Transfer-Encoding: quoted-printable 
  

  
H=E9
  
>>> msg = MIMEText(text, 'plain', 'utf-8')  
>>>   
Traceback (most recent call last):  
  
  File "/my/opt/Python-3/lib/python3.1/email/message.py", line 269, in 
set_charset
cte(self)   
  
TypeError: 'str' object is not callable 
  

  
During handling of the above exception, another exception occurred: 
  

  
Traceback (most recent call last):  
  
  File "", line 1, in
  
  File "/my/opt/Python-3/lib/python3.1/email/mime/text.py", line 30, in 
__init__  
self.set_payload(_text, _charset)   
  
  File "/my/opt/Python-3/lib/python3.1/email/message.py", line 234, in 
set_payload
self.set_charset(charset)   
  
  File "/my/opt/Python-3/lib/python3.1/email/message.py", line 271, in 
set_charset
self._payload = charset.body_encode(self._payload)  
  
  File "/my/opt/Python-3/lib/python3.1/email/charset.py", line 380, in 
body_encode
return email.base64mime.body_encode(string) 
  
  File "/my/opt/Python-3/lib/python3.1/email/base64mime.py", line 94, in 
body_encode  
enc = b2a_base64(s[i:i + max_unencoded]).decode("ascii")
  
TypeError: must be bytes o

[issue8082] Misleading exception when raising an object

2010-03-06 Thread Daniel Eloff

New submission from Daniel Eloff :

>>> class Foo(object):
... pass
... 
>>> raise Foo()
Traceback (most recent call last):
  File "", line 1, in 
TypeError: exceptions must be classes or instances, not Foo
>>> class Foo(Exception):
... pass
... 
>>> raise Foo()
Traceback (most recent call last):
  File "", line 1, in 
Foo
>>> class Foo(BaseException):
... pass
... 
>>> raise Foo()
Traceback (most recent call last):
  File "", line 1, in 
Foo

It seems exceptions can only be subclasses of BaseException, the error message 
is confusing and false.

--
messages: 100551
nosy: Daniel.Eloff
severity: normal
status: open
title: Misleading exception when raising an object
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



[issue8059] @unittest.skip on a test method should prevent setUp from running

2010-03-06 Thread Ezio Melotti

Changes by Ezio Melotti :


--
nosy: +ezio.melotti

___
Python tracker 

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



[issue8062] PEP 3101 string formatting missing hexadecimal separator _ for every 4 hex digits

2010-03-06 Thread steven Michalske

steven Michalske  added the comment:

Sorry my request is for output,  I am not requesting input.  The examples were 
for showing the use in other contexts of using an underscore as a word (4 hex 
digits) seperaror.

My assertions are from another area aside from computer languages,  but from 
documentation for components.  So I showed a documentation example and software 
examples that used or would not accept underscores.

the common pratice of using a space is not good for computer output to be used 
for parsing in following applications.

--

___
Python tracker 

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



[issue7245] better Ctrl-C support in pdb (program can be resumed) (issue216067)

2010-03-06 Thread Ilya Sandler

Ilya Sandler  added the comment:

> Also, can you take a look at how the pdb unittests work and see if you
can come up with a way to unittest the KeyboardInterrupt behavior?

Yes, this is doable. In fact, I already have such tests written (unix only 
though). The tests are assert based but it should not be difficult to convert 
them to unittest. Moreover, I have many more tests for pdb written in the same 
style. 

However, these tests are not easily (and possibly not at all) integratable with 
existing test_pdb.py module. (See below for the problems). So would it be 
acceptable to have these tests as a separate module (test_pdb2.py or some 
such)? (I might also need some help with integrating the module)

Background
--

Here is the basic problem: testing/debugging a debugger is hard by itself (you 
need to deal with 2 programs at once: the one being debugged and the debugger 
which run intermittently), now throw in doctest and it becomes much harder (as 
everything you do now gets covered by another layer). And now we need to test 
signals and some of the tests will likely be platform specific which makes it 
even worse. 

In contrast, in my tests the snippets of code are written into a tmp file and 
then are fed into debugger, the debugger itself is run as a subprocess. So if a 
test fails, it can be easily rerun under debugger manually and you can  test 
for things like pdb exits and stalls.

Here is a snippet from my pdb tests (just to give an idea how they would look 
like: essentially, send a command to pdb, check the response).


  pdb=PdbTester("pdb_t_hello","""\
  import time
  for i in xrange(1):
 time.sleep(0.05)
  """)

  pdb.pdbHandle.stdin.write("c\n")
  time.sleep(0.01)
  #pdb_t_hello running, try to interrupt it
  pdb.pdbHandle.send_signal(signal.SIGINT)
  pdb.waitForPrompt()
  pdb.queryAndMatch("p i", "0")
  pdb.query("n")
  pdb.query("n")
  pdb.queryAndMatch("p i", "1")
  pdb.query("s")
  pdb.query("s")
  pdb.queryAndMatch("p i","2")
  pdb.pdbHandle.stdin.write("c\n")
  time.sleep(0.03)
  pdb.pdbHandle.send_signal(signal.SIGINT)
  pdb.waitForPrompt()
  pdb.queryAndMatch("p i","3")

--

___
Python tracker 

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



[issue7849] Improve "test_support.check_warnings()"

2010-03-06 Thread Florent Xicluna

Changes by Florent Xicluna :


Removed file: http://bugs.python.org/file16120/issue7849_check_warnings_v2.diff

___
Python tracker 

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



[issue7849] Improve "test_support.check_warnings()"

2010-03-06 Thread Florent Xicluna

Florent Xicluna  added the comment:

Patch updated.

--
assignee:  -> flox
resolution:  -> accepted
versions: +Python 3.2
Added file: http://bugs.python.org/file16471/issue7849_check_warnings_v3.diff

___
Python tracker 

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



[issue8065] Memory leak in readline.get_current_history_length

2010-03-06 Thread Alexander Belopolsky

Alexander Belopolsky  added the comment:

It appears that the tests that I attached fail when libedit is used.  This is 
clearly due to bugs in libedits readline emulation:

1. read_history does not update history_length

2. history_truncate_file does not preserver the history cookie ("_HiStOrY_V2_").

Does anyone know where libedit bugs should be reported?

--
nosy: +ronaldoussoren

___
Python tracker 

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



[issue8082] Misleading exception when raising an object

2010-03-06 Thread Benjamin Peterson

Benjamin Peterson  added the comment:

Done in r78746.

--
nosy: +benjamin.peterson
resolution:  -> fixed
status: open -> closed

___
Python tracker 

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



[issue7564] test_ioctl may fail when run in background

2010-03-06 Thread Florent Xicluna

Changes by Florent Xicluna :


--
assignee:  -> flox
priority: low -> normal
versions:  -Python 2.6, Python 3.1

___
Python tracker 

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



[issue8037] multiprocessing.Queue's put() not atomic thread wise

2010-03-06 Thread Vilnis Termanis

Changes by Vilnis Termanis :


Removed file: http://bugs.python.org/file16473/queues.diff

___
Python tracker 

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



[issue8037] multiprocessing.Queue's put() not atomic thread wise

2010-03-06 Thread Vilnis Termanis

Vilnis Termanis  added the comment:

Updated patch to include new test (now against release26-maint branch). 
Verified test_multiprocessing suite passes before (apart from new test) & after 
change. (Tested under Ubuntu 9.10 64-bit)

--
Added file: http://bugs.python.org/file16473/queues.diff

___
Python tracker 

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



[issue5341] A selection of spelling errors and typos throughout source

2010-03-06 Thread Éric Araujo

Éric Araujo  added the comment:

Hello again

And now for something completely different: more builtin/built-in/built in 
fixes. I hope it’s okay to edit Misc/HISTORY and old Misc/NEWS entries.

Note that I fixed two unrelated typos that I noticed near “builtin” uses.

Some day I’ll do something more useful for Python.

Cheers

--
Added file: http://bugs.python.org/file16474/moreboredom.diff

___
Python tracker 

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



[issue8037] multiprocessing.Queue's put() not atomic thread wise

2010-03-06 Thread Vilnis Termanis

Changes by Vilnis Termanis :


Removed file: http://bugs.python.org/file16415/pickle_suggestion_v2.patch

___
Python tracker 

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



[issue8037] multiprocessing.Queue's put() not atomic thread wise

2010-03-06 Thread Vilnis Termanis

Vilnis Termanis  added the comment:

Updated patch to include new test (now against release26-maint branch). 
Verified test_multiprocessing suite passes before (apart from new test) & after 
change. (Tested under Ubuntu 9.10 64-bit)

--
Added file: http://bugs.python.org/file16472/queues.diff

___
Python tracker 

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



[issue8037] multiprocessing.Queue's put() not atomic thread wise

2010-03-06 Thread Vilnis Termanis

Changes by Vilnis Termanis :


Removed file: http://bugs.python.org/file16472/queues.diff

___
Python tracker 

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



[issue8037] multiprocessing.Queue's put() not atomic thread wise

2010-03-06 Thread Vilnis Termanis

Changes by Vilnis Termanis :


Added file: http://bugs.python.org/file16475/queues.diff

___
Python tracker 

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



[issue1530559] struct.pack raises TypeError where it used to convert

2010-03-06 Thread Meador Inge

Meador Inge  added the comment:

> If anyone's interested in submitting a patch, it would be welcome.

Sure.  I saw where this was partly addressed in r78690.  The attached patch 
adds support for the '__index__' conversion that Mark
suggested.  

At first glance, the patch may seem more than what is needed.  However, most of 
the diffs are due to pulling parts of the C
implementation into a Python veneer.  This will make preprocessing work (like 
what was needs for this fix) easier now and in the future.  In addition, it 
will lay a small amount of groundwork for the changes that are needed for 
resolving issue 3132.  As that work will be simplified by having the veneer as 
well.

--
nosy: +minge
Added file: http://bugs.python.org/file16476/issue-1530559.patch

___
Python tracker 

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



[issue1410680] Add 'surgical editing' to ConfigParser

2010-03-06 Thread Éric Araujo

Changes by Éric Araujo :


--
nosy: +merwok

___
Python tracker 

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



[issue7540] urllib2 request does not update content length after new add_data

2010-03-06 Thread Senthil Kumaran

Senthil Kumaran  added the comment:

Change is reverted from other branches too. Discussed in IRC, that changes made 
to an existing API like add_data,may break some existing applications, even if 
its done to prevent unsupported usage. 

Specifically, in mechanize's case, it was not reusing req object, but using 
add_data method more than once before req was getting submitted. This is under 
scenarios wherein code as in zope.testbrowser) is centered on the browser 
controls; any twiddle to a control could update the req object before its 
submitted. This could be changed in mechanize, but in general agreed to fact 
that changes to existing API should not result in breaking of apps.

We can address the non-reusablity of request by adding a boolean that signifies 
if a request has been used and throw an exception if one is used a second time 
( benji's suggestion). And of course clarify the supported and intended 
scenarios via documentation.

--
resolution: fixed -> accepted

___
Python tracker 

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



[issue5341] A selection of spelling errors and typos throughout source

2010-03-06 Thread Éric Araujo

Éric Araujo  added the comment:

Here is the path that rewraps lines longer than 80 characters.

Note that it is possible than some lines were unnecessarily rewrapped; I’m not 
really sure whether my editor displays the characters count or the index of the 
next character. Sorry about that.

I’ve noticed that some parts were wrapped to 72 characters and other to 80. 
PEP 8 tells to wrap text to 72 characters in Python files; is there a similar 
guideline for the doc anywhere?

If anyone know of a tool that can report lines longer that a certain length 
(preferably encoding-aware, i.e. counting characters and not bytes), I’d be 
glad to hear of it.

Cheers

--
Added file: http://bugs.python.org/file16479/some-rewrapping.diff

___
Python tracker 

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



[issue5341] A selection of spelling errors and typos throughout source

2010-03-06 Thread Éric Araujo

Éric Araujo  added the comment:

I grepped for “built-in” in Doc and found very few misuses. Patch attached.

Some lines needed rewrapping, I made another patch for this to ease reviewing.

Cheers

--
Added file: http://bugs.python.org/file16478/doc.diff

___
Python tracker 

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



[issue8045] test_tcl aborts on OS X 10.6 with "The application with bundle ID org.python.python is running setugid(), which is not allowed."

2010-03-06 Thread Gregory P. Smith

Gregory P. Smith  added the comment:

merged into release26-maint r78754.

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

___
Python tracker 

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



[issue8039] precedence rules for ternary operator

2010-03-06 Thread Meador Inge

Meador Inge  added the comment:

It seems to me from the grammar 
(http://docs.python.org/reference/expressions.html#grammar-token-conditional_expression)
 that the precedence for conditional expressions fall in between that of 
'lambda' and 'or' expressions.

--
keywords: +patch
nosy: +minge
versions: +Python 2.7
Added file: http://bugs.python.org/file16477/issue-8039.patch

___
Python tracker 

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



[issue8065] Memory leak in readline.get_current_history_length

2010-03-06 Thread Ronald Oussoren

Ronald Oussoren  added the comment:

On 7 Mar, 2010, at 1:02, Alexander Belopolsky wrote:
> 
> 
> Does anyone know where libedit bugs should be reported?

Apple's bugreporter. (bugreport.apple.com, you need an ADC account to report 
bugs).

--
Added file: http://bugs.python.org/file16480/smime.p7s

___
Python tracker 

___

smime.p7s
Description: S/MIME cryptographic signature
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com