[issue9017] doctest option flag to enable/disable some chunk of doctests?

2010-10-06 Thread Amaury Forgeot d7;Arc
Amaury Forgeot d'Arc added the comment: harobed, the -SKIP solution does not work. Doctest directives only apply to a single line. After a quick search, I found two workarounds there: http://stackoverflow.com/questions/1809037/python-doctest-skip-entire-block - Replace >>> with

[issue10044] small int optimization

2010-10-07 Thread Amaury Forgeot d7;Arc
Amaury Forgeot d'Arc added the comment: Arithmetic with void* pointers is not allowed by the Microsoft compilers. char* should be used instead. -- nosy: +amaury.forgeotdarc ___ Python tracker <http://bugs.python.org/is

[issue5870] subprocess.DEVNULL

2010-10-07 Thread Amaury Forgeot d7;Arc
Changes by Amaury Forgeot d'Arc : -- stage: -> needs patch ___ Python tracker <http://bugs.python.org/issue5870> ___ ___ Python-bugs-list mailing li

[issue10017] pprint.pprint raises TypeError on dictionaries with user-defined types as keys

2010-10-08 Thread Amaury Forgeot d7;Arc
Amaury Forgeot d'Arc added the comment: A simpler change would to replace: rv = self.obj.__lt__(other.obj) with rv = type(self.obj).__lt__(self.obj, other.obj) -- nosy: +amaury.forgeotdarc ___ Python tracker <http://bugs.py

[issue10068] global objects created in some module are not destroyed when last reference to that module is released

2010-10-12 Thread Amaury Forgeot d7;Arc
Amaury Forgeot d'Arc added the comment: This also reproduces in 2.7. 2.6 and 2.7 have a different behaviour. -- nosy: +amaury.forgeotdarc versions: +Python 2.7 ___ Python tracker <http://bugs.python.org/is

[issue10080] Py_Initialize crashes when stdout has been redirected with freopen

2010-10-12 Thread Amaury Forgeot d7;Arc
Amaury Forgeot d'Arc added the comment: It looks very similar to issue6501. Can you check if setting the environment variable PYTHONIOENCODING=cp1252 solves the problem? -- nosy: +amaury.forgeotdarc ___ Python tracker <http://bugs.py

[issue10100] fromfd is now available on all platforms

2010-10-14 Thread Amaury Forgeot d7;Arc
Amaury Forgeot d'Arc added the comment: You already changed the test in r84449! The doc still needs updating. -- nosy: +amaury.forgeotdarc ___ Python tracker <http://bugs.python.org/is

[issue10089] Add support for arbitrary -X options

2010-10-15 Thread Amaury Forgeot d7;Arc
Amaury Forgeot d'Arc added the comment: Why wouldn't they? A standard way to extend the command line options seems useful in all environments. Now the interpretation of these options are subject to variations of course... -- nosy: +amaury.f

[issue10098] intermittent failure in test_os

2010-10-15 Thread Amaury Forgeot d7;Arc
Amaury Forgeot d'Arc added the comment: _kill_with_event() does not wait for the subprocess to be ready. It seems to me that the following test is wrong: if m[0] == 0: It should be "if m[0] == 1", since we want to check that the subprocess updated the shared memory.

[issue10089] Add support for arbitrary -X options

2010-10-15 Thread Amaury Forgeot d7;Arc
Amaury Forgeot d'Arc added the comment: Well, the syntax allows to pass either a string value (because it's a substring of the command line), or nothing. When no value is passed, True seems better than None, because this allows the usage of the get() method:: x = sys.xoptions.g

[issue10093] Warn when files are not explicitly closed

2010-10-15 Thread Amaury Forgeot d7;Arc
Amaury Forgeot d'Arc added the comment: Please add a similar warning in PC/_subprocess.c::sp_handle_dealloc() I just got caught by this in PyPy because some pipe handle relies on reference counting to be closed. This ad-hoc fix would suppress the warning: http://codespeak.net/pipe

[issue5355] Expat parser error constants are string descriptions

2010-10-15 Thread Amaury Forgeot d7;Arc
Amaury Forgeot d'Arc added the comment: Please, add a tiny unit test for the presence of this feature. This is the only way for vm implementers to follow CPython development. -- nosy: +amaury.forgeotdarc stage: -> unit test needed status: closed

[issue10133] multiprocessing: conn_recv_string() broken error handling

