[issue5092] weird memory usage in multiprocessing module

2009-01-30 Thread Jerzy
Jerzy added the comment: OK, I see and if don't want l to exist in f() I have to: def f(): pass def a(): l=[] f() a() Jurek Martin v. Löwis wrote: > Martin v. Löwis added the comment: > >> I still do not understand what is going on when python executed thic >> code. I have

[issue5092] weird memory usage in multiprocessing module

2009-01-30 Thread Jerzy
Jerzy added the comment: And anyway, for me it's not OK if something in a code of a function like 'del' affect how variables are affected in whole function. It is really illogical. There code is in lines and line are one below another. The logical way is that a line of code affects the progra

[issue5108] Invalid UTF-8 ("%s") length in PyUnicode_FromFormatV()

2009-01-30 Thread STINNER Victor
New submission from STINNER Victor : PyUnicode_FromFormatV() doesn't count correctly the unicode length of an UTF-8 string. Commit r57837 "Change %s argument for PyUnicode_FromFormat to be UTF-8. Fixes #1070." introduced the bug. To compute the length, it uses a a complex code to compute the l

[issue5108] Invalid UTF-8 ("%s") length in PyUnicode_FromFormatV()

2009-01-30 Thread STINNER Victor
Changes by STINNER Victor : -- keywords: +patch Added file: http://bugs.python.org/file12892/unicode_format.patch ___ Python tracker ___ __

[issue5109] array.array constructor very slow when passed an array object.

