[issue1028] Tkinter binding involving Control-spacebar raises unicode error

2009-07-19 Thread Winfried Plappert

Winfried Plappert  added the comment:

I have the problem described in issue6512 and here is some information 

Python version - hand compiled on Ubuntu 9.04:
Python 3.1 (r31:73572, Jul 18 2009, 11:13:40) 
[GCC 4.3.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import tkinter
>>> print(tkinter.Tcl().tk.call('info', 'patchlevel'))
8.5.6

The previous Tcl/Tk version I had initially installed was a 8.4.x
version - which fails on Control-2 error described in detail in issue6512. 
- I decided to upgrade Tcl/Tk to version 8.5. 
- So I made a "make distclean" 
- copied the contents of /usr/include/tcl85 one level higher, so Python
could access the necessary tk.h and tcl.h files
- cd to my Python 3.1 source
- ./configure
- make 
- sudo make install

and tested again and my test program is now happily responding to a
Control-2 keystroke.

--
nosy: +wplappert
versions: +Python 3.1

___
Python tracker 

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



[issue6504] infinite recursion from calling builtins.open()

2009-07-19 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Yes, we conditionally import the "locale" module in order to guess the
encoding when it is not specified by the caller. We can't import it at
module initialization time because it would cause bootstrapping issues.

The Python equivalent of the logic expressed in C code in the _io module
can be found here:
http://code.python.org/hg/branches/py3k/file/51117227ac82/Lib/_pyio.py#l1410

--

___
Python tracker 

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



[issue6492] xml.etree does not escape CR, LF and TAB characters within attribute values

2009-07-19 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
assignee:  -> effbot
nosy: +effbot

___
Python tracker 

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



[issue6499] Can't import xmlrpclib, DocXMLRPCServer and SimpleXMLRPCServer when zlib is not available

2009-07-19 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Kristján, zlib is only built when the required development headers (.h
files for the zlib library) are available.

--
nosy: +pitrou

___
Python tracker 

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



[issue4200] atexit module not safe in Python 3.0 with multiple interpreters

2009-07-19 Thread Graham Dumpleton

Graham Dumpleton  added the comment:

I know this issue is closed, but for this patch, the code:

+modstate = get_atexitmodule_state(module);
+
+if (modstate->ncallbacks == 0)
+return;

was added.

Is there any condition under which modstate could be NULL.

Haven't touched Python 3.0 support in mod_wsgi for a long time and when 
revisiting code with final Python 3.0, I find that I get Py_Finalize() 
crashing on process shutdown. It is crashing because modstate above is 
NULL.

--

___
Python tracker 

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



[issue6415] warnings.warn segfaults on bad formatted string

2009-07-19 Thread R. David Murray

Changes by R. David Murray :


--
status: open -> closed

___
Python tracker 

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



[issue6521] Contradictory documentation for email.mime.text.MIMEText

2009-07-19 Thread Antoine Pitrou

New submission from Antoine Pitrou :

It is not obvious whether encoding of an unicode argument will happen or
not:

« [...] No guessing or encoding is performed on the text data.

Changed in version 2.4: The previously deprecated _encoding argument has
been removed. Encoding happens implicitly based on the _charset argument. »

http://docs.python.org/library/email.mime.html#email.mime.text.MIMEText

--
assignee: georg.brandl
components: Documentation
messages: 90711
nosy: georg.brandl, pitrou
severity: normal
stage: needs patch
status: open
title: Contradictory documentation for email.mime.text.MIMEText
versions: Python 2.6, 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



[issue6521] Contradictory documentation for email.mime.text.MIMEText

2009-07-19 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Apparently it doesn't:

>>> message = MIMEText(u"héhé", _charset="utf-8")
Traceback (most recent call last):
  File "", line 1, in 
  File "/usr/lib64/python2.6/email/mime/text.py", line 30, in __init__
self.set_payload(_text, _charset)
  File "/usr/lib64/python2.6/email/message.py", line 224, in set_payload
self.set_charset(charset)
  File "/usr/lib64/python2.6/email/message.py", line 266, in set_charset
self._payload = charset.body_encode(self._payload)
  File "/usr/lib64/python2.6/email/charset.py", line 387, in body_encode
return email.base64mime.body_encode(s)
  File "/usr/lib64/python2.6/email/base64mime.py", line 147, in encode
enc = b2a_base64(s[i:i + max_unencoded])
UnicodeEncodeError: 'ascii' codec can't encode character u'\xe9' in
position 1: ordinal not in range(128)

--

___
Python tracker 

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



[issue6521] Contradictory documentation for email.mime.text.MIMEText

2009-07-19 Thread Georg Brandl

Changes by Georg Brandl :


--
assignee: georg.brandl -> barry
nosy: +barry

___
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

2009-07-19 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
nosy: +pitrou
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



[issue4200] atexit module not safe in Python 3.0 with multiple interpreters

2009-07-19 Thread Benjamin Peterson

Benjamin Peterson  added the comment:

2009/7/19 Graham Dumpleton :
>
> Graham Dumpleton  added the comment:
>
> I know this issue is closed, but for this patch, the code:
>
> +    modstate = get_atexitmodule_state(module);
> +
> +    if (modstate->ncallbacks == 0)
> +        return;
>
> was added.
>
> Is there any condition under which modstate could be NULL.

The module is probably being deallocated before the callbacks are being called.

>
> Haven't touched Python 3.0 support in mod_wsgi for a long time and when
> revisiting code with final Python 3.0, I find that I get Py_Finalize()
> crashing on process shutdown. It is crashing because modstate above is
> NULL.

--

___
Python tracker 

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



[issue3244] multipart/form-data encoding

2009-07-19 Thread Alex Z.

Changes by Alex Z. :


--
nosy: +alexz

___
Python tracker 

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



[issue6499] Can't import xmlrpclib, DocXMLRPCServer and SimpleXMLRPCServer when zlib is not available

2009-07-19 Thread Kristján Valur Jónsson

Kristján Valur Jónsson  added the comment:

submitted revision 74098 and revision 74099 which should fix your issue.
Oh, and revision 74100 and revision 74101 as well (insufficient testing 
on my part, tsk. tsk.)

--

___
Python tracker 

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



[issue6499] Can't import xmlrpclib, DocXMLRPCServer and SimpleXMLRPCServer when zlib is not available

2009-07-19 Thread Ezio Melotti

Ezio Melotti  added the comment:

Thanks, now all the tests pass.
However I had intermittent failures (with a really useful error message)
on test_docxmlrpc:

$ ./python Lib/test/regrtest.py -v test_docxmlrpc
test_docxmlrpc
test_autolink_dotted_methods (test.test_docxmlrpc.DocXMLRPCHTTPGETServer)
Test that selfdot values are made strong automatically in the ... ok
test_autolinking (test.test_docxmlrpc.DocXMLRPCHTTPGETServer)
Test that the server correctly automatically wraps references to PEPS ... ok
test_invalid_get_response (test.test_docxmlrpc.DocXMLRPCHTTPGETServer)
... ok
test_lambda (test.test_docxmlrpc.DocXMLRPCHTTPGETServer)
Test that lambda functionality stays the same.  The output produced ... ok
test_system_methods (test.test_docxmlrpc.DocXMLRPCHTTPGETServer)
Test the precense of three consecutive system.* methods. ... ok
test_valid_get_response (test.test_docxmlrpc.DocXMLRPCHTTPGETServer) ... ok

--
Ran 6 tests in 0.392s

OK
1 test OK.
Unhandled exception in thread started by
Error in sys.excepthook:

Original exception was:

--

___
Python tracker 

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



[issue6026] test_(zipfile|zipimport|gzip|distutils|sqlite) fail if zlib is not available

2009-07-19 Thread Ezio Melotti

Ezio Melotti  added the comment:

Here's a new patch.

I added a could of @skipUnless in test_sqlite because two tests were
failing. 
I couldn't notice this before because I didn't have _sqlite3 and these
tests were skipped. Thanks to R. David Murray for reporting the problem.

In test_zipimport, the tests in 2/3 of the classes can be executed when
zlib is missing (and not only 1/3 as I initially thought). Removed zlib
= test_support.import_module('zlib') and added a @skipUnless(zlib,
"requires zlib"). Thanks again to David for this.

test_multiprocessing, test_xmplrpc and test_docxmlrpc were fixed in
#6499, so they are not part of this issue anymore.

--
keywords:  -patch
title: test_(zipfile|zipimport|gzip|distutils|multiprocessing|xmlrpc|docxmlrpc) 
fail if zlib is not available -> test_(zipfile|zipimport|gzip|distutils|sqlite) 
fail if zlib is not available
Added file: http://bugs.python.org/file14524/issue6026-2.diff

___
Python tracker 

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



[issue6026] test_(zipfile|zipimport|gzip|distutils|sqlite) fail if zlib is not available

2009-07-19 Thread Ezio Melotti

Changes by Ezio Melotti :


--
keywords: +patch

___
Python tracker 

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



[issue5262] PythonLauncher considered harmfull

2009-07-19 Thread Kevin Walzer

Kevin Walzer  added the comment:

I disagree that this is a bad idea--it's helpful to be able to double-
click a GUI script and launch it automatically. I realize one can just 
fire up Terminal and go "python myscript.py," but I missed this 
functionality when it was broken and would be unhappy to see it removed.

--
nosy: +wordtech

___
Python tracker 

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



[issue6522] docs for unittest.expectedFailure do not syntactically show it's a decorator

2009-07-19 Thread Brett Cannon

New submission from Brett Cannon :

If you look at the docs for the unittest.expectedFailure decorator you 
will notice it shows a set of empty parentheses since it is set with a 
function directive. But since it's a decorator those empty parentheses 
are not accurate.

If you want to view the docs as showing common usage -- like the docs 
for the other decorators in unittest -- then those empty parentheses 
need to go. An @ should also probably be added as well.

But if you view it more as how the decorator is called -- like with 
importlib.util.module_for_loader does -- then it should have an argument 
for the callable being passed in. This would also mean that all the 
other decorators in unittest need a second set of parentheses taking a 
callable as their argument as well.

Perhaps it's time we added a decorator directive that adds the @ sign 
and does not insert empty parentheses?

--
assignee: georg.brandl
components: Documentation
messages: 90718
nosy: brett.cannon, georg.brandl
priority: low
severity: normal
stage: needs patch
status: open
title: docs for unittest.expectedFailure do not syntactically show it's a 
decorator
type: feature request

___
Python tracker 

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



[issue6520] urllib.urlopen does not have timeout parameter where as urllib2.urlopen has

2009-07-19 Thread Skip Montanaro

Skip Montanaro  added the comment:

I suspect that was a conscious decision.  Back when it was first written
urllib2 was supposed to eventually replace urllib I think.  Dunno if
that's still true, but if so I could see why this feature wasn't added
to urllib.urlopen.

--
nosy: +skip.montanaro

___
Python tracker 

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



[issue1436346] yday in datetime module

2009-07-19 Thread Jubaraj Borgohain

Jubaraj Borgohain  added the comment:

I have completed the following two new features for the datetime module
(the changes are attached as a patch):
a. Added a method yday()
b. Added date.fromyday(year,yday), which returns a date object.
The other features requested are already available.
The tests for these two new features have also been added to
test_datetimemodule.py.
The patch has been only tested on trunk.(Python 2.7)

--
keywords: +patch
nosy: +jborgohain
Added file: http://bugs.python.org/file14525/issue1436346.diff

___
Python tracker 

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



[issue6516] reset owner/group to root for distutils tarballs

2009-07-19 Thread Tarek Ziadé

Tarek Ziadé  added the comment:

what would be the use case for that ?

--

___
Python tracker 

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



[issue6163] [HP-UX] ld: Unrecognized argument: +s -L

2009-07-19 Thread Tarek Ziadé

Tarek Ziadé  added the comment:

Michael, I am not sure how you patch applies, is "elif" meant to be "if" ?
e.g. a gcc compiler under hp-us case ?

--

___
Python tracker 

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



[issue6523] smtplib exception smtp.connect TypeError encode_plain

2009-07-19 Thread Leonard Kevin McGuire Jr

New submission from Leonard Kevin McGuire Jr :

-- SYSTEM INFORMATION -
module: smtplib
system: linux

python3.0 -V 
  Python 3.0.1+

- TEST CASE PYTHON SOURCE -
import smtplib
smtp = smtplib.SMTP()
smtp.connect('mail.myserver.org')
smtp.login('myusername', 'mypassword')

- TEST CASE EXECUTION RESULTS -
python3.0 testcase.py 
Traceback (most recent call last):
  File "testcase.py", line 4, in 
smtp.login('myusername', 'mypassword')
  File "/home/kevin/Projects/ftpwatch/smtplib.py", line 580, in login
AUTH_PLAIN + " " + encode_plain(user, password))
  File "/home/kevin/Projects/ftpwatch/smtplib.py", line 545, in encode_plain
