[issue13792] The os.execl call doesn't give programs exit code

2012-01-17 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc amaur...@gmail.com added the comment: No. On Windows the only way to start a new executable is to create a new process (with the CreateProcess function, which all spawn* and exec* functions ultimately call), and this yields a new PID. This is a fundamental difference

[issue13804] Python library structure creates hard to read code when using higher order functions

2012-01-17 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc amaur...@gmail.com added the comment: Did you consider list comprehension? self.questions = sum((topic.questions for topic in self.topics), []) -- nosy: +amaury.forgeotdarc ___ Python tracker rep...@bugs.python.org http

[issue13787] PyCode_New not round-trippable (TypeError)

2012-01-17 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc amaur...@gmail.com added the comment: co_freevars and co_cellvars are the last arguments of the function. Your co_what2.py version of the script is correct, but co_what.py has a different order. -- nosy: +amaury.forgeotdarc resolution: - invalid status: open

[issue5689] Support xz compression in tarfile module

2012-01-17 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc amaur...@gmail.com added the comment: Ping. Windows buildbots are still failing with MemoryError because of this preset=9. The patch looks good to me as well. -- nosy: +amaury.forgeotdarc ___ Python tracker rep

[issue13727] Accessor macros for PyDateTime_Delta members

2012-01-17 Thread Amaury Forgeot d'Arc
Changes by Amaury Forgeot d'Arc amaur...@gmail.com: -- resolution: - fixed status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13727

[issue13809] bz2 does not work when threads are disabled

2012-01-17 Thread Amaury Forgeot d'Arc
New submission from Amaury Forgeot d'Arc amaur...@gmail.com: In bz2.py, import threading prevents the bz2 module from working when threads are not enabled. The attached patch removes the limitation and provides a fake lock object. I don't know if this should be backported to 3.2

[issue13727] Accessor macros for PyDateTime_Delta members

2012-01-16 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc amaur...@gmail.com added the comment: I named them following the other accessor macros: PyDateTime_TIME_GET_HOUR(), even though the check function is named PyTime_Check(). Which inconsistency do you prefer? :) -- ___ Python

Re: [issue13792] The os.execl call doesn't give programs exit code

2012-01-16 Thread Amaury Forgeot d'Arc
Le 16 janv. 2012 00:09, Kay Hayen rep...@bugs.python.org a écrit : I am the author of the Python compiler Nuitka. It has the ability to immediately execute the created executable file. For that I am using os.execl to immediately replace the compiler and run the freshly created binary instead.

[issue13774] json.loads raises a SystemError for invalid encoding on 2.7.2

2012-01-13 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc amaur...@gmail.com added the comment: This will be fixed in the next 2.7.3, thanks for the report! -- resolution: - fixed status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13774

[issue6727] ImportError when package is symlinked on Windows

2012-01-13 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc amaur...@gmail.com added the comment: Please regenerate your diff file, it undoes an unrelated fix :-) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6727

[issue13774] json.loads raises a SystemError for invalid encoding on 2.7.2

2012-01-12 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc amaur...@gmail.com added the comment: Here is a patch -- nosy: +amaury.forgeotdarc stage: - patch review ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13774

[issue13774] json.loads raises a SystemError for invalid encoding on 2.7.2

2012-01-12 Thread Amaury Forgeot d'Arc
Changes by Amaury Forgeot d'Arc amaur...@gmail.com: -- keywords: +patch Added file: http://bugs.python.org/file24212/json_badencoding.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13774

[issue13773] Support sqlite3 uri filenames

2012-01-11 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc amaur...@gmail.com added the comment: Hi, I will let others discuss the feature itself, here are already some comments about your patch: - In module_connect(), the ability to pass factory as a positional argument is broken, please restore the previous code; I'm afraid

[issue13729] Evaluation order for dics key/value

2012-01-09 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc amaur...@gmail.com added the comment: This is a duplicate of issue11205. -- nosy: +amaury.forgeotdarc resolution: - duplicate status: open - closed superseder: - Evaluation order of dictionary display is different from reference manual

[issue13727] Accessor macros for PyDateTime_Delta members