2009-01-30 Thread Malcolm Purvis
New submission from Malcolm Purvis : Copying an array.array object via the array constructor is some 100x slower than using slicing or even converting the array to a string and then passing that string to the array constructor. Running the attached program on a 2.2GHz MacBook Pro (OSX 10.5.5, 4G

[issue4908] adding a get_metadata in distutils

2009-01-30 Thread Floris Bruynooghe
Changes by Floris Bruynooghe : -- nosy: +flub ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python

[issue3610] Fix gdbinit for Python 3.0

2009-01-30 Thread Skip Montanaro
Skip Montanaro added the comment: The gdbinit file for Python 3 is still broken. I've not been able to figure out how to get a string encoded as utf-8 from a Unicode object without needing a process around. If you require a process then gdbinit becomes much less useful since it won't work with

[issue3783] dbm.sqlite proof of concept

2009-01-30 Thread Skip Montanaro
Skip Montanaro added the comment: Unassigning myself. I don't have time for this. I've taken my sandbox version about as far as I can, and the subject of this ticket has gone a bit far afield from just adding a sqlite module to the dbm pkg. -- assignee: skip.montanaro -> ___

[issue5092] weird memory usage in multiprocessing module

2009-01-30 Thread David W. Lambert
David W. Lambert added the comment: The alternative is unreasonable. I doubt you'd be happy with this: a = 'Something' def variable_both_global_and_local()->Exception('No good!'): del a# delete a from global name space a = 'anotherthing' # define a in local name space _

[issue5107] built-in open(..., encoding=vague_default)

2009-01-30 Thread Antoine Pitrou
Antoine Pitrou added the comment: It is more complicated than that. The algorithm is currently as follows (copied from TextIOWrapper.__init__): if encoding is None: try: encoding = os.device_encoding(buffer.fileno()) except (AttributeError, Unsupp

[issue5110] Printing Unicode chars from the interpreter in a non-UTF8 terminal (Py3)

2009-01-30 Thread Ezio Melotti
New submission from Ezio Melotti : In Py2.x >>> u'\2620' outputs u'\2620' whereas >>> print u'\2620' raises an error. Instead, in Py3.x, both >>> '\u2620' and >>> print('\u2620') raise an error if the terminal doesn't use an encoding able to display the character (e.g. the windows terminal used

[issue5109] array.array constructor very slow when passed an array object.

2009-01-30 Thread David W. Lambert
David W. Lambert added the comment: memcpy won't work if the data type changes. (possibly signed <-> unsigned same-byte-count works). -- nosy: +LambertDW ___ Python tracker ___

[issue5110] Printing Unicode chars from the interpreter in a non-UTF8 terminal (Py3)

2009-01-30 Thread STINNER Victor
STINNER Victor added the comment: To be clear, this issue only affects the interpreter. > 2) use ascii(), but it adds extra "" around the output It doesn't ass extra "" if you replace repr() by ascii() in the interpreter code (sys.displayhook)? > The best solution is probably to change the d

[issue5110] Printing Unicode chars from the interpreter in a non-UTF8 terminal (Py3)

2009-01-30 Thread STINNER Victor
STINNER Victor added the comment: You change change the display hook with a site.py script (which have to be in sys.path) : - import sys def hook(message): print(ascii(message)) sys.displayhook = hook - Example (run python in an empty environment to get ASCII charset): --

[issue5110] Printing Unicode chars from the interpreter in a non-UTF8 terminal (Py3)

2009-01-30 Thread Ezio Melotti
Ezio Melotti added the comment: This seems to solve the problem, but apparently the interactive "_" doesn't work anymore. ___ Python tracker ___ __

[issue5110] Printing Unicode chars from the interpreter in a non-UTF8 terminal (Py3)

2009-01-30 Thread STINNER Victor
STINNER Victor added the comment: Oh yeah, original sys.displayhook uses a special hack for the _ global variable: - import sys import builtins def hook(message): if message is None: return builtins._ = message print(ascii(message)) sys.displayhook = hook -

[issue5110] Printing Unicode chars from the interpreter in a non-UTF8 terminal (Py3)

2009-01-30 Thread STINNER Victor
STINNER Victor added the comment: Here is a patch to use ascii() directly in sys_displayhook() (with an unit test!). -- keywords: +patch Added file: http://bugs.python.org/file12894/display_hook_ascii.patch ___ Python tracker

[issue3783] dbm.sqlite proof of concept

2009-01-30 Thread Raymond Hettinger
Changes by Raymond Hettinger : -- assignee: -> rhettinger ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http:

[issue5111] httplib: wrong Host header when connecting to IPv6 loopback

2009-01-30 Thread Guillaume Desmottes
New submission from Guillaume Desmottes : To reproduce: - Launch a HTTP server listening on an Inet6 socket on, say, port - Try to connect using the IPv6 loopback: http = httplib.HTTPConnection('[::1]:') http.request('GET', '/foo') r = http.getresponse() print r.status - You get 400 (ba

[issue4753] Faster opcode dispatch on gcc

2009-01-30 Thread Kevin Watters
Kevin Watters added the comment: Does anyone know the equivalent ICC command line option for GCC's -fno- gcse? (Or if it has one?) I can't find a related option in the docs. It looks like ICC hits the same combining goto problem, as was mentioned: without changing any options, I applied pitrou

[issue5111] httplib: wrong Host header when connecting to IPv6 litteral URL

2009-01-30 Thread Guillaume Desmottes
Guillaume Desmottes added the comment: Actually, this bug is present when you try to connect to any URL containing an IP6 and a port. So, we have the same problem when using, for example: http = httplib.HTTPConnection('[2a01:8790:16d:0:218:de87:164:8745]:') but http = httplib.HTTPConnectio

[issue1717] Get rid of more references to __cmp__

2009-01-30 Thread Mark Dickinson
Mark Dickinson added the comment: Here's stage 2: remove uses of tp_compare from Objects and Modules, and replace uses of PyObject_Compare with PyObject_RichCompareBool. PyObject_Compare, cmp and friends still haven't been removed at this stage. In detail: - for cell objects, method wrapper

[issue3783] dbm.sqlite proof of concept

2009-01-30 Thread Raymond Hettinger
Changes by Raymond Hettinger : Added file: http://bugs.python.org/file12896/dbsqlite.py ___ Python tracker ___ ___ Python-bugs-list mailing lis

[issue5112] Incorrect documentation for PyErr_BadInternalCall

2009-01-30 Thread Michael Welsh Duggan
New submission from Michael Welsh Duggan : Documentation says that this call is shorthand for PyErr_SetString(PyExc_TypeError, message), but is instead shorthand for PyErr_SetString(PyExc_SystemError, message). -- assignee: georg.brandl components: Documentation messages: 80831 nosy: geo

[issue5110] Printing Unicode chars from the interpreter in a non-UTF8 terminal (Py3)

2009-01-30 Thread Giampaolo Rodola'
Changes by Giampaolo Rodola' : -- nosy: +giampaolo.rodola ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http:/

[issue4753] Faster opcode dispatch on gcc

2009-01-30 Thread Mark Dickinson
Mark Dickinson added the comment: The x86 gentoo buildbot is failing to compile, with error: /Python/makeopcodetargets.py ./Python/opcode_targets.h File "./Python/makeopcodetargets.py", line 28 f.write(",\n".join("\t&&%s" % s for s in targets)) ^ Synt

[issue4753] Faster opcode dispatch on gcc

2009-01-30 Thread Mark Dickinson
Mark Dickinson added the comment: One other thought: it seems that as a result of this change, the py3k build process now depends on having some version of Python already installed; before this, it didn't. Is this true, or am I misinterpreting something? Might it be worth adding the file

[issue4753] Faster opcode dispatch on gcc

2009-01-30 Thread Mark Dickinson
Mark Dickinson added the comment: Sorry: ignore that last. Python/opcode_targets.h is already part of the distribution. I don't know what I was doing wrong. ___ Python tracker ___ ___

[issue5113] 2.5.4.3 / test_posix failing on HPUX systems

2009-01-30 Thread Andreas Kupries
New submission from Andreas Kupries : The 'test_posix' of Python's 2.5.4.3 testsuite fails on HPUX. This has happened on parisc and ia64 systems. On the parisc system failure occurs for both parisc1.1 and parisc2.0w builds. The HPUX versions are 11.00 (parisc) and 11.22 (ia64). The attached file

[issue5114] 2.5.4.3 / test_threading hangs

2009-01-30 Thread Andreas Kupries
New submission from Andreas Kupries : On two machines I have seen test_threading hang in ... HPUX 11.22 ia64, Solaris 5.8 sparc The attached file contains the output of running ./apy/bin/python2.5 ./apy/lib/python2.5/test/regrtest.py -v test_threading on the problematic machines. It is necess

[issue4375] inspect.getsource doesn't work with PYTHONPATH and source compiled from a different dir

2009-01-30 Thread Erick Tryzelaar
Erick Tryzelaar added the comment: I just checked, and the latest svn version of python has fixed this. Could someone close this bug for me? ___ Python tracker ___ __

[issue4673] Distutils should provide an uninstall command

2009-01-30 Thread Giampaolo Rodola'
Changes by Giampaolo Rodola' : -- nosy: +giampaolo.rodola ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http:/

[issue1205239] Let shift operators take any integer value

2009-01-30 Thread Mark Dickinson
Changes by Mark Dickinson : -- nosy: +marketdickinson ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://

[issue5107] built-in open(..., encoding=vague_default)

2009-01-30 Thread Giampaolo Rodola'
Changes by Giampaolo Rodola' : -- nosy: +giampaolo.rodola ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http:/

[issue5103] ssl.SSLSocket timeout not working correctly when remote end is hanging

2009-01-30 Thread Giampaolo Rodola'
Changes by Giampaolo Rodola' : -- nosy: +giampaolo.rodola ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http:/

[issue4753] Faster opcode dispatch on gcc

2009-01-30 Thread Antoine Pitrou
Antoine Pitrou added the comment: Mark: """Are there any objections to me adding a couple of square brackets to this line to turn the argument of join into a list comprehension?""" No problems for me. You might also add to the top comments of the file that it is 2.3-compatible. __

[issue4124] Patch for adding "default" to itemgetter and attrgetter

2009-01-30 Thread Raymond Hettinger
Raymond Hettinger added the comment: Will take a look at it next week. -- assignee: -> rhettinger nosy: +rhettinger type: -> feature request ___ Python tracker ___

[issue4124] Patch for adding "default" to itemgetter and attrgetter

2009-01-30 Thread Raymond Hettinger
Raymond Hettinger added the comment: Am curious about your use cases. ISTM that in every case I've every used either function, I've always known that the attribute or item is going to be there. For instance, the original motivating use cases were to support the key= argument to min/max/sorted/

[issue5092] weird memory usage in multiprocessing module

2009-01-30 Thread Jerzy
Jerzy added the comment: I am not an expert. But for me it is much better. If you cannot delete the global variable in a function (del makes the variable local anyway). So trying to delete a global variable should raise an exception "Cannot delete a global variable" or something like that. In

[issue5097] asyncore.dispatcher_with_send undocumented

2009-01-30 Thread Josiah Carlson
Josiah Carlson added the comment: Feel like writing some documentation? ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue1717] Get rid of more references to __cmp__

2009-01-30 Thread Antoine Pitrou
Antoine Pitrou added the comment: I haven't stared very closely but it looks ok. ("spanish armada" might be replaced with "spanish inquisition", though) ___ Python tracker ___ ___

[issue4704] Update pybench for python 3.0

2009-01-30 Thread Antoine Pitrou
Antoine Pitrou added the comment: Since cmp is slated for removal, this should also be done for 3.0.1. -- nosy: +pitrou priority: -> release blocker ___ Python tracker ___ _

[issue5110] Printing Unicode chars from the interpreter in a non-UTF8 terminal (Py3)

2009-01-30 Thread Martin v. Löwis
Martin v. Löwis added the comment: Victor, I'm not sure whether you are proposing that display_hook_ascii.patch is included into Python. IIUC, this patch breaks PEP3138, so it clearly must be rejected. Overall, I fail to see the bug in this report. Python 3.0 works as designed as shown here. -

[issue5092] weird memory usage in multiprocessing module

2009-01-30 Thread Martin v. Löwis
Martin v. Löwis added the comment: > Another way of resolving the problem would be making it impossible to > make a local variable when there is anothe one with the same name. Please trust that there really is no problem. If you don't understand how Python works, ask on a mailing list. If you

[issue5105] sqlite3.Row class, handling duplicate column names resulting from a SQL join

2009-01-30 Thread Gabriel Genellina
Gabriel Genellina added the comment: I think this is a sqlite issue, not a Python one. cursor.description should return unique column names. -- nosy: +gagenellina ___ Python tracker

[issue5103] ssl.SSLSocket timeout not working correctly when remote end is hanging

2009-01-30 Thread Benjamin Peterson
Changes by Benjamin Peterson : -- assignee: -> janssen nosy: +janssen ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubsc

[issue5092] weird memory usage in multiprocessing module

2009-01-30 Thread David W. Lambert
David W. Lambert added the comment: #Ah! Not a problem. You need globals() and locals() dictionaries. # as a python3 script, this message produces next couple lines output. #method one #yup, global a is gone #method two #{'gv': 'local here', 'name': 'gv'} #yup, global gv is gone print('metho

[issue5105] sqlite3.Row class, handling duplicate column names resulting from a SQL join

2009-01-30 Thread Gabriel Genellina
Gabriel Genellina added the comment: See http://www.sqlite.org/cvstrac/tktview?tn=3221 Try upgrading to the latest sqlite release. Or set "pragma full_column_names=ON;" import sqlite3 conn = sqlite3.connect(':memory:') cursor = conn.cursor() cursor.execute("create table T (a, b, c)") cursor.e

[issue5115] Extend subprocess.kill to be able to kill process groups

2009-01-30 Thread Erick Tryzelaar
New submission from Erick Tryzelaar : It would be really handy to add a way to portably kill process groups of a process spawned with subprocess.Popen. My project starts a process, which then starts other long running processes. Because of this process tree, there's no way for me to portably k

[issue5036] xml.parsers.expat make a dictionary which keys are broken if buffer_text is False.

2009-01-30 Thread Takeshi Matsuyama
Takeshi Matsuyama added the comment: Could someone close this? ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://ma

[issue5036] xml.parsers.expat make a dictionary which keys are broken if buffer_text is False.

2009-01-30 Thread Benjamin Peterson
Changes by Benjamin Peterson : -- resolution: -> invalid status: open -> closed ___ Python tracker ___ ___ Python-bugs-list mailing li

[issue5110] Printing Unicode chars from the interpreter in a non-UTF8 terminal (Py3)

2009-01-30 Thread Ezio Melotti
Ezio Melotti added the comment: This seems to fix the problem: -- import sys import builtins def hook(message): if message is None: return builtins._ = message try: print(repr(message)) except UnicodeEncodeError: print(ascii(me

[issue5105] sqlite3.Row class, handling duplicate column names resulting from a SQL join

2009-01-30 Thread Brandon Adams
Brandon Adams added the comment: Ah, that's it. Thanks for the tip, this issue can be closed now. ___ Python tracker ___ ___ Python-bugs-list

[issue5106] Update Naming & Binding statement for 3.0

2009-01-30 Thread Benjamin Peterson
Benjamin Peterson added the comment: Fixed in r69132. -- nosy: +benjamin.peterson resolution: -> fixed status: open -> closed ___ Python tracker ___

[issue5099] subprocess.POpen.__del__() AttributeError (os module == None!)

2009-01-30 Thread Gabriel Genellina
Gabriel Genellina added the comment: At interpreter shutdown, the module's global variables are set to None before the module itself is released. __del__ methods may be called in those precaries circumstances, and should not rely on any global state. A temporary fix would be to make Popen._in

[issue5099] subprocess.POpen.__del__() AttributeError (os module == None!)

2009-01-30 Thread Gabriel Genellina
Gabriel Genellina added the comment: Patch and test case against trunk -- versions: +Python 2.7, Python 3.0, Python 3.1 Added file: http://bugs.python.org/file12902/test_subprocess.diff ___ Python tracker _

[issue5102] urllib2.py timeouts do not propagate across redirects for 2.6.1 (and 3.x?)

2009-01-30 Thread Gabriel Genellina
Changes by Gabriel Genellina : -- nosy: +gagenellina ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail

[issue5094] datetime lacks concrete tzinfo impl. for UTC

2009-01-30 Thread Gabriel Genellina
Gabriel Genellina added the comment: Seems perfectly reasonable to me. -- nosy: +gagenellina ___ Python tracker ___ ___ Python-bugs-li

[issue5116] expose _CrtSetReportMode via the msvcrt module

2009-01-30 Thread Mark Hammond
New submission from Mark Hammond : In bug 4804, there is some debate about how desirable it is for Python to unconditionally disable all CRT assertions on Windows - however, there is agreement that exposing the ability to enable and disable these assertions via the msvcrt module is reasonable - s

[issue5116] expose _CrtSetReportMode via the msvcrt module

2009-01-30 Thread Mark Hammond
Changes by Mark Hammond : -- components: +Windows ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.py

[issue4804] Python on Windows disables all C runtime library assertions

2009-01-30 Thread Mark Hammond
Mark Hammond added the comment: I created bug 5116 with a patch to expose CrtSetDebugMode via the msvcrt module. I didn't attach it to this patch as it doesn't address the fundamental point in this bug, just offers a workaround to reinstate the default if desired. If there *was* agreement to c

[issue5117] os.path.relpath problem with root drive directory on windows

2009-01-30 Thread eliben
New submission from eliben : This is correct: relpath(r'd:\abc\jho', r'd:\abc') => 'jho' But this isn't: relpath(r'd:\jho', r'd:\\') => '..\jho' Neither is this: relpath(r'd:\jho', r'd:') => '..\..\..\jho' -- components: Library (Lib) messages: 80860 nosy: eliben severity: normal stat