[issue31443] Possibly out of date C extension documentation

2017-09-13 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: On Windows at least: I think "another C module" should be understood as "another DLL or executable". A user extension module is a different DLL from the core Python, so the advice is still valid. -- nosy:

[issue26750] Mock autospec does not work with subclasses of property()

2016-08-17 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: inspect.isdatadescriptor() is better indeed. (I was initially working on an old version of mock.py which does not import inspect, and I did not want to add the dependency there). - inspect uses hasattr(type(obj)) instead of hasatr(obj). This is better

[issue26750] Mock autospec does not work with subclasses of property()

2016-05-18 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: Updated patch with review comments. -- Added file: http://bugs.python.org/file42891/mock-descriptor-2.patch ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/i

[issue26750] Mock autospec does not work with subclasses of property()

2016-04-13 Thread Amaury Forgeot d'Arc
New submission from Amaury Forgeot d'Arc: When patching a class, mock.create_autospec() correctly detects properties and __slot__ attributes, but not subclasses of property() or other kinds of data descriptors. The attached patch detects all data descriptors and patch them the way

[issue26060] Class __dict__ iteration order changing due to type instance key-sharing

2016-01-12 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: Indeed. Here is another version of the script, it crashes when I set PYTHONHASHSEED=1 and passes with PYTHONHASHSEED=3:: class Meta(type): def __new__(meta, clsname, bases, methods): cls = super(Meta, meta).__new__(meta, clsname, bases

[issue24390] Python 3.4.3 64 bits is not high dpi aware

2015-06-09 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: The Python program itself has no UI and cannot be marked as DPI aware. Instead, applications should call the win32 function SetProcessDPIAwareness: https://msdn.microsoft.com/en-us/library/windows/desktop/dn302122 -- nosy: +amaury.forgeotdarc

[issue22681] Add support of KOI8-T encoding

2015-05-12 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: Looks good to me. -- nosy: +amaury.forgeotdarc ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22681

[issue22682] Add support of KZ1048 (RK1048) encoding

2015-05-12 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: Please go ahead! Or do you expect someone else to review the patch? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22682

[issue23275] Can assign [] = (), but not () = []

2015-04-22 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: About the patch: I'm sure there are other tests to change, in test_syntax.py for example:: It's a syntax error to assign to the empty tuple. Why isn't it an error to assign to the empty list? It will always raise some error at runtime

[issue23815] Segmentation fault when create _tkinter objects

2015-04-08 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: Probably a PyType_Ready() missing. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23815 ___ ___ Python

[issue23830] Add AF_IUCV support to sockets

2015-04-01 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: Hi, First, please fill and submit a Contribution Agreement: https://www.python.org/psf/contrib/ Then about the patch: - This is a patch against Python2.7, which is frozen for new developments. This change will only be applied to python 3.5 or later

[issue21526] Support new booleans in Tkinter

2015-03-31 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: Ah, the NULL case is indeed tested just above. So the current code works correctly. -- resolution: - fixed status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21526

[issue21526] Support new booleans in Tkinter

2015-03-31 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: I'm not sure that this change is correct. I have Tcl version 8.6 installed, and I checked that app-BooleanType is NULL. Fortunately value-typePtr is probably never NULL, but I think the comparison should be skipped in this case. Where did you see

[issue23720] __del__() order is broken since 3.4.0

2015-03-20 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/issue23720 ___ ___ Python-bugs-list

[issue23720] __del__() order is broken since 3.4.0

2015-03-20 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: Actually there *is* a cycle: assert a.vector is a.vector.device.__class__.__del__.__globals__['a'].vector A workaround is to not store objects with __del__ in module globals... Or have only one (the Main instance in your case) -- nosy

[issue23419] Faster default __reduce__ for classes without __init__

2015-03-19 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: But isn't the result different? NEWOBJ calls cls.__new__() and __init__ is skipped. REDUCE calls cls(): both __new__ and __init__ are used. -- nosy: +amaury.forgeotdarc ___ Python tracker rep...@bugs.python.org

[issue23419] Faster default __reduce__ for classes without __init__

2015-03-19 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: Sorry, I missed the important point: for classes without __init__ -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23419

[issue23643] Segmentation Fault with Large Simple Function

2015-03-12 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: So the recursion crash was fixed in python3, but it's still one of the limits of the Python AST compiler. I suggest to replace your long expression by a list: exprs = [(1-a36)*(a37)*(1-a41), (a22)*(a33)*(1-a23), ...] return sum(exprs

[issue23643] Segmentation Fault with Large Simple Function

2015-03-11 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: Probably a stack overflow, when the AST is too deep: eval(+1 * 748580) also crashed for me -- nosy: +amaury.forgeotdarc ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23643

[issue23590] Potential leak in PyFloat_AsDouble. Refcount error.

2015-03-05 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: Simple script to reproduce the issue: import sys, time class C(object): def __float__(self): return for x in range(1): try: time.sleep(C()) except TypeError: pass if x % 1000 == 0: print(sys.getrefcount()) -- nosy

[issue23438] HTMLParser doesn't know how to deal with 'ampersand'

2015-02-10 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: amp; is an entity reference. Either pass convert_charrefs=True to the constructor, or implement a method def handle_entityref(self, data) to receive them as events. https://docs.python.org/3.4/library/html.parser.html -- nosy

[issue21862] cProfile command-line should accept -m module_name as an alternative to script path

2015-01-23 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: This change will cause the module to be imported twice: progname = runpy.run_module(args[0])['__file__'] ... and then the runctx() call. What about something like: code = runpy.run_module(modname, run_name='__main__') globs = { 'runpy': runpy

[issue21862] cProfile command-line should accept -m module_name as an alternative to script path

2014-12-19 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: The patch does not seem to allow parameters after the -m option. I'm sure this restriction can be lifted. -- nosy: +amaury.forgeotdarc ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21862

[issue23020] New matmul operator crashes modules compiled with CPython3.4

2014-12-10 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: PEP384 is presented as a new way to write modules that can be loaded by multiple Python versions, specially on Windows. I could not find any place that says that modules not using the stable ABI need to be recompiled. I'm not against changing this rule

[issue23020] New matmul operator crashes modules compiled with CPython3.4

2014-12-09 Thread Amaury Forgeot d'Arc
New submission from Amaury Forgeot d'Arc: When an extension module is compiled with CPython3.4, the nb_matrix_multiply slot is not filled, and no memory is allocated for it. If the extension module is imported by CPython3.5, nb_matrix_multiply contains garbage and segfaults the interpreter

[issue23020] New matmul operator crashes modules compiled with CPython3.4

2014-12-09 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: Here is a test module that segfaults on Python3.5. It's derived from _testcapi, but it can be anything with a PyNumberMethods. I compiled with gcc -g -I path/to/cpython3.4/Include/ -I /path/to/cpython3.4 mytest.c -fPIC --shared -o mytest.so Then I

[issue23020] New matmul operator crashes modules compiled with CPython3.4

2014-12-09 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: Oh, has this ABI compatibility requirement changed from the 2.x series? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23020

[issue23020] New matmul operator crashes modules compiled with CPython3.4

2014-12-09 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: I would not mind the change, but I've always thought the opposite (except on Windows, where the string Python27.dll is stored in the .pyd) There are traces of this binary compatibility still today in the 3.4 headers: https://hg.python.org/cpython/file

[issue22999] Copying emoji to Windows clipboard corrupts string in Python 3.3 and up

2014-12-05 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: (you swapped the unicode values: \U0001f4cb is copied as \U0001f400) On Windows, strings have changed in 3.3. See in https://docs.python.org/3/whatsnew/3.3.html, len() now always returns 1 for non-BMP characters. The call to GlobalAlloc should use

[issue22999] Copying emoji to Windows clipboard corrupts string in Python 3.3 and up

2014-12-05 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: Better use utf-16-le encoding: len(data.encode('utf-16-le')) + 2 otherwise the encoded bytes start with the \fffe BOM. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22999

[issue22982] BOM incorrectly inserted before writing, after seeking in text file

2014-12-02 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: issue5006 was supposed to take care of this, but it has a flaw IMO: This statement https://hg.python.org/cpython/file/0744ceb5c0ed/Lib/_pyio.py#l2003 is missing an and whence!=2. -- nosy: +amaury.forgeotdarc

[issue22961] ctypes.WinError OSError

2014-11-28 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: No, OSError.errno is converted from the Windows error code. There is a translation map (see PC/errmap.h, built with the _dosmaperr() function) and the default value is EINVAL. It's working as intended. What was the winerror code? do you think it should

[issue4887] environment inspection and manipulation API is buggy, inconsistent with Python philosophy for wrapping native APIs

2014-11-26 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: Agreed. environ.pop() was fixed a long time ago with issue1287. It seems that all mutable methods of the environ pseudo-dict are now correctly reflected to the platform environ. The other direction (updates from C code should be reflected in os.environ

[issue19676] Add the namereplace error handler

2014-11-25 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: The patch looks good to me. But it seems that the reverse operation is not possible in the general case: .decode('unicode_escape') assumes a latin-1 or ascii encoding. Should we document this? -- nosy: +amaury.forgeotdarc

[issue1962] ctypes feature request: Automatic type conversion of input arguments to C functions

2014-11-24 Thread Amaury Forgeot d'Arc
Changes by Amaury Forgeot d'Arc amaur...@gmail.com: -- resolution: - works for me status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1962

[issue7255] Default word boundaries for Unicode data?

2014-11-24 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: Closing this old issue: either use the 'regex' module, or wait for issue2636. -- nosy: +amaury.forgeotdarc resolution: - works for me status: open - closed ___ Python tracker rep...@bugs.python.org http

[issue22600] In Multiprocessing Queue() doesn't work with list : __.put(list) != __.get()

2014-11-13 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: solution.put(c) takes a *reference* to the list c. And then the test() function continues running! By the time the list is serialized and sent back to the main process (in another thread), the test() function has already changed it... As you noticed

[issue22804] Can't run Idle in Windows 8 or windows 64

2014-11-06 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: You can try to run IDLE from a command prompt. Type the command: path_to_python34.exe -m idlelib and look at error messages. -- nosy: +amaury.forgeotdarc ___ Python tracker rep...@bugs.python.org http

[issue22790] __qualname__ missing from dir(__class__) during class initialisation

2014-11-04 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: Why did you specify during class initialization only? When I print dir(Foo.Bar) at top-level, there is no __qualname__. Then, note that '__name__' is not listed either, so it's not about new attributes. It was chosen that dir(someClass) tries to list

[issue22790] some class attributes missing from dir(Class)

2014-11-04 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: So, dir(C) contains '__mro__', but not 'mro'? I'm -1 on the change. From https://docs.python.org/3.4/library/functions.html#dir : Note Because dir() is supplied primarily as a convenience for use at an interactive prompt, it tries to supply

[issue22682] Add support of KZ1048 (RK1048) encoding

2014-10-30 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: Looks good to me. I checked that there are only 16 differences between cp1251 and kz1048, and that the two standards define the same mapping. -- nosy: +amaury.forgeotdarc ___ Python tracker rep

[issue22746] cgitb html: wrong encoding for utf-8

2014-10-28 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: What about open(..., encoding='latin-1', errors='xmlcharrefreplace') -- nosy: +amaury.forgeotdarc stage: resolved - needs patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22746

[issue22746] cgitb html: wrong encoding for utf-8

2014-10-28 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: You need to use codecs.open instead of open No, why? in python3 open() supports the errors handler. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22746

[issue22721] pprint output for sets and dicts is not stable

2014-10-28 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: What if [some flavor of] pprint sorted items not by value, but by their repr() string? It's probably faster than any other algorithm, and guaranteed to produce consistent results. Or use this idea only for ambiguous cases? -- nosy

[issue22745] cgitb with Py3: TypeError: 'str' does not support the buffer interface

2014-10-27 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: html is text, so the file mode should be 'w'. But I don't reproduce the behavior with Python version v3.4.2. Which version are you using exactly? -- nosy: +amaury.forgeotdarc ___ Python tracker rep

[issue20485] Enable 'import Non-ASCII.pyd'

2014-02-02 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: I'd use a much simpler encoding. Maybe something like name.encode('unicode-escape').replace(b'\\', b'_') As you said, simplicity is important for tools which generate code! -- nosy: +amaury.forgeotdarc

[issue19973] Deprecate pyio

2013-12-13 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: PyPy also has a C-translated version of the io module. It's a bit faster I think, but more importantly it has correct behavior with signals and other asynchronous errors. _pyio.py can be stopped in the middle of any function, and is not completely

[issue19423] permutations len issue

2013-10-28 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: permutations() returns a generator. If you consume it with list(), the second time will return the empty list. Use list(permutations(...)) if you plan to use the result multiple times. -- nosy: +amaury.forgeotdarc resolution: - invalid status

[issue1540] Refleak tests: test_doctest and test_gc are failing

2013-10-21 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: Is the error still current? io.StringIO is now completely implemented in _io/textio.c, and should not have any Python-level __del__. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org

[issue19272] Can't pickle lambda (while named functions are ok)

2013-10-16 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: Functions are pickled by name, not by code. Unpickling will only work if a function with the same name is present in in the same module (__main__ in your example) This is why pickling a lambda won't work: they have no individual names. -- nosy

[issue19089] Windows: Broken Ctrl-D shortcut on Python 3

2013-09-25 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: It never worked for me. Are you using a custom shell or cygwin or something? -- nosy: +amaury.forgeotdarc ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19089

[issue19088] TypeError with pickle in embedded python3.3 when starting multiple Interpreters.

2013-09-25 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: The NoneType that fails is in typeobject.c: _PyObject_CallMethodId(copyreg, PyId__slotnames, O, cls); The error here is that copyreg comes from a cached reference to the module, stored in a static variable (cached_copyreg_module). When

[issue19048] itertools.tee doesn't have a __sizeof__ method

2013-09-19 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: I like the definition of __sizeof__ that was discussed some time ago: http://bugs.python.org/issue14520#msg157798 With that definition (do we have it somewhere in the docs, by the way?) The current code works gives the correct answer. -- nosy

[issue19048] itertools.tee doesn't have a __sizeof__ method

2013-09-19 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: getsizeof() is interesting only if it gives sensible results when used correctly, especially if you want to sum these values and get a global memory usage. One usage is to traverse objects through gc.get_referents(); in this case the definition above

[issue17797] Visual C++ 11.0 reports fileno(stdin) == 0 for non-console program

2013-09-12 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: 2. _PyVerify_fd(fd) is always true. Given the current definition: #define _PyVerify_fd(fd) (_get_osfhandle(fd) = 0) for those values of fd _get_osfhandle(fd) = 0, always. Hum, are you sure this is the selected implementation? - this code is only in 2.7

[issue18913] ssl._ssl._test_decode_cert seems to leak memory with certain certificates in Python 2.6

2013-09-03 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: To ensure it's a real memory leak: do the figures increase when the code is called in a loop? I would not consider a single-time malloc (stored in some static variable) to be a leak. -- nosy: +amaury.forgeotdarc

[issue18913] ssl._ssl._test_decode_cert seems to leak memory with certain certificates in Python 2.6

2013-09-03 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: http://hg.python.org/cpython/rev/c4bbda2d4c49 looks relevant. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18913

[issue18913] ssl._ssl._test_decode_cert seems to leak memory with certain certificates in Python 2.6

2013-09-03 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: Ah, http://hg.python.org/cpython/rev/80d491aaeed2/ as well then. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18913

[issue14597] Cannot unload dll in ctypes until script exits

2013-08-29 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: Did you consider creating a copy with a random suffix? -- nosy: +amaury.forgeotdarc ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14597

[issue18874] Add a new tracemalloc module to trace memory allocations

2013-08-29 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: Is it really impossible to use a standard Python dict instead of cfuhash? -- nosy: +amaury.forgeotdarc ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18874

[issue18843] Py_FatalError (msg=0x7f0e3b373232 bad leading pad byte) at Python-2.7.5/Python/pythonrun.c:1689

2013-08-26 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: This is a memory corruption. Please look at the memory before the freed address (0x449e6900), maybe there is an indication of some buffer overflow? -- nosy: +amaury.forgeotdarc ___ Python tracker rep

[issue16396] Importing ctypes.wintypes on Linux gives a traceback

2013-08-19 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: I think it's the opposite: when Unix support was added to ctypes, 'import ctypes.wintypes' was not considered. By that logic, the patch is a new feature. IMO historical arguments are moot :-) I agree with the conclusion tough: the patch will not break

[issue18535] termios.tcgetattr should return namedtuple

2013-07-24 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: You need a better use case though. termios awful constant names ('TIOCGWINSZ') and values ('\x1b') won't become more easy with a nametuple. -- resolution: - works for me status: open - closed ___ Python

[issue18535] termios.tcgetattr should return namedtuple

2013-07-23 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: namedtuple has a _replace method, but I agree that it would be an incompatible change. namedlist someone? class tcattributes(object): __slots__ = ['iflag', 'oflag', 'cflag', 'lflag', 'ispeed', 'ospeed', 'cc'] def __new__(cls, values

[issue18488] sqlite: finalize() method of user function may be called with an exception set if a call to step() method failed

2013-07-19 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: +1 for PyException_SetContext or similar. The C code should behave like a finally: x.finalize(). -- nosy: +amaury.forgeotdarc ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18488

[issue18474] Lambda assigned to object does not automatically get self

2013-07-16 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: This is expected. When you assign to n.__div__ a function which takes two parameters, you have to call it with two parameters: aFunction = lambda x, y: (x, y) n.__div__ = aFunction aFunction(1, 2) n.__div__(1, 2) After all, aFunction

[issue18426] Crash when extension does not use PyModule_Create()

2013-07-11 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: I'm not sure the fix is correct: PyModule_GetDef() can return NULL without setting an error, for example when the init function returns a regular Python module. I'm OK to require the init function to return a module created with PyModule_Create

[issue18426] Crash when extension does not use PyModule_Create()

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

[issue18426] Crash when extension does not use PyModule_Create()

2013-07-11 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: I was thinking of a message similar to the one above. The eventual exception set by PyModule_GetDef(m) is less explicit. if (def == NULL) { PyErr_Format(PyExc_SystemError, initialization of %s did not return an extension module

[issue18426] Crash when extension does not use PyModule_Create()

2013-07-11 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: Returning another kind of module can be dangerous here, because extension modules are handled specially (see _PyImport_FixupExtensionObject), and it's not obvious what this does to normal modules. But I agree that _imp.load_dynamic() could be extended

[issue18359] pickle fail to handle some class with __new__

2013-07-04 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: This is expected, your class must say how this __new__ constructor can be called. http://docs.python.org/2/library/pickle.html#object.__getnewargs__ -- nosy: +amaury.forgeotdarc resolution: - works for me status: open - closed

[issue18350] Python 3 unittest framework broken?

2013-07-03 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: wxPython tests override unittest.TextTestRunner: self.stream = unittest.runner._WritelnDecorator(BytesIO()) Using bytes is wrong. Output stream should be a text file. -- nosy: +amaury.forgeotdarc resolution: - invalid status: open - closed

[issue18350] Python 3 unittest framework broken?

2013-07-03 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: This is an issue with wxPython, please report this issue to the wxPython team. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18350

[issue18350] Python 3 unittest framework broken?

2013-07-03 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: Sorry, this bug tracker is for core Python only. Please discuss this issue on wxPython-dev mailing list. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18350

[issue18327] swapped arguments in compatible_for_assignment()?

2013-07-01 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: Fortunately, compatible_for_assignment() handles both arguments exactly the same way, except maybe in error messages. -- nosy: +amaury.forgeotdarc ___ Python tracker rep...@bugs.python.org http

[issue18287] PyType_Ready() should sanity-check the tp_name field

2013-06-28 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: The patch is not complete: PyType_Ready() returns -1 but no no exception is set. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18287

[issue18287] PyType_Ready() should sanity-check the tp_name field

2013-06-28 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: Since this error can occur only during the development of a C extension, I would not worry too much. The traceback will already indicate the imported module, this is much better than a segfault later in pydoc

[issue18298] pythonw.exe fails with redirected stderr

2013-06-26 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: RPython... let's be serious. The code of pythonw.exe is very simple, see PC/WinMain.c. No, pythonw.exe is not meant to suppresses the terminal window on startup. This is only a consequence of being a windows application. There is a lot of documentation

[issue18298] pythonw.exe fails with redirected stderr

2013-06-25 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: Yes, in pythonw.exe the C stderr is not really usable, and this leads to unpredictable results. It's difficult to fix in python2 though; python3 has fixed this issue, but in a way that cannot be backported. Some workarounds: - don't use pythonw.exe

[issue18298] pythonw.exe fails with redirected stderr

2013-06-25 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: The proper solution if you use pythonw.exe is to define sys.stdout/sys.stderr yourself in pythonw.exe:: sys.stdout = open('c:/temp/output.txt', 'w') IOW, do the redirect from inside the program, don't rely on the shell which (by design?) does

[issue17630] Create a pure Python zipfile importer

2013-06-21 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: Times in a ZIP files have a two-seconds resolution (in the old DOS FAT format: 5 bits for the hours, 6 bits for the minutes, and only 5 bits left for the seconds) Some fuziness logic is needed when comparing against a time_t. -- nosy

[issue18276] posixpath.c:_fd_converter() should use PyObject_AsFileDescriptor()

2013-06-21 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: Do we want the low-level os.write() to work with file objects, or sockets? -- nosy: +amaury.forgeotdarc ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18276

[issue18276] posixpath.c:_fd_converter() should use PyObject_AsFileDescriptor()

2013-06-21 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: Let's unify os' and select's behavior! OK, let's do that on Windows first :-) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18276

[issue18270] AttributeError: 'NoneType' object has no attribute 'interp'

2013-06-20 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: PyShell.py, line 1541: if shell and cmd or script: Does it need parentheses? if shell and (cmd or script): -- nosy: +amaury.forgeotdarc ___ Python tracker rep...@bugs.python.org http://bugs.python.org

[issue1159] os.getenv() not updated after external module uses C putenv()

2013-06-19 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: FYI, PyPy recently got bitten by this: https://bugs.pypy.org/issue1518 A posix.libc_getenv() function could be a solution. -- nosy: +amaury.forgeotdarc ___ Python tracker rep...@bugs.python.org http

[issue18264] enum.IntEnum is not compatible with JSON serialisation

2013-06-19 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: in encoder.py: ... elif instance(value, int): yield buf + str(value) ... What if we use int(str(value)) instead? -- nosy: +amaury.forgeotdarc ___ Python tracker rep...@bugs.python.org http

[issue18248] fficonfig.py.in wrong for AIX

2013-06-18 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: LGTM. I checked in Makefile.am, and the list of platform-specific files is the same. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18248

[issue18225] ctypes Structure data size is incorrect

2013-06-17 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: You can also use _pack_ = 1 to override the default alignment rules: http://docs.python.org/3/library/ctypes.html#ctypes.Structure._pack_ -- nosy: +amaury.forgeotdarc ___ Python tracker rep...@bugs.python.org

[issue18208] Wrong bytecode generated for 'in' operation

2013-06-14 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: This is one case of chained comparisons: http://docs.python.org/3/reference/expressions.html#not-in x = y = z is equivalent to (x = y) and (y = z) x in y == z is equivalent to (x in y) and (y == z) There is a jump if the 'in' expression is false, because

[issue18210] Problem creating extension in python3.3 with mingw32

2013-06-14 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: Python3 has a new API to create modules: PyModule_Create() and PyModuleDef. See also: http://docs.python.org/3/howto/cporting.html?highlight=pymodule_create#module-initialization-and-state -- nosy: +amaury.forgeotdarc resolution: - invalid

[issue15315] Can't build Python extension with mingw32 on Windows

2013-06-14 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: Aditya, python3 changed the API to create modules. See issue18210. -- nosy: +amaury.forgeotdarc ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15315

[issue17860] subprocess docs lack info how to use output result

2013-06-13 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: Surely there are already good places to help with 2-3 transition? The Library Reference is not such a place. -- nosy: +amaury.forgeotdarc ___ Python tracker rep...@bugs.python.org http://bugs.python.org

[issue515074] Extended storage in new-style classes

2013-06-12 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: Most concrete variable-sized types don't use tp_basicsize to know where the data lives. For example, PyBytesObject has a char ob_sval[1]; member, and PyBytes_AsString() looks at this fixed offset. For this reason, additional data cannot be stored before

[issue3329] API for setting the memory allocator used by Python

2013-06-11 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: I prefer the new version without PYMEM_TRACE_MALLOC :-) Can we rename API and api_id to something more specific? maybe DOMAIN and domain_id? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org

[issue18181] super vs. someclass.__getattribute__

2013-06-11 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: Is it possible to avoid a new slot? for example, super() could walk the tp_base- chain and call tp_getattro each time the value changes. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org

[issue18178] Redefinition of malloc(3) family of functions at build time

2013-06-10 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: Said simpler: dlmalloc.c code is indeed compiled twice: - once as part of closures.c, which #include dlmalloc.c; this is done carefully (with 'static' and 'USE_DL_PREFIX') to not clash with standard malloc functions. - once as a separate target; without

[issue18181] super vs. someclass.__getattribute__

2013-06-10 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: Do you have an example in pure Python code? -- nosy: +amaury.forgeotdarc ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18181

[issue18183] Calling .lower() on certain unicode string raises SystemError

2013-06-10 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: a = chr(0x84b2e)+chr(0x109710) a.lower() SystemError: invalid maximum character passed to PyUnicode_New The MAX_MAXCHAR() macro only works for 'maxchar' values, like 0xff, 0x... in do_upper_or_lower() it's used with arbitrary UCS4 values

[issue18181] super vs. someclass.__getattribute__

2013-06-10 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: issue783528 was a bit similar. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18181 ___ ___ Python-bugs

[issue17206] Py_XDECREF() expands its argument multiple times

2013-06-04 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: Hum, a stack overflow? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17206 ___ ___ Python-bugs-list

  1   2   3   4   5   6   7   8   9   10   >