2010-10-17 Thread Amaury Forgeot d7;Arc
Changes by Amaury Forgeot d'Arc : -- assignee: -> jnoller nosy: +jnoller title: conn_recv_string() broken error handling -> multiprocessing: conn_recv_string() broken error handling ___ Python tracker <http://bugs.python.

[issue10137] Patch to IDLE for Python 2.7, at Guido's request

2010-10-18 Thread Amaury Forgeot d7;Arc
Amaury Forgeot d'Arc added the comment: But this patch is a diff between a 2.7 and a 3.2 version of IDLE, isn't it? The tkinter->Tkinter renaming is not supposed to happen in the 2.7 branch. Could you instead show a diff between the present version of IDLE in 2.7 and the result

[issue10156] Memory leak (r70459)

2010-10-20 Thread Amaury Forgeot d7;Arc
Amaury Forgeot d'Arc added the comment: The stack corresponds to the allocation of type(sys.float_info).__doc__. Why would only this object appear as a memory leak? It is certainly not deallocated, but all other types are in the same situation. For example, sys.int_info is very similar

[issue10158] BadInternalCall running test_multiprocessing

2010-10-20 Thread Amaury Forgeot d7;Arc
Amaury Forgeot d'Arc added the comment: Does it happen when compiled in debug mode? There may be asserts that will give a better (or earlier) error message. Some thoughts: the '_PyTrash_delete_later' chain can only contain a limited set of objects: lists, frames... (which c

[issue10156] Initialization of globals in unicodeobject.c

2010-10-22 Thread Amaury Forgeot d7;Arc
Amaury Forgeot d'Arc added the comment: About the patch: why should _PyUnicode_Init() try to call _PyUnicode_InitGlobals() again? -- ___ Python tracker <http://bugs.python.org/is

[issue10180] File objects should not pickleable

2010-10-23 Thread Amaury Forgeot d7;Arc
Amaury Forgeot d'Arc added the comment: The patch modifies _io.TextIOWrapper, but not _pyio.TextIOWrapper. Is there a reason? -- ___ Python tracker <http://bugs.python.org/is

[issue6715] xz compressor support

2010-10-27 Thread Amaury Forgeot d7;Arc
Amaury Forgeot d'Arc added the comment: As promised, here is a quick review of the module. https://code.launchpad.net/~proyvind/pyliblzma/py3k looks ready for a new entry in the PyPI, but for inclusion in core python it needs some cleanup: - I suppose that src/pyliblzma.c is the

[issue10219] BufferedReader.read1 does not check for closed file

2010-10-28 Thread Amaury Forgeot d7;Arc
New submission from Amaury Forgeot d'Arc : The following snippet should raise ValueError (twice :-) f = open('foo', 'rb') print(f.read1(1)) # OK f.close() print(f.read1(5)) # expected ValueError("I/O operation on closed file") print(f.peek()) # expected

[issue9377] socket, PEP 383: Mishandling of non-ASCII bytes in host/domain names

2010-10-29 Thread Amaury Forgeot d7;Arc
Amaury Forgeot d'Arc added the comment: The code in socketmodule.c currently compile with suspect warnings: socketmodule.c(3108) : warning C4047: 'function' : 'LPSTR' differs in levels of indirection from 'int' socketmodule.c(3108) : warning C4024: '

[issue9015] f.write(s) for s > 2GB hangs in win64 (and win32?)

2010-11-04 Thread Amaury Forgeot d7;Arc
Amaury Forgeot d'Arc added the comment: It's still an issue with 2.7, and even with 3.2a2, see issue9611. -- nosy: +amaury.forgeotdarc ___ Python tracker <http://bugs.python.

[issue9611] FileIO not 64-bit safe under Windows

2010-11-04 Thread Amaury Forgeot d7;Arc
Amaury Forgeot d'Arc added the comment: Fortunately, the lower-level write() has no such bug, at least when used in binary mode as FileIO does: it's almost a direct call to WriteFile(). This issue is more considered because it's not a bug in the Microsoft CRT, but in the Python

[issue10311] Signal handlers must preserve errno

2010-11-04 Thread Amaury Forgeot d7;Arc
Amaury Forgeot d'Arc added the comment: This issue is not really relevant on Windows: - signals are actually run in a new thread specially created. - errno is a thread-local variable; its value is thus local to the signal handler, same for WSAGetLastError(). --

[issue10311] Signal handlers must preserve errno

2010-11-04 Thread Amaury Forgeot d7;Arc
Amaury Forgeot d'Arc added the comment: > Nice. Then I suggest a config macro for whether this is needed. > Either a test for windows, or an autoconf thing in case some Unixes > are equally sensible. (Linux isn't, I checked.) I'm quite sure that all Unixes invoke

