[issue1221] email.Utils.parseaddr("a(WRONG)@b")
New submission from helmut: >>> email.Utils.parseaddr("a(WRONG)@b") ('WRONG WRONG', '[EMAIL PROTECTED]') I believe this is wrong. -- components: Library (Lib) messages: 56199 nosy: helmut severity: normal status: open title: email.Utils.parseaddr("a(WRONG)@b") type: behavior versions: Python 2.4, Python 2.5 __ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue1221> __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18118] curses utf8 output broken
New submission from helmut: Consider the test case below. <<< #!/usr/bin/python # -*- encoding: utf8 -*- import curses def wrapped(screen): screen.addstr(0, 0, "ä") screen.addstr(0, 1, "ö") screen.addstr(0, 2, "ü") screen.getch() if __name__ == "__main__": curses.wrapper(wrapped) >>> Expected output: "äöü" Output on py3.3: as expected Output on py2.7.3: "?ü" The actual bytes (as determined by strace) were "\303\303\303\274". Observe the inclusion of broken utf8 sequences. This issue was initially discovered on Debian sid, but independently confirmed on Arch Linux and two more unknown. -- components: Library (Lib) messages: 190479 nosy: helmut priority: normal severity: normal status: open title: curses utf8 output broken type: behavior versions: Python 2.7 ___ Python tracker <http://bugs.python.org/issue18118> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18118] curses utf8 output broken in Python2
helmut added the comment: All reproducers confirmed that their _cursessomething.so is linked against libncursesw.so.5. -- ___ Python tracker <http://bugs.python.org/issue18118> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18118] curses utf8 output broken in Python2
helmut added the comment: > I suppose that screen.addstr(0, 0, u"äöü".encode("utf-8")) works. It works as in "the output looks as the one expected". Long lines with utf8 characters will make it break again though. screen.addstr(0, 0, "äöü" * 20) # assuming COLUMNS=80 Will give two rows of characters of which the first row is 40 characters long. > If "_cursessomething.so" is already linked against libncursesw.so.5, the fix > is to use waddwstr(), but such change cannot be done in a minor release like > Python 2.7.6. So I'm closing this issue as wont fix => you have to move to > Python 3.3. Sounds sensible. Are you aware of a workaround for this issue? I.e. is there any way to force Python2.7 to use the wide mode for outputting characters? -- ___ Python tracker <http://bugs.python.org/issue18118> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue2947] subprocess (Replacing popen) - add a warning / hint
New submission from Helmut Jarausch <[EMAIL PROTECTED]>: Background: I (as many others, too) have used the following code in the past ARC='MyDumpFile' tar_inp= os.popen('/bin/tar cjf '+ARC+' -T -','w') tar_exit_code= tar_inp.close() if tar_exit_code != None and tar_exit_code % 256 : print "some error messages" When replacing this - as suggested - by TAR= Popen(('/bin/tar','cjf',ARC,'-T','-'),stdin=PIPE) tar_inp= TAR.stdin tar_inp.close() always returns None which was an indication of NO ERROR when used together with popen. So this has proabaly to be replaced by tar_inp.close() tar_exit_code= TAR.wait() if tar_exit_code != 0 : print "some error messages" I suggest a warning / hint to change checking for errors when upgrading to subprocess.Popen -- assignee: georg.brandl components: Documentation messages: 67195 nosy: HWJ, georg.brandl severity: normal status: open title: subprocess (Replacing popen) - add a warning / hint versions: Python 2.6 __ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue2947> __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue3131] 2to3 can't find fixes_dir
Helmut Jarausch <[EMAIL PROTECTED]> added the comment: The suggested fix succeeds but then the next problem occurs Traceback (most recent call last): File "/usr/local/bin/2to3", line 6, in sys.exit(refactor.main(fixers)) File "/usr/local/lib/python3.0/lib2to3/refactor.py", line 81, in main rt = RefactoringTool(fixer_dir, options) File "/usr/local/lib/python3.0/lib2to3/refactor.py", line 160, in __init__ self.pre_order, self.post_order = self.get_fixers() File "/usr/local/lib/python3.0/lib2to3/refactor.py", line 185, in get_fixers mod = __import__(fixer_pkg + ".fix_" + fix_name, {}, {}, ["*"]) ValueError: Empty module name -- nosy: +HWJ ___ Python tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue3131> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue3131] 2to3 can't find fixes_dir
Helmut Jarausch <[EMAIL PROTECTED]> added the comment: This patch seems to work, but when invoked it tries to write to /usr/local/lib/python3.0/lib2to3 ( I get root: Writing failed:[Errno 13] Permission denied: '/usr/local/lib/ python3.0/lib2to3/PatternGrammar3.0.0.beta.1.pickle' ) I hope this will be handled during install in future. Furthermore, as a test, I copied refactor.py to xxx.py and ran 2to3 on xxx.py Here I get RefactoringTool: Can't parse xxx.py: ParseError: bad input: type=22, value='=', context=('', (67, 71)) This error message is a bit terse for someone not knowing the details of 2to3 Thanks for the patch, Helmut. ___ Python tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue3131> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue3187] os.walk - strange bug
New submission from Helmut Jarausch <[EMAIL PROTECTED]>: The script below produces 1664 lines of output before it bails out with Traceback (most recent call last): File "WalkBug.py", line 5, in for Dir, SubDirs, Files in os.walk('/home/jarausch') : File "/usr/local/lib/python3.0/os.py", line 278, in walk for x in walk(path, topdown, onerror, followlinks): File "/usr/local/lib/python3.0/os.py", line 268, in walk if isdir(join(top, name)): File "/usr/local/lib/python3.0/posixpath.py", line 64, in join if b.startswith('/'): TypeError: expected an object with the buffer interface = file WalkBug.py: #!/usr/local/bin/python3.0 import os for Dir, SubDirs, Files in os.walk('/home/jarausch') : print("processing {0:d} files in {1}".format(len(Files),Dir)) -- components: Library (Lib) messages: 68674 nosy: HWJ severity: normal status: open title: os.walk - strange bug type: crash versions: Python 3.0 ___ Python tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue3187> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue3187] os.walk - strange bug
Helmut Jarausch <[EMAIL PROTECTED]> added the comment: >> Could you tell us what this 1665th line should be? >> Maybe the 1665th directory has something special (a filename with >> >> spaces or non-ascii chars...) Yes, the next directory contains a filename with an iso-latin1 but non- ascii character >> Can you try with an older version of python? No problems - runs every night here The patch (applied to SVN GMT 13:30) does NOT help. ___ Python tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue3187> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue3835] tkinter goes into an infinite loop (pydoc.gui)
New submission from Helmut Jarausch <[EMAIL PROTECTED]>: With version 3.0 (SVN 66386) import pydoc pydoc.gui() gives >>> Exception in thread Thread-1: Traceback (most recent call last): File "/usr/local/lib/python3.0/threading.py", line 507, in _bootstrap_inner self.run() File "/usr/local/lib/python3.0/threading.py", line 462, in run self._target(*self._args, **self._kwargs) File "/usr/local/lib/python3.0/pydoc.py", line 1989, in serve DocServer(port, callback).serve_until_quit() File "/usr/local/lib/python3.0/pydoc.py", line 1971, in __init__ self.base.__init__(self, self.address, self.handler) File "/usr/local/lib/python3.0/socketserver.py", line 401, in __init__ self.server_activate() File "/usr/local/lib/python3.0/pydoc.py", line 1982, in server_activate if self.callback: self.callback(self) File "/usr/local/lib/python3.0/pydoc.py", line 2072, in ready text='Python documentation server at\n' + server.url) File "/usr/local/lib/python3.0/tkinter/__init__.py", line 1199, in configure return self._configure('configure', cnf, kw) File "/usr/local/lib/python3.0/tkinter/__init__.py", line 1190, in _configure self.tk.call(_flatten((self._w, cmd)) + self._options(cnf)) _tkinter.TclError: out of stack space (infinite loop?) -- components: Extension Modules messages: 73021 nosy: HWJ severity: normal status: open title: tkinter goes into an infinite loop (pydoc.gui) type: crash versions: Python 3.0 ___ Python tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue3835> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue3835] tkinter goes into an infinite loop (pydoc.gui)
Helmut Jarausch <[EMAIL PROTECTED]> added the comment: I'm using Tcl/Tk 8.5.4 here print(":::") print(_flatten((self._w, cmd)) + self._options(cnf)) produces: ::: ('.3073836300', 'configure', '-yscrollcommand', '3077632332set') ::: ('.3073835564.3073835660', 'configure', '-text', 'Python documentation server at\nhttp://localhost:7464/') >>> Exception in thread Thread-1: Traceback (most recent call last): File "/usr/local/lib/python3.0/threading.py", line 507, in _bootstrap_inner self.run() File "/usr/local/lib/python3.0/threading.py", line 462, in run self._target(*self._args, **self._kwargs) File "/usr/local/lib/python3.0/pydoc.py", line 1989, in serve DocServer(port, callback).serve_until_quit() File "/usr/local/lib/python3.0/pydoc.py", line 1971, in __init__ self.base.__init__(self, self.address, self.handler) File "/usr/local/lib/python3.0/socketserver.py", line 401, in __init__ self.server_activate() File "/usr/local/lib/python3.0/pydoc.py", line 1982, in server_activate if self.callback: self.callback(self) File "/usr/local/lib/python3.0/pydoc.py", line 2072, in ready text='Python documentation server at\n' + server.url) File "/usr/local/lib/python3.0/tkinter/__init__.py", line 1201, in configure return self._configure('configure', cnf, kw) File "/usr/local/lib/python3.0/tkinter/__init__.py", line 1192, in _configure self.tk.call(_flatten((self._w, cmd)) + self._options(cnf)) _tkinter.TclError: out of stack space (infinite loop?) ___ Python tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue3835> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue3835] tkinter goes into an infinite loop (pydoc.gui)
Helmut Jarausch <[EMAIL PROTECTED]> added the comment: Many thanks, that solved the problem. Since the cause of the problem wasn't easy to find out (for me, at least) would be possible to check at import time if Tcl/Tk has been configured with threads enabled? Helmut. ___ Python tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue3835> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue3187] os.listdir can return byte strings
Helmut Jarausch <[EMAIL PROTECTED]> added the comment: Hi, is this assumed to be fixed in 3.0rc1 ? with SVN 66506 (3.0rc1+) for dirname, subdirs, files in os.walk(bytes(Top,'iso-8859-1')) : still gives an error here: for dirname, subdirs, files in os.walk(bytes(Top,'iso-8859-1')) : File "/usr/local/lib/python3.0/os.py", line 268, in walk if isdir(join(top, name)): File "/usr/local/lib/python3.0/posixpath.py", line 64, in join if b.startswith('/'): TypeError: expected an object with the buffer interface ___ Python tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue3187> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue3896] idle should be installed as idle3.0
New submission from Helmut Jarausch <[EMAIL PROTECTED]>: Python-3.0rc1+ still installs idle as 'idle' and will therefore overwrite an installed idle of version 2.5.x It should be installed as 'idle3.0' conforming to 'python3.0' -- components: Installation messages: 73363 nosy: HWJ severity: normal status: open title: idle should be installed as idle3.0 versions: Python 3.0 ___ Python tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue3896> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue15763] email non-ASCII characters in TO or FROM field doesn't work
New submission from Helmut Jarausch: Trying to generate an email with Latin-1 characters in the TO or FROM field either produces an exception or produces strange values in the generated email: Using Python 3.2.3+ (3.2:481f5d9ef577+, Aug 8 2012, 10:00:28) #!/usr/bin/python3 #-*- coding: latin1 -*- import smtplib from email.message import Message import datetime import sys msg= Message() msg.set_charset('latin-1') msg['Subject'] = "*** Email Test ***" # the following gives a UnicodeDecodeError: 'ascii' codec can't decode byte 0xfc .. # in File "/usr/lib64/python3.2/email/header.py", line 281, in append # msg['From'] = FromAddr = "Günter Groß ".encode('iso-8859-1') # The following doesn't crash Python but generates a strange "From" string : # =?utf-8?b?R8O8bnRlciBHcm/DnyA8RW1haWxfVGVzdGVyQG51bWEtc3YuaWdwbS5yd3RoLWFhY2hlbi5kZT4=?= msg['From'] = FromAddr = "Günter Groß " # The same with this one msg['To'] = ToAddr = "Günter Weiße " DATE = datetime.datetime.utcnow().strftime('%m/%d/%Y %I:%M:%S %p') msg['Date'] = datetime.datetime.utcnow().strftime('%m/%d/%Y %I:%M:%S %p') server= smtplib.SMTP("igpm.igpm.rwth-aachen.de") # server= smtplib.SMTP('relay.skynet.be') server.set_debuglevel(9) msg.set_payload("Gedanken über einen Test","iso-8859-1") # server.send_message(msg) server.sendmail(FromAddr,ToAddr,msg.as_string().encode("iso-8859-1")) server.quit() -- components: email messages: 168869 nosy: HWJ, barry, r.david.murray priority: normal severity: normal status: open title: email non-ASCII characters in TO or FROM field doesn't work versions: Python 3.2 ___ Python tracker <http://bugs.python.org/issue15763> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16541] tk_setPalette doesn't accept keyword parameters
New submission from Helmut Jarausch: import tkinter as Tk root= Tk.Tk() root.tk_setPalette(background = 'AntiqueWhite1', foreground = 'blue') but python-3.3:0+ (3.3:27cb1a3d57c8+) gives Traceback (most recent call last): File "Matr_Select.py", line 174, in root.tk_setPalette(background = 'AntiqueWhite1', foreground = 'blue') File "/usr/lib64/python3.3/tkinter/__init__.py", line 390, in tk_setPalette + _flatten(args) + _flatten(kw.items())) TypeError: argument must be sequence Thanks for looking into it, Helmut. -- components: Tkinter messages: 176193 nosy: HJarausch priority: normal severity: normal status: open title: tk_setPalette doesn't accept keyword parameters type: compile error versions: Python 3.3 ___ Python tracker <http://bugs.python.org/issue16541> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16811] email.message.Message flatten dies of list index out of range
New submission from Helmut Jarausch: The following code triggers the bug: #!/usr/bin/python3.3 #-*- coding: latin1 -*- from email.message import Message from email import policy from email.parser import FeedParser Parser= FeedParser(policy=policy.SMTP) Parser.feed('From jarau...@igpm.rwth-aachen.de Tue Apr 24 15:09:24 2012\n') Parser.feed('X-Status:\n') # this triggers the bug Parser.feed('From: Helmut Jarausch \n') Msg= Parser.close() Msg_as_str= Msg.as_string(unixfrom=True) This triggers File "Email_Parse_Bug.py", line 13, in Msg_as_str= Msg.as_string(unixfrom=True) File "/usr/lib64/python3.3/email/message.py", line 151, in as_string g.flatten(self, unixfrom=unixfrom) File "/usr/lib64/python3.3/email/generator.py", line 112, in flatten self._write(msg) File "/usr/lib64/python3.3/email/generator.py", line 171, in _write self._write_headers(msg) File "/usr/lib64/python3.3/email/generator.py", line 198, in _write_headers self.write(self.policy.fold(h, v)) File "/usr/lib64/python3.3/email/policy.py", line 153, in fold return self._fold(name, value, refold_binary=True) File "/usr/lib64/python3.3/email/policy.py", line 176, in _fold (len(lines[0])+len(name)+2 > maxlen or IndexError: list index out of range If I strip the '\n' from the lines feeded to the Parser, the bug does not occur. Thanks for looking into it, Helmut. This is with Python 3.3.0+ 3.3:ccc372b37fbb+ -- components: Library (Lib) messages: 178482 nosy: HJarausch priority: normal severity: normal status: open title: email.message.Message flatten dies of list index out of range type: crash versions: Python 3.3 ___ Python tracker <http://bugs.python.org/issue16811> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue17266] Idle + tcl 8.6.0 Can't convert '_tkinter.Tcl_Obj' object to str implicitly
New submission from Helmut Jarausch: I have tcl/tk 8.6.0 installed here. Both Python versions below are build from source. I'm using LANG=en_US.iso88591 here if that matters. When opening a file in Idle with python-3.3.1 revision: c08bcf5302ec or python-3.4.0a0 (default:3a110a506d35) (HG version) I get Failed to load extension 'CodeContext' Traceback (most recent call last): File "/home/jarausch/GenToo/LOC/TEST/Python/cpython/Lib/idlelib/EditorWindow.py", line 1034, in load_standard_extensions self.load_extension(name) File "/home/jarausch/GenToo/LOC/TEST/Python/cpython/Lib/idlelib/EditorWindow.py", line 1055, in load_extension ins = cls(self) File "/home/jarausch/GenToo/LOC/TEST/Python/cpython/Lib/idlelib/CodeContext.py", line 49, in __init__ self.toggle_code_context_event() File "/home/jarausch/GenToo/LOC/TEST/Python/cpython/Lib/idlelib/CodeContext.py", line 66, in toggle_code_context_event padx += int(str( widget.pack_info()['padx'] )) File "/home/jarausch/GenToo/LOC/TEST/Python/cpython/Lib/tkinter/__init__.py", line 1919, in pack_info self.tk.call('pack', 'info', self._w)) TypeError: Can't convert '_tkinter.Tcl_Obj' object to str implicitly -- components: IDLE messages: 182587 nosy: HJarausch priority: normal severity: normal status: open title: Idle + tcl 8.6.0 Can't convert '_tkinter.Tcl_Obj' object to str implicitly versions: Python 3.3, Python 3.4 ___ Python tracker <http://bugs.python.org/issue17266> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue17413] format_exception() breaks on exception tuples from trace function
Helmut Jarausch added the comment: The problem is caused by the new format_exception in Python's traceback.py file. It reads def format_exception(etype, value, tb, limit=None, chain=True): list = [] if chain: values = _iter_chain(value, tb) else: values = [(value, tb)] for value, tb in values: if isinstance(value, str): and then def _iter_chain(exc, custom_tb=None, seen=None): if seen is None: seen = set() seen.add(exc) its = [] context = exc.__context__ As you can see, the new keyword parameter chain is True by default. Thus, iter_chain is called by default. And there you have context= exc.__context__. Now, if value is an object of type str Python tries to access the __context__ field of an object of type str. And this raises an attribute error. In an application (pudb) I've used the fixed exc_info= sys.exc_info() format_exception(*exc_info,chain=not isinstance(exc_info[1],str)) So, why is the keyword parameter 'chain' True by default. This causes the problem. -- nosy: +HJarausch ___ Python tracker <http://bugs.python.org/issue17413> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com