[issue6829] Frendly error message when inheriting from function

2009-09-03 Thread anatoly techtonik
New submission from anatoly techtonik : It is an error to try to inherit from function and the error message in this case is: {{{ Traceback (most recent call last): File "", line 1, in File "m:\p\pb.py", line 4, in class PostgreSQLConnection(DatabaseConnection): TypeError: Error when c

[issue6828] wrongly highlighted blocks in the Tutorial

2009-09-03 Thread Georg Brandl
Georg Brandl added the comment: Thanks, fixed in r74632. -- resolution: -> fixed status: open -> closed ___ Python tracker ___ ___ Py

[issue6830] Some uniformness in defaultdict

2009-09-03 Thread Toshihiro Kamiya
New submission from Toshihiro Kamiya : 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 defaultdict of defaultdict of

[issue6831] 2to3 assignment division conversion

2009-09-03 Thread Jonas Byström
New submission from Jonas Byström : 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: normal status: open tit

[issue1766304] improve xrange.__contains__

2009-09-03 Thread Mark Dickinson
Mark Dickinson added the comment: The py3k patch no longer works: it makes use of PyObject_Cmp, which no longer exists. -- ___ Python tracker ___

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

2009-09-03 Thread Jerzy
New submission from Jerzy : 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 recent call last):

[issue1766304] improve xrange.__contains__

2009-09-03 Thread Mark Dickinson
Mark Dickinson 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 overflow, leading to

[issue1766304] improve xrange.__contains__

2009-09-03 Thread Mark Dickinson
Mark Dickinson 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'. (Though tha

[issue6833] incorrect: failed local variable referenced before assignment

2009-09-03 Thread Paul van der Linden
New submission from Paul van der Linden : 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 failed " This is t

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

2009-09-03 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc 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 default value even whe

[issue6833] incorrect: failed local variable referenced before assignment

2009-09-03 Thread Mark Dickinson
Mark Dickinson 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 are treated as re

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

2009-09-03 Thread Benjamin Peterson
Benjamin Peterson 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 ___

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

2009-09-03 Thread Jerzy
Jerzy 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 Peterson wrote: > Be

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

2009-09-03 Thread Georg Brandl
Georg Brandl 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 stdout is a terminal.

[issue6823] time.strftime does unnecessary range check

2009-09-03 Thread Georg Brandl
Georg Brandl added the comment: Assigning to Brett who added this check in r35368. -- assignee: -> brett.cannon nosy: +brett.cannon, georg.brandl ___ Python tracker ___

[issue6830] Some uniformness in defaultdict

2009-09-03 Thread Georg Brandl
Georg Brandl 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. Therefore, the

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

2009-09-03 Thread Jerzy
Jerzy 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 change it in a reasonable

[issue6757] Marshal's documentation incomplete (Bools)

2009-09-03 Thread Georg Brandl
Georg Brandl added the comment: Thanks, fixed in r74633. -- resolution: -> fixed status: open -> closed ___ Python tracker ___ ___ Py

[issue6820] Redefinition of HAVE_STRFTIME can cause compiler errors.

2009-09-03 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc 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: +amaury.forgeotdarc __

[issue6802] build fails on Snow Leopard

2009-09-03 Thread fideli
Changes by fideli : -- nosy: +fideli ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mail

[issue6802] build fails on Snow Leopard

2009-09-03 Thread Ronald Oussoren
Ronald Oussoren 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 : 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 functionality from the command-line

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

2009-09-03 Thread Goetz Pfeiffer
New submission from Goetz Pfeiffer : 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", there in method "_from

[issue6802] build fails on Snow Leopard

2009-09-03 Thread Brett Cannon
Brett Cannon added the comment: On Thu, Sep 3, 2009 at 07:28, Ronald Oussoren wrote: > > Ronald Oussoren 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 bot

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

2009-09-03 Thread Martin v . Löwis
Martin v. Löwis 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 encoding is primarily a c

[issue6834] use different mechanism for pythonw on osx

2009-09-03 Thread Martin v . Löwis
Martin v. Löwis 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. -- nosy: +loewis

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

2009-09-03 Thread Jerzy
Jerzy 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 for all inputs and

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

2009-09-03 Thread Martin v . Löwis
Martin v. Löwis 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 tracker

[issue6582] test_telnetlib doesn't test Telnet.write

2009-09-03 Thread Jack Diederich
Jack Diederich 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

[issue6748] test test_telnetlib failed

2009-09-03 Thread Jack Diederich
Jack Diederich 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 added the comment: On Thu, 03 Sep 2009 20:38:49 + Jack Diederich wrote: > > Jack Diederich added the comment: > > applied in r74638 > and I've added you to Misc/ACKS > Thanks again for the patch! No problem, Anything I can do to improve telnetlib further?

[issue6806] test_platform fails under Snow Leopard

2009-09-03 Thread Brett Cannon
Brett Cannon added the comment: Got a fix, about to start applying it. -- ___ Python tracker ___ ___ Python-bugs-list mailing list Uns

[issue6748] test test_telnetlib failed

2009-09-03 Thread Thomas Kowaliczek
Thomas Kowaliczek added the comment: Fedora 11 64 Bit -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http:/

[issue6806] test_platform fails under Snow Leopard

2009-09-03 Thread Brett Cannon
Brett Cannon added the comment: 2.7: 74640 3.2: 74641 3.1: 74642 -- resolution: -> fixed status: open -> closed ___ Python tracker ___ __

[issue6823] time.strftime does unnecessary range check

2009-09-03 Thread Brett Cannon
Brett Cannon 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 stage: -> test ne

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

2009-09-03 Thread Tim Hatch
Tim Hatch 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 ___ ___

[issue6824] help for a module should list supported platforms

2009-09-03 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc 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 platforms are more intere

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

[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 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 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 added the comment: good point! I will give it a try Jerzy Martin v. Löwis wrote: > Martin v. Löwis 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

[issue6824] help for a module should list supported platforms

2009-09-03 Thread Ritesh Raj Sarraf
Ritesh Raj Sarraf 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, for those that

[issue6834] use different mechanism for pythonw on osx

2009-09-03 Thread Ronald Oussoren
Ronald Oussoren added the comment: Let me first explain in more detail why pythonw is needed in the first place: MacOSX only allows access to a large number of GUI-related APIs from application bundles (the symbols are of course always available, but the APIs fail when you are calling them fr

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

2009-09-03 Thread Georg Brandl
Georg Brandl added the comment: Yes, I think that's fine. -- nosy: +georg.brandl resolution: -> duplicate status: open -> closed superseder: -> zsh-style subpattern matching for fnmatch/glob ___ Python tracker __

[issue2666] webbrowser.py doesn't properly handle BROWSER env var

2009-09-03 Thread Georg Brandl
Georg Brandl added the comment: Thanks, applied in r74643. -- nosy: +georg.brandl resolution: -> accepted status: open -> closed ___ Python tracker ___ _

[issue5639] Support TLS SNI extension in ssl module

2009-09-03 Thread Daniel Black
Daniel Black added the comment: Hey Phil, > (Sorry for dropping this, lost available time) know the feeling :-( > use of SNI needs to be something that can be disabled maybe. See small rational below: > and people need to be able to connect to host A while supplying host B This seems to be a f