2012-01-07 Thread Amaury Forgeot d'Arc
New submission from Amaury Forgeot d'Arc amaur...@gmail.com: All objects of the datetime module have macros to access their properties, except timedelta. This simple patch adds the macros PyDateTime_DELTA_GET_DAYS, PyDateTime_DELTA_GET_SECONDS, PyDateTime_DELTA_GET_MICROSECONDS; module

[issue13609] Add os.get_terminal_size() function

2012-01-06 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc amaur...@gmail.com added the comment: Some remarks on the Windows implementation in termsize.diff.4: - On Windows, the C runtime always sets fileno(stdout) to 1, so hardcoded values are OK. But on Unix, I'm quite sure that embedded interpreters (mod_python?) sometimes

[issue13722] distributions can disable the encodings package

2012-01-06 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc amaur...@gmail.com added the comment: Agreed. This behavior probably comes from the times when unicode was an optional feature. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13722

[issue13616] Never ending loop in in update_refs Modules/gcmodule.c

2011-12-20 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc amaur...@gmail.com added the comment: Hey, you found it! PySide::DynamicSlotDataV2::callback() calls PyMethod_New() without getting the GIL. The Python allocator is not thread-safe, operations are supposed to be serialized by this Global Interpreter Lock. I suggest

[issue11900] 2.7.1 unicode subclasses not calling __str__() for print statement

2011-12-16 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc amaur...@gmail.com added the comment: However, it is a real change from 2.6 to 2.7 that breaks code. John, this issue is not the same as the one above. The difference between Python 2.6 and Python 2.7.2 you mention only applies to % formatting. The change is clearly

[issue13612] xml.etree.ElementTree says unknown encoding of a regular encoding

2011-12-16 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc amaur...@gmail.com added the comment: Actually, this fails on 2.6 and 2.7 on wide unicode builds, and passes with narrow unicode builds (on my 64bit Linux box). In pyexpat.c, PyUnknownEncodingHandler accesses 256 characters of a unicode buffer, without checking its length

[issue13609] Add os.get_terminal_size() function

2011-12-16 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc amaur...@gmail.com added the comment: Don't forget the Windows platform... here is an implementation: https://bitbucket.org/hpk42/py/src/980c8d526463/py/_io/terminalwriter.py#cl-284 But it would be better written in C, of course. -- nosy: +amaury.forgeotdarc

[issue13616] Never ending loop in in update_refs Modules/gcmodule.c

2011-12-16 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc amaur...@gmail.com added the comment: Are you sure that the program is really stuck in the gc module? The loop you mention has to go through all objects of the process. It's possible that it allocated many objects, that one garbage collection takes a few seconds, and even

[issue7652] Merge C version of decimal into py3k.

2011-12-15 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc amaur...@gmail.com added the comment: 2011/12/15 Stefan Krah rep...@bugs.python.org Stefan Krah stefan-use...@bytereef.org added the comment: Amaury has asked for more comments (and I agree). However, I'm not sure what level of detail would be appropriate

[issue13595] Weird behavior with generators with self-referencing output.

2011-12-13 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc amaur...@gmail.com added the comment: This is expected, and is due to the late binding of the label variable in the item+label expression. Look at the example below: l = [lambda item: item + label for label in ab] f1, f2 = l print f1(''), f2('') b b For the lambda

[issue13580] Pre-linkage of CPython =2.6 binary on Linux too fat (libssl, libcrypto)

2011-12-12 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc amaur...@gmail.com added the comment: I just checked the file python2.6_2.6.6-8.diff.gz from the Debian python2.6 package: http://packages.debian.org/squeeze/python2.6 This diff file contains a patch to build _hashlib and _ssl extensions statically that modifies Modules

[issue13582] IDLE and pythonw.exe stderr problem

2011-12-12 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc amaur...@gmail.com added the comment: terminate abruptly? I thought that print(file=None) silently returned, without printing but without an error. A delayed popup to display (otherwise discarded) output is a nice feature, though. -- nosy: +amaury.forgeotdarc

[issue13581] help() appears to be broken; doesn't display __doc__ for class type when called as help(type)

2011-12-11 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc amaur...@gmail.com added the comment: It fails for the same reason as issue1785: ~/python/cpython3.2$ ./python -c import inspect; inspect.classify_class_attrs(type) Traceback (most recent call last): File string, line 1, in module File /home/amauryfa/python/cpython3.2

[issue1785] inspect gets broken by some descriptors