[issue9611] FileIO not 64-bit safe under Windows

2010-11-04 Thread Amaury Forgeot d7;Arc
Amaury Forgeot d'Arc added the comment: On a second thought... is there another example where a *blocking* stream does not write all the data without raising an exception? -- ___ Python tracker <http://bugs.python.org/i

[issue9611] FileIO not 64-bit safe under Windows

2010-11-04 Thread Amaury Forgeot d7;Arc
Amaury Forgeot d'Arc added the comment: > Why do you think this would be somehow an example for a blocking stream > that does not write all data without raising an exception? Well, that's what "clamping" means, isn't it? -- __

[issue10344] codecs.readline doesn't care buffering=0

2010-11-06 Thread Amaury Forgeot d7;Arc
Amaury Forgeot d'Arc added the comment: Antoine, should codecs.open() be removed or simply aliased to open()? -- nosy: +amaury.forgeotdarc, pitrou ___ Python tracker <http://bugs.python.org/is

[issue10356] decimal.py: hash of -1

2010-11-08 Thread Amaury Forgeot d7;Arc
Amaury Forgeot d'Arc added the comment: It's not about the hash value, but about consistency: help(Decimal.__hash__) says "x.__hash__() <==> hash(x)", but this is not true for x=Decimal(-1). -- nosy: +amaury.forgeotdarc ___

[issue10362] AttributeError: addinfourl instance has no attribute 'tell'

2010-11-08 Thread Amaury Forgeot d7;Arc
Amaury Forgeot d'Arc added the comment: With a socket file you cannot rely on autodetection of the format. I suggest to try tarfile.open(fileobj=file_, mode='r:') or tarfile.open(fileobj=file_, mode='r:gz') --

[issue10362] AttributeError: addinfourl instance has no attribute 'tell'

2010-11-08 Thread Amaury Forgeot d7;Arc
Amaury Forgeot d'Arc added the comment: I'm sure the traceback changed then? mode='r:' uses a different code path. -- ___ Python tracker <http://bug

[issue10365] IDLE Crashes on File Open Dialog when code window closed before other file opened

2010-11-08 Thread Amaury Forgeot d7;Arc
Amaury Forgeot d'Arc added the comment: Reproduced in a console window: C:\>c:\python31\python.exe -m idlelib.idle Exception in Tkinter callback Traceback (most recent call last): File "c:\python31\lib\tkinter\__init__.py", line 1399, in __call__ return self.fun

[issue10379] locale.format() input regression

2010-11-09 Thread Amaury Forgeot d7;Arc
Amaury Forgeot d'Arc added the comment: This was changed by issue2522 on purpose; no suffix is allowed in locale.format(). -- nosy: +amaury.forgeotdarc, r.david.murray ___ Python tracker <http://bugs.python.org/is

[issue10383] test_os leaks under Windows

2010-11-11 Thread Amaury Forgeot d7;Arc
Amaury Forgeot d'Arc added the comment: This leaks one reference every time: os.write(123456, b"b") -- ___ Python tracker <http://bugs.pyt

[issue10383] test_os leaks under Windows

2010-11-11 Thread Amaury Forgeot d7;Arc
Amaury Forgeot d'Arc added the comment: This looks suspect (in function posix_write):: if (!PyArg_ParseTuple(args, "iy*:write", &fd, &pbuf)) return NULL; if (!_PyVerify_fd(fd)) return posix_error(); I'd prefer a "PyBuffer_Release(&p

[issue10142] Support for SEEK_HOLE/SEEK_DATA

2010-11-11 Thread Amaury Forgeot d7;Arc
Amaury Forgeot d'Arc added the comment: - The patch modifies the _io module but not _pyio, why? (try f=_pyio.open("XX","w+b") at the beginning of the script above) - One test was *removed*, but nothing was added to test this new feature. This is the most likely

[issue10391] obj2ast's error handling can lead to python crashing with a C-level assertion failure

2010-11-11 Thread Amaury Forgeot d7;Arc
Amaury Forgeot d'Arc added the comment: IMO a better patch would be to use the %R format specification: PyErr_Format( PyExc_TypeError, "expected some sort of mod, but got %R", obj); And no need to use PyObject_Repr and the temporary variable! -- nosy: +ama

[issue10393] "with" statement isn't thread-safe