return encode_base64("\0%s\0%s" % (user, password))
  File "/usr/lib/python3.0/email/base64mime.py", line 96, in body_encode
enc = b2a_base64(s[i:i + max_unencoded]).decode("ascii")
TypeError: b2a_base64() argument 1 must be bytes or buffer, not str

--
components: Library (Lib), Unicode
messages: 90723
nosy: kmcguire
severity: normal
status: open
title: smtplib exception smtp.connect TypeError encode_plain
type: behavior
versions: Python 3.0

___
Python tracker 

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



[issue6524] tarfile module missing decompression support?

2009-07-19 Thread Henrik ravn

New submission from Henrik ravn :

When doing the following with python 2.6.2 on Windows Vista SP1:

>>> import tarfile
>>> tf = tarfile.TarFile("sometarfile.tar.bz2")

Traceback (most recent call last):
  File "", line 1, in 
tf = tarfile.TarFile("sometarfile.tar.bz2")
  File "C:\Python26\lib\tarfile.py", line 1570, in __init__
self.firstmember = self.next()
  File "C:\Python26\lib\tarfile.py", line 2322, in next
raise ReadError(str(e))
ReadError: invalid header

This would, of course, suggest that the file was corrupted, but all 
archiving tools (tar, winrar and 7-zip) handle the file without 
problems. 

Also:

>>> tf = tarfile.TarFile("sometarfile.tar.bz2", "r:bz2")

Traceback (most recent call last):
  File "", line 1, in 
tf = tarfile.TarFile("e:/mono/mono-2.4.2.2.tar.bz2", "r:bz2")
  File "C:\Python26\lib\tarfile.py", line 1510, in __init__
raise ValueError("mode must be 'r', 'a' or 'w'")
ValueError: mode must be 'r', 'a' or 'w'

which suggests that the compression support is not compiled into the 
tarfile module.

--
components: Library (Lib)
messages: 90724
nosy: hravnx
severity: normal
status: open
title: tarfile module missing decompression support?
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