2011-12-11 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc amaur...@gmail.com added the comment: The 'type' object now has the same issue: __abstractmethods__ appears in dir(type) but type.__abstractmethods__ fails with an AttributeError. See issue13581 -- nosy: +amaury.forgeotdarc

[issue13557] exec of list comprehension fails on NameError

2011-12-09 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc amaur...@gmail.com added the comment: This is expected and documented: http://docs.python.org/py3k/reference/executionmodel.html#interaction-with-dynamic-features Free variables are not resolved in the nearest enclosing namespace, but in the global namespace., a free

[issue13546] sys.setrecursionlimit() crashes IDLE

2011-12-08 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc amaur...@gmail.com added the comment: 'e' is used in the comment above: isinstance(e, ValueError) used to fail... I agree to use the modern 'as' syntax. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org

[issue13546] sys.setrecursionlimit() crashes IDLE

2011-12-07 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc amaur...@gmail.com added the comment: On the other hand, there is no reason for the recursion limit to be actually reached, just by setting it! Is there a hidden infinite recursion somewhere? -- nosy: +amaury.forgeotdarc

[issue13546] sys.setrecursionlimit() crashes IDLE

2011-12-07 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc amaur...@gmail.com added the comment: hanji, could you start IDLE from a command prompt and try again: c:\python27\python.exe -m idlelib.idle Do you see additional error messages? -- ___ Python tracker rep...@bugs.python.org

[issue13546] sys.setrecursionlimit() crashes IDLE

2011-12-07 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc amaur...@gmail.com added the comment: Tested on Linux: Python 2.7.2+ (2.7:16c4137a413c+, Dec 4 2011, 22:56:38) [GCC 4.4.3] on linux2 import sys sys.setrecursionlimit((131)-1) import xx Exception RuntimeError: 'maximum recursion depth exceeded in __subclasscheck__

[issue13546] sys.setrecursionlimit() crashes IDLE

2011-12-07 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc amaur...@gmail.com added the comment: Here is a patch, with test. -- keywords: +patch Added file: http://bugs.python.org/file23868/issue13546.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13546

[issue13546] sys.setrecursionlimit() crashes IDLE

2011-12-07 Thread Amaury Forgeot d'Arc
Changes by Amaury Forgeot d'Arc amaur...@gmail.com: -- assignee: - amaury.forgeotdarc stage: needs patch - patch review ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13546

[issue13546] sys.setrecursionlimit() crashes IDLE

2011-12-07 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc amaur...@gmail.com added the comment: This will be fixed in the next 2.7 release, thanks for the report! -- resolution: - fixed stage: patch review - committed/rejected status: open - closed ___ Python tracker rep

[issue13517] readdir() in os.listdir not threadsafe on OSX 10.6.8

2011-12-01 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc amaur...@gmail.com added the comment: The link mentioned in the patch is really interesting: http://womble.decadent.org.uk/readdir_r-advisory.html -- nosy: +amaury.forgeotdarc ___ Python tracker rep...@bugs.python.org http

[issue13097] ctypes: segfault with large number of callback arguments

2011-11-30 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc amaur...@gmail.com added the comment: Right, alloca() could be replaced by some malloc(), but is it really useful? After all, when a C function calls back to Python, all arguments needs to be pushed to the stack anyway

[issue13493] Import error with embedded python on AIX 6.1

2011-11-30 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc amaur...@gmail.com added the comment: dlopen(/usr/local/lib/python2.6/lib-dynload/time.so, 2); You are trying to open a .so from another Python installation. It won't work: it is certainly linked to another Python VM, which is not initialized

[issue6715] xz compressor support

2011-11-30 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc amaur...@gmail.com added the comment: Oh well, I thought that I'd still earned a note with some slight credit at least I completely agree. Sometimes people get credit for simple bug fixes (count me among them) so the author of the first working implementation deserves

[issue6715] xz compressor support

2011-11-30 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc amaur...@gmail.com added the comment: what about a mention in lzmamodule.c? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6715

[issue7652] Merge C version of decimal into py3k.

2011-11-30 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc amaur...@gmail.com added the comment: I can help with the review. Is http://bugs.python.org/review/7652/show a good starting point? I already have some comments. -- nosy: +amaury.forgeotdarc ___ Python tracker rep