2010-11-12 Thread Amaury Forgeot d7;Arc
Amaury Forgeot d'Arc added the comment: Agreed. There was a similar issue in python2.6 with list comprehensions. The issue is that both threads run the code with the same globals dictionary, and top-level code use the same dict for locals and globals. This is already fixed in 2.7 an

[issue3871] cross and native build of python for mingw32 with distutils

2010-11-12 Thread Amaury Forgeot d7;Arc
Amaury Forgeot d'Arc added the comment: I'm trying to read the patch. It contains many interesting things (and others I have no opinon about), but it is very large, and makes it difficult to comment or find why some change were made etc. I do believe that better supporting t

[issue3871] cross and native build of python for mingw32 with distutils

2010-11-12 Thread Amaury Forgeot d7;Arc
Amaury Forgeot d'Arc added the comment: > but the very very first thing that has to happen - before any of this > work is begun - is for the distutils freeze to be lifted, or for > someone to come up with a _sensible_ alternative solution. Tarek's approach looks right to

[issue10141] SocketCan support

2010-11-13 Thread Amaury Forgeot d7;Arc
Amaury Forgeot d'Arc added the comment: The patch looks good at first glance, but is there a way to test the feature? -- nosy: +amaury.forgeotdarc ___ Python tracker <http://bugs.python.org/is

[issue3871] cross and native build of python for mingw32 with distutils

2010-11-13 Thread Amaury Forgeot d7;Arc
Amaury Forgeot d'Arc added the comment: > this is, after all, a new platform! it starts off with > "sys.platform == 'mingw32'" I disagree; programs compiled with mingw32 run on Windows, and use the MSVC runtime. It's the same platform as the current wi

[issue2405] Drop w9xpopen and all dependencies

2010-11-14 Thread Amaury Forgeot d7;Arc
Amaury Forgeot d'Arc added the comment: It is still time to add to 3.2 a DeprecationWarning when w9xpopen is used, and remove the feature in 3.3. See attached patch -- keywords: +patch nosy: +amaury.forgeotdarc Added file: http://bugs.python.org/file19608/deprecate-w9xpopen.

[issue3871] cross and native build of python for mingw32 with distutils

2010-11-15 Thread Amaury Forgeot d7;Arc
Amaury Forgeot d'Arc added the comment: > But different build system make new plaform! Maybe, but not a new "sys.platform". VC6 and VS9.0 don't share any project file for the compilation; but they both build a sys.platform=='win32'. Distutils has to use anoth

[issue3871] cross and native build of python for mingw32 with distutils

2010-11-15 Thread Amaury Forgeot d7;Arc
Amaury Forgeot d'Arc added the comment: Luke, Please please! Don't make me say what I did not say. I just said "I disagree", without any bad word. This may have been a bit terse, but I don't consider the issue tracker as a place to express one's feelings; hey

[issue10444] A mechanism is needed to override waiting for Python threads to finish

2010-11-17 Thread Amaury Forgeot d7;Arc
Amaury Forgeot d'Arc added the comment: How do you use it? -- nosy: +amaury.forgeotdarc ___ Python tracker <http://bugs.python.org/issue10444> ___ ___ Pytho

[issue11309] #include in Objects/unicodetype_db.h and Objects/unicodectype.c

2011-02-24 Thread Amaury Forgeot d7;Arc
Amaury Forgeot d'Arc added the comment: --with-wctype-functions was removed in 3.2 (see issue9210, r84752) -- nosy: +amaury.forgeotdarc ___ Python tracker <http://bugs.python.org/is

[issue11253] autodocument first appearance of ctypes.wintypes constants

2011-02-25 Thread Amaury Forgeot d7;Arc
Amaury Forgeot d'Arc added the comment: Can you provide a patch, or show how to do it concretely? -- nosy: +amaury.forgeotdarc ___ Python tracker <http://bugs.python.org/is

[issue10880] do_mkvalue and 'boolean'

2011-02-27 Thread Amaury Forgeot d7;Arc
Amaury Forgeot d'Arc added the comment: This test is wrong:: if (!PyBool_Check(test_var) && test_var == Py_False) the second part is never executed. if (test_var != Py_False) is enough to test the return value. -- ___ Python t

[issue9197] Crash when importing an extension after Py_Initialize, Py_Finalize and Py_Initialize

2011-02-27 Thread Amaury Forgeot d7;Arc
Amaury Forgeot d'Arc added the comment: Does the patch for issue11321 fix this issue? -- ___ Python tracker <http://bugs.python.org/issue9197> ___ ___ Pytho

