[issue6829] Frendly error message when inheriting from function

2009-09-03 Thread anatoly techtonik
New submission from anatoly techtonik techto...@gmail.com: It is an error to try to inherit from function and the error message in this case is: {{{ Traceback (most recent call last): File stdin, line 1, in module File m:\p\pb.py, line 4, in module class

[issue6828] wrongly highlighted blocks in the Tutorial

2009-09-03 Thread Georg Brandl
Georg Brandl ge...@python.org added the comment: Thanks, fixed in r74632. -- resolution: - fixed status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6828 ___

[issue6830] Some uniformness in defaultdict

2009-09-03 Thread Toshihiro Kamiya
New submission from Toshihiro Kamiya t-kam...@aist.go.jp: I found the syntax of collections.defaultdict is confusing, at least to me. When I need a defaultdict of int, that is, a defaultdict which contains int objects, I can write simply: a = defaultdict(int) However, when I want a

[issue6831] 2to3 assignment division conversion

2009-09-03 Thread Jonas Byström
New submission from Jonas Byström highfest...@gmail.com: Code from 2.x containing __idiv__ does not translate into def __floordiv__(self, x): self.__truediv__(x) def __truediv__(self, x): ... -- components: 2to3 (2.x to 3.0 conversion tool) messages: 92194 nosy: highfestiva severity:

[issue1766304] improve xrange.__contains__

2009-09-03 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com added the comment: The py3k patch no longer works: it makes use of PyObject_Cmp, which no longer exists. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1766304

[issue6832] Outputting unicode crushes when printing to file on Linux

2009-09-03 Thread Jerzy
New submission from Jerzy jer...@genesilico.pl: Hi When I am outputting unicode strings to terminal my script works OK, but when I redirect it to file I get a crash: $ python mailing/message_sender.py -l Bia Białystok $ python mailing/message_sender.py -l Bia ~/tmp/aaa.txt Traceback (most

[issue1766304] improve xrange.__contains__

2009-09-03 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com added the comment: The trunk patch is also unacceptable in its current form: 1. there are no docs or tests 2. keyval, start, step and end should have type long, not type int (as Antoine already mentioned) 3. the expression ((keyval - start) % step) can

[issue1766304] improve xrange.__contains__

2009-09-03 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com added the comment: [Joseph Thomson] Also, as I said in my closed duplicate issue, 'if value in range(lower, upper)' to me looks far more Pythonic than 'if value = lower and value upper'. Note that the Pythonic spelling would be: 'if lower = value upper'.

[issue6833] incorrect: failed local variable referenced before assignment

2009-09-03 Thread Paul van der Linden
New submission from Paul van der Linden p...@soulbase.nl: The attached python file will give the following output, which is incorrect behavior as far as I know: this will fail failed local variable 'in_std' referenced before assignment this won't fail Not failed this won't fail either Not

[issue6827] deepcopy erroneously doesn't call __setstate__ if __getstate__ returns empty dict

2009-09-03 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc amaur...@gmail.com added the comment: This is precisely documented here: http://docs.python.org/library/pickle.html#object.__setstate__ Note: For new-style classes, if __getstate__() returns a false value, the __setstate__() method will not be called. If you want some

[issue6833] incorrect: failed local variable referenced before assignment

2009-09-03 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com added the comment: This is not a bug. The behaviour you're seeing is described here: http://docs.python.org/reference/executionmodel.html#naming-and-binding If a name binding operation occurs anywhere within a code block, all uses of the name within the block

[issue6832] Outputting unicode crushes when printing to file on Linux

2009-09-03 Thread Benjamin Peterson
Benjamin Peterson benja...@python.org added the comment: You have to use an encoding that's not ascii then. -- nosy: +benjamin.peterson resolution: - works for me status: open - closed ___ Python tracker rep...@bugs.python.org

[issue6832] Outputting unicode crushes when printing to file on Linux

2009-09-03 Thread Jerzy
Jerzy jer...@genesilico.pl added the comment: I know how to make it work. The question is why outputting to file makes it crush when outputting to terminal does not. I have never seen $program file behaving in a different way than $program in any other language Jerzy Orlowski Benjamin

[issue6832] Outputting unicode crushes when printing to file on Linux

2009-09-03 Thread Georg Brandl
Georg Brandl ge...@python.org added the comment: When output goes to a terminal, Python can determine its encoding. For a file, it cannot, therefore it refuses to guess. Also, many programs behave differently when used with redirection; namely, all those that use `isatty()` to determine if

[issue6823] time.strftime does unnecessary range check

2009-09-03 Thread Georg Brandl
Georg Brandl ge...@python.org added the comment: Assigning to Brett who added this check in r35368. -- assignee: - brett.cannon nosy: +brett.cannon, georg.brandl ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6823

[issue6830] Some uniformness in defaultdict

2009-09-03 Thread Georg Brandl
Georg Brandl ge...@python.org added the comment: This won't change -- the argument of defaultdict is simply a callable that is called with no arguments and returns the default value. It works with `int` because `int()` can be called without arguments and yields 0; however, `defaultdict` cannot.

[issue6832] Outputting unicode crushes when printing to file on Linux

2009-09-03 Thread Jerzy
Jerzy jer...@genesilico.pl added the comment: Well, I would suggest using the terminal encoding as default one when redirecting. In my opinion sys.stdin and sys.stdout should always have the terminal encoding Alternatively you could make the function sys.setdefaultencoding() visible to

[issue6757] Marshal's documentation incomplete (Bools)

2009-09-03 Thread Georg Brandl
Georg Brandl ge...@python.org added the comment: Thanks, fixed in r74633. -- resolution: - fixed status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6757 ___

[issue6820] Redefinition of HAVE_STRFTIME can cause compiler errors.

2009-09-03 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc amaur...@gmail.com added the comment: Those HAVE_XXX symbols should be defined like autoconf does: #define HAVE_STRFTIME 1 This is what happens on Unix platforms, and AFAIK this plays well with other libraries which define the same symbols. -- nosy:

[issue6802] build fails on Snow Leopard

2009-09-03 Thread fideli
Changes by fideli faisal.moled...@gmail.com: -- nosy: +fideli ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6802 ___ ___ Python-bugs-list mailing

[issue6802] build fails on Snow Leopard

2009-09-03 Thread Ronald Oussoren
Ronald Oussoren ronaldousso...@mac.com added the comment: My current plan is to fix this issue, and the issue of 64-bit universal builds on SL in the weekend. BTW. I'm not planning to fix this for 2.5 and 2.4, AFAIK both are no maintained beyond critical security patches. --

[issue6834] use different mechanism for pythonw on osx

2009-09-03 Thread Ronald Oussoren
New submission from Ronald Oussoren ronaldousso...@mac.com: Note: this is mostly a reminder for myself to clean up the pythonw stub executable The current implementation of pythonw on OSX uses exec to start an executable inside the framework, this is needed to be able to use GUI

[issue6835] doctest problem with decorated function when decorator is defined in separate file

2009-09-03 Thread Goetz Pfeiffer
New submission from Goetz Pfeiffer goet...@googlemail.com: As described in bug 1108, doctest skips tests on functions that have been decorated with a decorator that is defined in a separate file. As described in bug 1108, the problem lies in file doctest.py, there in class DocTestFinder,

[issue6802] build fails on Snow Leopard

2009-09-03 Thread Brett Cannon
Brett Cannon br...@python.org added the comment: On Thu, Sep 3, 2009 at 07:28, Ronald Oussorenrep...@bugs.python.org wrote: Ronald Oussoren ronaldousso...@mac.com added the comment: My current plan is to fix this issue, and the issue of 64-bit universal builds on SL in the weekend. BTW.

[issue6832] Outputting unicode crushes when printing to file on Linux

2009-09-03 Thread Martin v . Löwis
Martin v. Löwis mar...@v.loewis.de added the comment: Using the terminal encoding for sys.stdout does not work in the general case, as a (background) process may not *have* a controlling terminal (such as a CGI script, a cron job, or a Windows service). That Python recognizes the terminal

[issue6834] use different mechanism for pythonw on osx

2009-09-03 Thread Martin v . Löwis
Martin v. Löwis mar...@v.loewis.de added the comment: Can you kindly report how architecture selection works? Is there a separate binary which execs? Some other magic? Asking primarily out of curiosity, but if it's a launcher, then (sym)linking it into a virtualenv might be sufficient.

[issue6832] Outputting unicode crushes when printing to file on Linux

2009-09-03 Thread Jerzy
Jerzy jer...@genesilico.pl added the comment: OK, I give up. The problem is that one might test a program on terminal and think that everything is running OK and then spend a reasonable amount of time trying to find the problem later Another approach: couldn't utf8 be set as default encoding

[issue6832] Outputting unicode crushes when printing to file on Linux

2009-09-03 Thread Martin v . Löwis
Martin v. Löwis mar...@v.loewis.de added the comment: If you want to switch to a different language, consider switching to Python 3. There, all strings are Unicode strings, and files opened in text mode always use the locale encoding. -- ___ Python

[issue6582] test_telnetlib doesn't test Telnet.write

2009-09-03 Thread Jack Diederich
Jack Diederich jackd...@gmail.com added the comment: applied in r74638 and I've added you to Misc/ACKS Thanks again for the patch! -- resolution: - accepted status: open - closed ___ Python tracker rep...@bugs.python.org

[issue6748] test test_telnetlib failed

2009-09-03 Thread Jack Diederich
Jack Diederich jackd...@gmail.com added the comment: I think this is fixed by r74638 but it never triggered on my box (Ubuntu 9.x) so I can't be sure. What distro are you using? -- assignee: - jackdied nosy: +jackdied ___ Python tracker

[issue6582] test_telnetlib doesn't test Telnet.write

2009-09-03 Thread Rodrigo Steinmuller Wanderley
Rodrigo Steinmuller Wanderley rwander...@rsw.digi.com.br added the comment: On Thu, 03 Sep 2009 20:38:49 + Jack Diederich rep...@bugs.python.org wrote: Jack Diederich jackd...@gmail.com added the comment: applied in r74638 and I've added you to Misc/ACKS Thanks again for the patch!

[issue6806] test_platform fails under Snow Leopard

2009-09-03 Thread Brett Cannon
Brett Cannon br...@python.org added the comment: Got a fix, about to start applying it. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6806 ___

[issue6748] test test_telnetlib failed

2009-09-03 Thread Thomas Kowaliczek
Thomas Kowaliczek linuxdon...@linuxdonald.de added the comment: Fedora 11 64 Bit -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6748 ___ ___

[issue6806] test_platform fails under Snow Leopard

2009-09-03 Thread Brett Cannon
Brett Cannon br...@python.org added the comment: 2.7: 74640 3.2: 74641 3.1: 74642 -- resolution: - fixed status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6806 ___

[issue6823] time.strftime does unnecessary range check

2009-09-03 Thread Brett Cannon
Brett Cannon br...@python.org added the comment: Ugh, damn platforms and having to be different. =) Normalization is the best solution as Python's docs says the expected value for the tm_dst field is -1, 0, or 1 (which is why I added the check). -- keywords: +easy priority: - low

[issue2649] poss. patch for fnmatch.py to add {.htm, html} style globbing

2009-09-03 Thread Tim Hatch
Tim Hatch t...@timhatch.com added the comment: More discussion has gone on in issue #4573 on this topic. Can this bug be marked as a duplicate? -- nosy: +thatch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue2649

[issue6824] help for a module should list supported platforms

2009-09-03 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc amaur...@gmail.com added the comment: I'm not sure to understand. The web page says the module works on all supported platforms. Many python features works equally well on all platforms, and I don't feel necessary to repeat this everywhere. The differences between

[issue5329] os.popen2 and os.popen3 in python 2.6 incompatible with os.popen* in python 2.5

2009-09-03 Thread Philip Jenvey
Philip Jenvey pjen...@users.sourceforge.net added the comment: The subprocess docs (in Doc/library/subprocess.rst and the module itself) need to also reflect this change -- nosy: +pjenvey ___ Python tracker rep...@bugs.python.org

[issue5329] os.popen2 and os.popen3 in python 2.6 incompatible with os.popen* in python 2.5

2009-09-03 Thread Jean-Paul Calderone
Jean-Paul Calderone exar...@divmod.com added the comment: Hey Philip, I'm not sure I follow. The patch only changes the os module, not the subprocess module. What subprocess documentation do you think needs to be updated? -- ___ Python tracker

[issue5329] os.popen2 and os.popen3 in python 2.6 incompatible with os.popen* in python 2.5

2009-09-03 Thread Philip Jenvey
Philip Jenvey pjen...@users.sourceforge.net added the comment: Sorry, I meant the docs describing how to convert os.popen* calls to subprocess calls. They assume the shell arg is always True regardless of the cmd arg type. Those docs are probably the original source of this bug --

[issue6832] Outputting unicode crushes when printing to file on Linux

2009-09-03 Thread Jerzy
Jerzy jer...@genesilico.pl added the comment: good point! I will give it a try Jerzy Martin v. Löwis wrote: Martin v. Löwis mar...@v.loewis.de added the comment: If you want to switch to a different language, consider switching to Python 3. There, all strings are Unicode strings, and

[issue6824] help for a module should list supported platforms

2009-09-03 Thread Ritesh Raj Sarraf
Ritesh Raj Sarraf r...@researchut.com added the comment: Take help os or help os.fork for example. WIth the help output that they provide, how am I supposed to know that os.fork is only supported on Unix. We can also go with the assumption that the modules shipped are cross-platform. But then,