[issue13493] Import error with embedded python on AIX 6.1

2011-11-29 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc amaur...@gmail.com added the comment: I'm sorry I don't know much about AIX. How are shared libraries searched? is /usr/local/lib a standard place for them? After a couple of google search I suggest the following command: LIBPATH=/usr/local/lib:/usr/lib python2.7

[issue13496] bisect module: Overflow at index computation

2011-11-29 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc amaur...@gmail.com added the comment: [x]range is enough to trigger the bug:: bisect.bisect(range(sys.maxsize), sys.maxsize-3) -- nosy: +amaury.forgeotdarc ___ Python tracker rep...@bugs.python.org http://bugs.python.org

[issue13471] setting access time beyond Jan. 2038 on remote share failes on Win7 x64

2011-11-29 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc amaur...@gmail.com added the comment: I thought that time_t was 64 bits on Windows time_t *is* 64bit by default since Visual Studio 8, even with the 32bit compiler: http://msdn.microsoft.com/en-us/library/1f4c8f33(v=vs.80).aspx -- nosy: +amaury.forgeotdarc

[issue13471] setting access time beyond Jan. 2038 on remote share failes on Win7 x64

2011-11-29 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc amaur...@gmail.com added the comment: It's probably SAMBA which does not support time_t above 32bit. st_atime=910692730085 corresponds to a FILE_TIME of 0x7fff -- ___ Python tracker rep...@bugs.python.org http

[issue13471] setting access time beyond Jan. 2038 on remote share failes on Win7 x64

2011-11-29 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc amaur...@gmail.com added the comment: I found this samba bug: https://bugzilla.samba.org/show_bug.cgi?id=7785 It is fixed since Samba version 3.5.8. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13471

[issue13493] using python embed on AIX 6.1,Modules import error!

2011-11-28 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc amaur...@gmail.com added the comment: It may be related to issue941346. Can you try with a newer version of Python? 2.5 is not maintained anymore. -- nosy: +amaury.forgeotdarc ___ Python tracker rep...@bugs.python.org http

[issue13487] inspect.getmodule fails when module imports change sys.modules

2011-11-28 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc amaur...@gmail.com added the comment: When a package is imported sys.modules changes... nothing special here. But it's true true that py.std, for example, is a lazy module with a special __getattr__ that will import submodules. Patch looks good to me as well

[issue13493] Import error with embedded python on AIX 6.1

2011-11-28 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc amaur...@gmail.com added the comment: Is the man page really displayed during compilation? It's a bit weird that the CC compiler behaves this way. Is this common behavior on AIX? By the way, you are already in the make command; the output you show is made during

[issue13487] inspect.getmodule fails when module imports change sys.modules

2011-11-27 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc amaur...@gmail.com added the comment: You are certainly right, but I wonder how this can happen. Are there modules which import something just by looking at them? Or is is some race condition due to another running thread? -- nosy: +amaury.forgeotdarc

[issue13485] tcl question

2011-11-26 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc amaur...@gmail.com added the comment: Sorry, the issue tracker is not a place to ask for help. Please use the python-list mailing list or the comp.lang.python channel instead. -- nosy: +amaury.forgeotdarc resolution: - invalid status: open - closed

[issue13461] Error on test_issue_1395_5 with Python 2.7 and VS2010

2011-11-25 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc amaur...@gmail.com added the comment: I've identified a few other cases where a '#' format is passed a numeric literal: Python/codecs.c:514: return Py_BuildValue((u#n), end, 0, end); Modules/_io/textio.c:2323: DECODER_DECODE(input, 1, n); -- nosy

[issue13466] new timezones