[issue11321] 9th import of module _pickle always crashes

2011-02-27 Thread Amaury Forgeot d7;Arc
Amaury Forgeot d'Arc added the comment: The patch looks good. It may also fix issue9197, which fails in a similar fashion -- nosy: +amaury.forgeotdarc ___ Python tracker <http://bugs.python.org/is

[issue9276] pickle should support methods

2011-03-01 Thread Amaury Forgeot d7;Arc
Amaury Forgeot d'Arc added the comment: > Being able to pickle unbound methods is important. In my project I have > objects that refer to unbound methods. Now these objects are > unpickleable. I can't save them to disk and I can't use the > multiprocessing module on

[issue9276] pickle should support methods

2011-03-01 Thread Amaury Forgeot d7;Arc
Amaury Forgeot d'Arc added the comment: did you see my example above? it passes methods defined in user code. -- ___ Python tracker <http://bugs.python.org/i

[issue9276] pickle should support methods

2011-03-02 Thread Amaury Forgeot d7;Arc
Amaury Forgeot d'Arc added the comment: OK, let's go back to the "__namespace__" idea, then. A long time ago I had the idea that the ast compiler could remember the list of "named blocks" (classes, functions) with their line numbers; for example, the statement &

[issue11368] xml.etree.ElementTree.Element should have a reference to parent

2011-03-02 Thread Amaury Forgeot d7;Arc
Amaury Forgeot d'Arc added the comment: Anatoly, do you find the suggestions in http://effbot.org/zone/element.htm#accessing-parents useful to you? If so, this paragraph could be copied into the documentation. -- nosy: +amaury.forgeo

[issue11378] os.path.join when second argument starts with '/' (linux/unix)

2011-03-02 Thread Amaury Forgeot d7;Arc
Amaury Forgeot d'Arc added the comment: And the current behaviour is useful; for example, the absolute path of a file name can be computed with os.path.join(os.getcwd(), filename). This works with both absolute and relative paths. os.path.join() won't change; you probably shoul

[issue11382] some posix module functions unnecessarily release the GIL

2011-03-03 Thread Amaury Forgeot d7;Arc
Amaury Forgeot d'Arc added the comment: On Windows at least, these functions call malloc() and DuplicateHandle(). -- nosy: +amaury.forgeotdarc ___ Python tracker <http://bugs.python.org/is

[issue11382] some posix module functions unnecessarily release the GIL

2011-03-03 Thread Amaury Forgeot d7;Arc
Amaury Forgeot d'Arc added the comment: What are you trying to achieve? Do you have loops which contain no other syscall than os.dup2()? -- ___ Python tracker <http://bugs.python.org/is

[issue11395] print(s) fails on Windows with long strings

2011-03-03 Thread Amaury Forgeot d7;Arc
Changes by Amaury Forgeot d'Arc : -- nosy: +pitrou priority: normal -> high ___ Python tracker <http://bugs.python.org/issue11395> ___ ___ Python-bugs-lis

[issue11395] print(s) fails on Windows with long strings

2011-03-04 Thread Amaury Forgeot d7;Arc
Amaury Forgeot d'Arc added the comment: Likewise, this fails with 3.2:: import os os.write(1, b"a" * 66000) -- nosy: +amaury.forgeotdarc ___ Python tracker <http://bugs.pyt

[issue11395] print(s) fails on Windows with long strings

2011-03-04 Thread Amaury Forgeot d7;Arc
Amaury Forgeot d'Arc added the comment: no, it works with 3.2b2 (r32b2:87398), and fails with 3.2 final (r32:88445) -- ___ Python tracker <http://bugs.python.org/is

[issue11395] print(s) fails on Windows with long strings

2011-03-04 Thread Amaury Forgeot d7;Arc
Amaury Forgeot d'Arc added the comment: This changed with r87824 -- ___ Python tracker <http://bugs.python.org/issue11395> ___ ___ Python-bugs-list m

[issue11395] print(s) fails on Windows with long strings

2011-03-04 Thread Amaury Forgeot d7;Arc
Amaury Forgeot d'Arc added the comment: Indeed, Python3.1 fails with the -u option. Before r87824, the C call to write() performed CRLF conversion. In the implementation of MSVCRT, a local buffer is used (1025 chars in vs8.0, 5*1024 in vs10.0), so WriteFile is called with small sizes.

[issue11395] print(s) fails on Windows with long strings