2011-11-24 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc amaur...@gmail.com added the comment: But that does not give the *other* timezone :-( Which other timezone ? I meant the other timezone *name*. I think we don't understand each other: - time.timezone is the offset of the local (non-DST) timezone. - time.altzone

Re: [issue13471] setting access time beyond Jan. 2038 on remote share failes on Win7 x64

2011-11-24 Thread Amaury Forgeot d'Arc
The timestamp is converted to time_t (32 bits) and then to FILE_TIME (64 bits). A function to convert directly a PyObject to FILE_TIME should be written. I thought that time_t was 64 bits on Windows ___ Python-bugs-list mailing list Unsubscribe:

[issue1395] py3k: duplicated line endings when using read(1)

2011-11-23 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc amaur...@gmail.com added the comment: You should open a new issue for this new problem. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1395

[issue13466] new timezones

2011-11-23 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc amaur...@gmail.com added the comment: On my Ubuntu machine, I get: $ zdump -v Europe/Moscow | grep 201[0-9] Europe/Moscow Sat Mar 27 22:59:59 2010 UTC = Sun Mar 28 01:59:59 2010 MSK isdst=0 gmtoff=10800 Europe/Moscow Sat Mar 27 23:00:00 2010 UTC = Sun Mar 28 03:00:00

[issue13466] new timezones

2011-11-23 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc amaur...@gmail.com added the comment: A fairly correct way is to query the time zone database at time module import time by using the DST and GMT offset of that time. But that does not give the *other* timezone :-( IMO time.timezone and time.daylight should

[issue13466] new timezones

2011-11-23 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc amaur...@gmail.com added the comment: Another way to fix the issue is to wait 40 days. There won't be any release in-between anyway! -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13466

[issue13454] crash when deleting one pair from tee()

2011-11-22 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc amaur...@gmail.com added the comment: Also, a check for NULL would not hurt in tee_next(): diff -r 1e0e821d2626 Modules/itertoolsmodule.c --- a/Modules/itertoolsmodule.c Fri Nov 04 22:17:45 2011 +0100 +++ b/Modules/itertoolsmodule.c Tue Nov 22 17:24:42 2011 +0100 @@ -475,6

[issue13436] compile() doesn't work on ImportFrom with level=None

2011-11-22 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc amaur...@gmail.com added the comment: I fixed the bogus error message, but level=None is still not allowed, whereas the docs promise that optional values can be None. -- ___ Python tracker rep...@bugs.python.org http

[issue13458] _ssl memory leak in _get_peer_alt_names

2011-11-22 Thread Amaury Forgeot d'Arc
Changes by Amaury Forgeot d'Arc amaur...@gmail.com: -- nosy: +pitrou ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13458 ___ ___ Python-bugs-list

[issue3824] test_tarfile fails on cygwin (unicode decode error)

2011-11-20 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc amaur...@gmail.com added the comment: grp.getgrgid() now calls .decode('utf8', errors=surrogateescape). Even if cygwin does not correctly copy strings from the Windows registry, tarinfo.gname should now contain a string that will at least round trip and give the same value

[issue13436] compile() doesn't work on ImportFrom with level=None

2011-11-20 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc amaur...@gmail.com added the comment: Here is a patch for the bad error message (PyBytes_AS_BYTES after PyObject_Repr, bah) -- keywords: +patch nosy: +amaury.forgeotdarc Added file: http://bugs.python.org/file23739/issue13436.patch

[issue13436] compile() doesn't work on ImportFrom with level=None

2011-11-20 Thread Amaury Forgeot d'Arc
Changes by Amaury Forgeot d'Arc amaur...@gmail.com: -- nosy: +benjamin.peterson ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13436 ___ ___ Python

[issue13429] provide __file__ to extension init function

2011-11-18 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc amaur...@gmail.com added the comment: I suppose that the value of _Py_ModuleImportContext is protected by the import lock? -- nosy: +amaury.forgeotdarc ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13429

[issue13429] provide __file__ to extension init function

2011-11-18 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc amaur...@gmail.com added the comment: But the GIL can be released in many places (e.g. a Py_DECREF), and another thread can enter the same function and update the same static variable. -- ___ Python tracker rep

[issue13429] provide __file__ to extension init function

2011-11-18 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc amaur...@gmail.com added the comment: ... and the module init function could create and register a different module first, and ... Actually, this *does* happen, the PIL module is written this way. And I don't agree with the best effort argument. If there is a slight

[issue13418] Embedded Python memory leak

2011-11-17 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc amaur...@gmail.com added the comment: These are not memory leaks, but global state that the Python interpreter does not bother to free on exit. The amount of memory there is limited. Yes, I agree that this makes the basic memory checker built in Visual Studio completely

[issue6727] ImportError when package is symlinked on Windows

2011-11-17 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc amaur...@gmail.com added the comment: If we could get it in the next release (Python 2.8?) that would be awesome. I doubt it will (see PEP 404) but 3.3 is a good target. -- nosy: +amaury.forgeotdarc ___ Python tracker rep

[issue6715] xz compressor support

2011-11-16 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc amaur...@gmail.com added the comment: I just added the missing files liblzma.a to the externals repository. If someone can quickly check that it works on win32, I don't have anything else to add to this change. -- ___ Python

[issue13415] os.unsetenv() on Windows should not use UTF-8

2011-11-16 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc amaur...@gmail.com added the comment: But... there is no os.unsetenv on Windows! 2.7 used to have one, which called os.putenv(key, ) 3.2 has a os._unsetenv, which is a lambda key: _putenv(key, ) -- nosy: +amaury.forgeotdarc

[issue13410] String formatting bug in interactive mode

2011-11-15 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc amaur...@gmail.com added the comment: A debug build displays XXX undetected error. An error condition was not correctly cleared, see attached patch. -- keywords: +patch nosy: +amaury.forgeotdarc Added file: http://bugs.python.org/file23698/issue13410.patch

[issue13410] String formatting bug in interactive mode

2011-11-15 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc amaur...@gmail.com added the comment: New patch with a unit test. -- Added file: http://bugs.python.org/file23699/issue13410_2.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13410

[issue13410] String formatting bug in interactive mode

2011-11-15 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc amaur...@gmail.com added the comment: Sorry I found that u'%d' is equally affected, here is a new version. -- Added file: http://bugs.python.org/file23700/issue13410_3.patch ___ Python tracker rep...@bugs.python.org http

[issue13410] String formatting bug in interactive mode

2011-11-15 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc amaur...@gmail.com added the comment: Unfortunately without the print the test does not fail. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13410

[issue13410] String formatting bug in interactive mode

2011-11-15 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc amaur...@gmail.com added the comment: $ ./python Lib/test/regrtest.py test_format shows the error, but $ ./python Lib/test/regrtest.py -v test_format does not fail! The print is needed, can something else have the same effect

[issue13396] new method random.getrandbytes()

2011-11-13 Thread Amaury Forgeot d'Arc
New submission from Amaury Forgeot d'Arc amaur...@gmail.com: I noticed that several usages of random.getrandbits() actually need bytes. A few examples: - Lib/test/test_zlib.py calls random.getrandbits(8 * _1M).to_bytes() - Twisted uses the %x format and then call .decode('hex') Another

[issue13396] new method random.getrandbytes()

2011-11-13 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc amaur...@gmail.com added the comment: How would this work for other random number generators that don't supply genrand_int32()? genrand_int32 is an internal function, only available in C for the Mersenne Twister generator. random.SystemRandom() should provide

[issue13396] new method random.getrandbytes()

2011-11-13 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc amaur...@gmail.com added the comment: ./python -m timeit -s from random import getrandbits getrandbits(800).to_bytes(100, 'little') 10 loops, best of 3: 25 msec per loop ./python -m timeit -s from random import getrandbytes getrandbytes(100) 100 loops, best

[issue13396] new method random.getrandbytes()

2011-11-13 Thread Amaury Forgeot d'Arc
Changes by Amaury Forgeot d'Arc amaur...@gmail.com: Removed file: http://bugs.python.org/file23679/getrandbytes.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13396

[issue12875] backport re.compile flags default value documentation

2011-11-11 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc amaur...@gmail.com added the comment: The documentation now shows:: match(pattern, string[, flags=0]) Is it normal to have the brackets *and* the default value? -- nosy: +amaury.forgeotdarc status: closed - open ___ Python

[issue13375] Provide a namedtuple style interface for os.walk values

2011-11-09 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc amaur...@gmail.com added the comment: This patch needs a test at least. Also, the walktuple type should be defined only once, at the module level (but then, there may be a boostrap issue, I don't know). -- nosy: +amaury.forgeotdarc

[issue13335] Service application hang in python25.dll

2011-11-07 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc amaur...@gmail.com added the comment: Unfortunately there is not much in the process call stack: the creation of a list (PyList_New) needs to allocate some memory (not much: sizeof(PyListObject) + gc overhead, probably 32 bytes). If the system malloc() function fails

[issue13350] Use PyUnicode_FromFomat instead of PyUnicode_Format for fixed formats

2011-11-06 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc amaur...@gmail.com added the comment: Now PyUnicode_Format is only called by unicode_mod... -- resolution: - fixed status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13350

[issue13204] sys.flags.__new__ crashes

2011-11-05 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc amaur...@gmail.com added the comment: Why would we want to prevent users from creating new instances of FlagsType? -- nosy: +amaury.forgeotdarc ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13204

[issue13350] Use PyUnicode_FromFomat instead of PyUnicode_Format for fixed formats

2011-11-05 Thread Amaury Forgeot d'Arc
New submission from Amaury Forgeot d'Arc amaur...@gmail.com: A code simplification suggested by a comment in issue13349: Replace most usages of PyUnicode_Format (a.k.a. str.__mod__) by PyUnicode_FromFormat, which is easier to use from C: no need to build a tuple, and the format accept both C

[issue13340] list.index does not accept None as start or stop

2011-11-05 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc amaur...@gmail.com added the comment: str.index does accept None, though -- nosy: +amaury.forgeotdarc ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13340

[issue13343] Lambda keyword-only argument not updating co_freevars

2011-11-04 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc amaur...@gmail.com added the comment: Here is a patch, with a minimal test. -- keywords: +patch nosy: +amaury.forgeotdarc Added file: http://bugs.python.org/file23611/issue13343.patch ___ Python tracker rep...@bugs.python.org

[issue13343] Lambda keyword-only argument not updating co_freevars

2011-11-04 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc amaur...@gmail.com added the comment: same patch, without tabs. -- Added file: http://bugs.python.org/file23612/issue13343.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13343

[issue13343] Lambda keyword-only argument not updating co_freevars

2011-11-04 Thread Amaury Forgeot d'Arc
Changes by Amaury Forgeot d'Arc amaur...@gmail.com: Removed file: http://bugs.python.org/file23611/issue13343.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13343

[issue13343] Lambda keyword-only argument not updating co_freevars

2011-11-04 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc amaur...@gmail.com added the comment: It was a bug in Python compiler, thanks for the report! -- resolution: - fixed status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13343

[issue13345] Invisible Files in Windows 7

2011-11-04 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc amaur...@gmail.com added the comment: Does the file exist at all? Does it have some specific properties? a Hidden flag? -- nosy: +amaury.forgeotdarc ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13345

[issue13334] Erroneous Size check in _PyString_Resize

2011-11-03 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc amaur...@gmail.com added the comment: Let's take an example: on a 32bit system, call _PyString_Resize(s, 0x7ff8) Then PyStringObject_SIZE + newsize is something like -0x7ff8 (yes, it wraps around and is a negative number) But when cast to an unsigned size_t

[issue13335] Service application hang in python25.dll

2011-11-03 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc amaur...@gmail.com added the comment: This information is far too incomplete, but as a first step, did you check the memory usage of the process? Is the computer constantly swapping memory to disk? -- nosy: +amaury.forgeotdarc

[issue13334] Erroneous Size check in _PyString_Resize

2011-11-03 Thread Amaury Forgeot d'Arc
Changes by Amaury Forgeot d'Arc amaur...@gmail.com: -- status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13334 ___ ___ Python

[issue13337] IGNORE_CASE doctest option flag

2011-11-03 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc amaur...@gmail.com added the comment: Use case: nan values are printed as nan with typical Linux implementations, but as NaN on other operating systems like Solaris. Did you test with Python 2.7 or above? ITSM that repr(float(nan)) == nan consistently on all platforms

[issue12105] open() does not able to set flags, such as O_CLOEXEC

2011-11-01 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc amaur...@gmail.com added the comment: And to be explicit, you can now write: def open_cloexex(filename, mode='r'): return open(filename, mode, opener=lambda path, mod: os.open(path, mod|os.O_CLOEXEC

[issue12105] open() does not able to set flags, such as O_CLOEXEC

2011-11-01 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc amaur...@gmail.com added the comment: So why not to add 'e' character You said it: because it can't be written consistently on all platforms. For example, python does not use CreateFile on Windows, see #12939. -- ___ Python

[issue12939] Add new io.FileIO using the native Windows API

2011-11-01 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc amaur...@gmail.com added the comment: An implementation of RawIO with the win32 API can be useful (and I'd be interested to compare the performance) But maybe not for all usages: some Python interfaces are defined in terms of file descriptors, imp.load_module

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