2011-03-04 Thread Amaury Forgeot d7;Arc
Amaury Forgeot d'Arc added the comment: I'm writing bytes here: os.write(1, b"b" * 66000) And WriteConsole has the same issue. -- ___ Python tracker <http://bug

[issue11395] print(s) fails on Windows with long strings

2011-03-04 Thread Amaury Forgeot d7;Arc
Amaury Forgeot d'Arc added the comment: It may be a windows bug, but it's also an a python regression! A fix is to limit the number of chars: === --- D:/py3k/Modules/_io/fileio.c (revision 87824) +++ D:/py3k/Modules/_i

[issue11368] Document why xml.etree.ElementTree.Element has no reference to parent

2011-03-04 Thread Amaury Forgeot d7;Arc
Amaury Forgeot d'Arc added the comment: This is a question for comp.lang.python ;-) -- ___ Python tracker <http://bugs.python.org/issue11368> ___ ___ Pytho

[issue11398] http_proxy on windows won't function due to incorrect case handling

2011-03-04 Thread Amaury Forgeot d7;Arc
Amaury Forgeot d'Arc added the comment: hmm, the code of urllib.request.getproxies_environment contains:: for name, value in os.environ.items(): name = name.lower() if value and name[-6:] == '_proxy': proxies[name[:-6]] = value So the comparison

[issue11395] print(s) fails on Windows with long strings

2011-03-06 Thread Amaury Forgeot d7;Arc
Amaury Forgeot d'Arc added the comment: On Windows, isatty() is a cheap call: a simple lookup in the _ioinfo structure. And dup2() can still change the destination of a file descriptor, so the new attribute can be out of sync... I suggest to call isatty() on every

[issue11395] print(s) fails on Windows with long strings

2011-03-07 Thread Amaury Forgeot d7;Arc
Amaury Forgeot d'Arc added the comment: This last patch looks good, except that the comments "if stdout mode is binary (python -u)" are incorrect: since r87824, all files are opened in binary mode. -- ___ Python tracker <http

[issue11415] ZipFile don't overwrite compresed files at create

2011-03-07 Thread Amaury Forgeot d7;Arc
Amaury Forgeot d'Arc added the comment: > Luckily, extracting one of them just get only the more recent one It's not only luck: a Zip file has a "central directory" used to retrieve data. ZipFile just appends the new file data to the end of the Zip file, then write

[issue11413] Idle doesn't start

2011-03-07 Thread Amaury Forgeot d7;Arc
Amaury Forgeot d'Arc added the comment: Can you open a command prompt, and type: c:\python32\python.exe -m idlelib.idle If there are messages, please paste them here! -- nosy: +amaury.forgeotdarc ___ Python tracker <http://bugs.py

[issue11413] Idle doesn't start

2011-03-08 Thread Amaury Forgeot d7;Arc
Amaury Forgeot d'Arc added the comment: - Click the "Start" button - On this menu, click the "Run..." item (almost at the bottom) - In the small windows that opens, type "cmd" and click OK. This opens the command prompt. - In this window, type: c:\pyth

[issue11413] Idle doesn't start

2011-03-08 Thread Amaury Forgeot d7;Arc
Amaury Forgeot d'Arc added the comment: You certainly have a TCL_LIBRARY environment variable set on your system, it should be removed. For detailed instructions: http://mail.python.org/pipermail/python-list/2010-April/1241061.html -- ___ P

[issue11441] compile() raises SystemError if called from except clause

2011-03-08 Thread Amaury Forgeot d7;Arc
Amaury Forgeot d'Arc added the comment: Right. In most cases, "PyErr_SetObject(PyExc_SyntaxError, tuple);" will store the untouched tuple in tstate->curexc_value, *except* when "Implicit exception chaining" occurs, in which case the exception is normalized. a

[issue11441] compile() raises SystemError if called from except clause

2011-03-08 Thread Amaury Forgeot d7;Arc
Amaury Forgeot d'Arc added the comment: Why is the exception normalized at the end? I suppose it's because when value is an exception instance, it's replaced by a tuple, but the original value has to be recreated at the end. So in some cases, the SyntaxError object is create

[issue11441] compile() raises SystemError if called from except clause

2011-03-09 Thread Amaury Forgeot d7;Arc
Amaury Forgeot d'Arc added the comment: > That's why I thought that calling PyErr_NormalizeException with the new > tuple is the simplest thing to do, becuase I guess that'll take care of > all fields automatically. You could also call PyErr_NormalizeException at the b

[issue11441] compile() raises SystemError if called from except clause

2011-03-09 Thread Amaury Forgeot d7;Arc
Amaury Forgeot d'Arc added the comment: hmm, you are right, of course. I forgot that e.args is part of the SyntaxError members. -- ___ Python tracker <http://bugs.python.org/is

[issue3080] Full unicode import system

2011-03-10 Thread Amaury Forgeot d7;Arc
Amaury Forgeot d'Arc added the comment: Nice work! Is there a specific place for comments? Here are some of them already: - Modules/zipimport.c::make_filename: remove the limit buffer, the code could look like: pathsize = PyUnicode_GET_SIZE(prefix) + PyUnicode_GET_SIZE(name); r

[issue11461] Reading UTF-16 with codecs.readline() breaks on surrogate pairs

2011-03-10 Thread Amaury Forgeot d7;Arc
Amaury Forgeot d'Arc added the comment: The utf16 incremental codec does not like incomplete surrogate pairs. Patch attached. I also plan to refactor all the test_partial() functions of test_codecs, to give them a common implementation. -- keywords: +patch nosy: +amaury.forgeo

[issue5228] multiprocessing not compatible with functools.partial

2011-03-10 Thread Amaury Forgeot d7;Arc
Amaury Forgeot d'Arc added the comment: The bug was fixed in 2.7, and not backported to 2.6. 2.6 is now in security-fix-only mode, if possible you should upgrade to 2.7. -- nosy: +amaury.forgeotdarc ___ Python tracker <http://bugs.py

[issue11441] compile() raises SystemError if called from except clause

2011-03-10 Thread Amaury Forgeot d7;Arc
Amaury Forgeot d'Arc added the comment: I'd choose solution 3, but instead of calling SyntaxError.__init__, call PyErr_NormalizeException(). -- ___ Python tracker <http://bugs.python.o

[issue11580] Add width and precision formatters to PyBytes_FromFormatV()

2011-03-17 Thread Amaury Forgeot d7;Arc
Changes by Amaury Forgeot d'Arc : -- assignee: -> haypo nosy: +haypo ___ Python tracker <http://bugs.python.org/issue11580> ___ ___ Python-bugs-lis

[issue11582] Boilerplate code replaced in Python/ceval.c

2011-03-17 Thread Amaury Forgeot d7;Arc
Amaury Forgeot d'Arc added the comment: Hmm, this kind of macros make it difficult to step line by line in a debugger. From this point of view, an inlined function would be better, I'm not sure if this can have a performance impact though. -- nosy: +amaury.f

[issue11626] Py_LIMITED_API on windows: unresolved symbol __imp___PyArg_ParseTuple_SizeT

2011-03-21 Thread Amaury Forgeot d7;Arc
Changes by Amaury Forgeot d'Arc : -- assignee: -> loewis nosy: +loewis ___ Python tracker <http://bugs.python.org/issue11626> ___ ___ Python-bugs-lis

[issue11633] regression: print buffers output when end=''

2011-03-22 Thread Amaury Forgeot d7;Arc
Amaury Forgeot d'Arc added the comment: We are talking about different things here: - When python is run from a console, sys.stdout is line buffered. sys.stdout.write() flushes if there is a carriage return. No need to change anything here. - print() could call file.flush() if file.i

[issue11633] regression: print buffers output when end=''

2011-03-22 Thread Amaury Forgeot d7;Arc
Amaury Forgeot d'Arc added the comment: The attached patch calls "if file.isatty(): file.flush()" at the end of the print function: - only when an "end" argument was specified - errors in file.isatty() are ignored (and then no flush occurs) -- keywords

[issue11633] regression: print buffers output when end=''

2011-03-22 Thread Amaury Forgeot d7;Arc
Amaury Forgeot d'Arc added the comment: > Python 3.2, WinXP, IDLE edit window, F5 Run: > 'Processing ...' appears immediately, 'Done' 3 sec later. Terry, IDLE is completely different, its sys.stdout completely bypasses the new io s

[issue11649] startElementNS in xml.sax.saxutils.XMLGenerator ignored encoding

2011-03-23 Thread Amaury Forgeot d7;Arc
Amaury Forgeot d'Arc added the comment: Do you have a test or a small script which shows the incorrect output? -- nosy: +amaury.forgeotdarc stage: -> test needed ___ Python tracker <http://bugs.python.org

[issue11656] Debug builds for Windows would be very helpful

2011-03-23 Thread Amaury Forgeot d7;Arc
Amaury Forgeot d'Arc added the comment: But for a debug build to be really useful, the source code must be available to the debugger. Compiling these source files is really a matter of minutes... provided that external dependencies are all present and also compiled in debug

[issue11667] 'configure' script overrides users setting of CFLAGS

2011-03-25 Thread Amaury Forgeot d7;Arc
Amaury Forgeot d'Arc added the comment: You should override the OPT variable as well. I tried: $ CFLAGS="" OPT="-fwrapv -O3 -Wall" ./configure Then "make" shows lines like: gcc -pthread -c -fno-strict-aliasing -DNDEBUG -fwrapv -O3 -Wall -I. -IInclud

[issue11667] 'configure' script overrides users setting of CFLAGS

2011-03-25 Thread Amaury Forgeot d7;Arc
Changes by Amaury Forgeot d'Arc : -- status: open -> closed ___ Python tracker <http://bugs.python.org/issue11667> ___ ___ Python-bugs-list mailing li

[issue11674] list(obj), tuple(obj) swallow TypeError (in _PyObject_LengthHint)

2011-03-25 Thread Amaury Forgeot d7;Arc
Amaury Forgeot d'Arc added the comment: _PyObject_LengthHint() does not define any exception; it simply calls PyObject_Size(), which is expected to raise TypeError for objects with no size (an opened file for example). Where is the problem exacty? Does the failing __len__ put the obje

[issue11693] memory leak in email.generator.Generator().flatten() method

2011-03-28 Thread Amaury Forgeot d7;Arc
Amaury Forgeot d'Arc added the comment: I replaced guppy by a debug build of Python and a simple "print sys.gettotalrefcount()". Indeed, I see a reference leak with Python2.6 (10 more references on every loop). There seems to be no leak with Python2.7. Which version of Py

[issue11697] Unsigned type in mmap_move_method

2011-03-28 Thread Amaury Forgeot d7;Arc
Amaury Forgeot d'Arc added the comment: Did you see a compiler warning? Indeed, this function (mmap.move) decodes its arguments with: PyArg_ParseTuple(args, "kkk:move", &dest, &src, &cnt) This looks wrong to me: these three numbers should be Py_ssize_t, and decod

[issue11697] Unsigned type in mmap_move_method

2011-03-28 Thread Amaury Forgeot d7;Arc
Changes by Amaury Forgeot d'Arc : -- keywords: +easy ___ Python tracker <http://bugs.python.org/issue11697> ___ ___ Python-bugs-list mailing list Unsubsc

[issue11700] mailbox.py proxy updates

2011-03-28 Thread Amaury Forgeot d7;Arc
Amaury Forgeot d'Arc added the comment: mbf.close() should not fail when called twice. The close() method in the io module states that "This method has no effect if the file is already closed." But then, is "close=False" necessary? -- nosy: +amaury.forgeotdar

[issue11702] dir on return value of msilib.OpenDatabase() crashes python

2011-03-28 Thread Amaury Forgeot d7;Arc
Amaury Forgeot d'Arc added the comment: A call to PyType_Ready() fixes the issue, see attached patch. I added a test that opens a random file in c:\windows\installer, I don't know if this is correct for all Windows version. -- keywords: +patch nosy: +amaury.forgeot

[issue11709] help-method crashes if sys.stdin is None

2011-03-29 Thread Amaury Forgeot d7;Arc
Amaury Forgeot d'Arc added the comment: The code fails precisely when checking that sys.stdin is a valid terminal. See the attached patch for a fix. Out of curiosity, why did you set sys.stdin to None? -- keywords: +patch nosy: +amaury.forgeotdarc stage: -> patch review Ad

[issue11717] conflicting definition of ssize_t in pyconfig.h

2011-03-30 Thread Amaury Forgeot d7;Arc
Amaury Forgeot d'Arc added the comment: Should Python.h systematically avoid defining symbols without a Py prefix? See attached patch, which defines Py_ssize_t in pyconfig.h. The same can be said for other symbols defined there: pid_t, copysign, hypot. -- keywords: +patch

[issue11722] mingw64 does not link when building extensions

2011-03-30 Thread Amaury Forgeot d7;Arc
Amaury Forgeot d'Arc added the comment: What are the values of SIZEOF_SIZE_T and SIZEOF_INT with this compiler? I'd expect them to be respectively 8 and 4. -- nosy: +amaury.forgeotdarc ___ Python tracker <http://bugs.python.o

<    1   2   3   4   5   6   7   8   9   10   >