[issue16713] tel URIs should support params

2012-12-18 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: I don't know whether 'tel' is a common scheme, but it's easy to add it to urlparse from the outside: urlparse.uses_param.append('tel') urlparse.urlparse('tel:7042;phone-context=example.com') ParseResult(scheme='tel', netloc='', path='7042', params

[issue16656] os.listdir() returns unusable bytes result on Windows

2012-12-15 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: Anatoly, - in Python2.7, try this: print repr(os.listdir(u'.')) - in Python3, try this: print(ascii(os.listdir('.'))) Do the commands above work correctly? -- ___ Python tracker rep...@bugs.python.org

[issue16656] os.walk ignores international dirs on Windows

2012-12-13 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: Anatoly, please file another issue for the 21 mess. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16656

[issue16656] os.walk ignores international dirs on Windows

2012-12-12 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: So, it seems that os.walk() and os.listdir() work correctly with Python3.3, but print(u'Русское имя') fails because the terminal encoding is cp437. See issue1602 for the print issue. As a quick workaround, try to set PYTHONIOENCODING=cp437

[issue16651] Find out what stdlib modules lack a pure Python implementation

2012-12-11 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: What's the purpose of these alternate implementations? For education, experiments? As a replacement for other VMs? Other modules that could be considered: marshal operator unicodedata -- ___ Python tracker

[issue16656] os.walk ignores international dirs on Windows

2012-12-11 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: - Do you have a full traceback of the failing os.walk() in Python3.3? - What's the result of os.listdir(u'.') ? -- nosy: +amaury.forgeotdarc status: pending - open ___ Python tracker rep...@bugs.python.org http

[issue16602] weakref can return an object with 0 refcount

2012-12-10 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: PyWeakref_GET_OBJECT is also potentially dangerous: since the refcount is not incremented, it's very possible that the GC collects it. The only safe operation after PyWeakref_GET_OBJECT is to Py_XINCREF the result. Should we provide

[issue16651] Find out what stdlib modules lack a pure Python implementation

2012-12-10 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: PyPy has a pure Python implementation of sqlite (using ctypes): https://bitbucket.org/pypy/pypy/src/default/lib_pypy/_sqlite3.py It most probably works on CPython as well. Does it belong to this list? -- nosy: +amaury.forgeotdarc

[issue16658] Missing return in HTTPConnection.send()

2012-12-10 Thread Amaury Forgeot d'Arc
New submission from Amaury Forgeot d'Arc: HTTPConnection.send() accepts a bytes string, a file, and any iterable. When a file is passed, data is read in blocks until read() returns an empty string. But because a return statement is missing, execution continues with an attempt to iterate

[issue16617] mimetypes.py UnicodeDecodeError: 'ascii' codec can't decode byte 0xe0 in position 0: ordinal not in range(128)

2012-12-05 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: This is a duplicate of issue9291. -- nosy: +amaury.forgeotdarc resolution: - duplicate status: open - closed superseder: - mimetypes initialization fails on Windows because of non-Latin characters in registry

[issue16577] Suspect test.test_codeccallbacks.test_mutatingdecodehandler

2012-11-29 Thread Amaury Forgeot d'Arc
New submission from Amaury Forgeot d'Arc: The test created by 504084c04ac0 passes for bad reasons, at least for the second part: - test.mutating error handler is never used. - If I replace the last line of the test, it still passes, but the TypeError is raised by exc.object[:] = b (bytes

[issue16579] .pyw disturb multiprocessing behavior

2012-11-29 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: Unless you give more information, this is unlikely to be a bug in Python. - Is your program running with Python 2? - When it runs as a .py file, does it print to the console? If both answers are yes, keep in mind that there is no console with a .pyw file

[issue16567] Implementing .= for variable operator

2012-11-28 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: Please submit this kind of ideas to the python-ideas mailing list, to trigger a discussion and get valuable feedback: http://www.python.org/community/lists/#python-ideas-mailing-list -- nosy: +amaury.forgeotdarc resolution: - invalid status

[issue16566] Structure._anonymous_ should not allow strings

2012-11-28 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: OTOH, __slots__ also allows a single string, but it is silently converted to a 1-tuple: class C: __slots__ = 'abc' assert 'abc' in C.__dict__ -- nosy: +amaury.forgeotdarc status: pending - open ___ Python

[issue16565] Increase Py_AddPendingCall array size

2012-11-28 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: This array would still have a fixed size. Could you arrange your code so that you enqueue pending calls elsewhere, and call Py_AddPendingCall only once until the pending items have been processed? -- nosy: +amaury.forgeotdarc

[issue16539] Turn off 'No handlers could be found for logger' message

2012-11-23 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: Python 3 has exactly the same documentation: http://docs.python.org/3.3/howto/logging.html#configuring-logging-for-a-library -- nosy: +amaury.forgeotdarc resolution: wont fix - works for me status: languishing - closed

Re: [issue16500] Add an 'afterfork' module

2012-11-20 Thread Amaury Forgeot d'Arc
to implement. -- Amaury Forgeot d'Arc ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

[issue16500] Add an 'afterfork' module

2012-11-20 Thread Amaury Forgeot d'Arc
Changes by Amaury Forgeot d'Arc amaur...@gmail.com: -- nosy: +amaury.forgeotdarc -Amaury.Forgeot.d'Arc ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16500

[issue16500] Add an 'afterfork' module

2012-11-20 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: PyPy doesn't handle exceptions in hooks. Is there a reason why PyPy goes for the simplistic approach? Probably because nobody thought about it. At the moment, there is only one 'before', one 'parent' hook (so the FILO order is simple), and three 'child

[issue16467] frozen importlib required for extending Python interpreter not public

2012-11-13 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: I tried to remove all references to #include importlib.h and _Py_M__importlib, and added the lines in _AddBaseModules(): self.AddAlias(_frozen_importlib, importlib._bootstrap) self.IncludeModule(_frozen_importlib) Even if it's not optimal

[issue16447] SEGFAULT when setting type.__name__

2012-11-09 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: - For the replacement with NULL, Py_CLEAR() should be used instead. - We should use a macro (Py_REF_ASSIGN?) for the replacement case. - Careful, in Modules/_json.c the code is wrong because tmp is already used:: PyObject *tmp

[issue16445] SEGFAULT when deleting Exception.message

2012-11-08 Thread Amaury Forgeot d'Arc
New submission from Amaury Forgeot d'Arc: The script below segfaults cpython2.7. The cause is in BaseException_set_message(), which calls Py_XDECREF(self-message) and thus can call back into Python code with a dangling PyObject* pointer. Py_CLEAR should be used instead. class Nasty(str

[issue16447] SEGFAULT when setting type.__name__

2012-11-08 Thread Amaury Forgeot d'Arc
New submission from Amaury Forgeot d'Arc: Following script crashes all versions of Python. Cause is the Py_DECREF(et-ht_name) in type_set_name(). class Nasty(str): def __del__(self): C.__name__ = other class C(object): pass C.__name__ = Nasty(abc) C.__name__ = normal

[issue16431] CDecimal disregards subclass passed into __new__ when value argument is an instance of Decimal

2012-11-07 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: Py_INCREF(v); return v; should be used only for immutable types, not for subclasses. in 3.2, the code below prints 3, None: import decimal class MyDecimal(decimal.Decimal): x = None def __new__(cls, value): return super().__new__(cls

[issue16421] importlib.machinery.ExtensionFileLoader cannot load several modules from the same shared object

2012-11-06 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: It's not that crazy, if you consider that all builtin modules are stored in python33.dll. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16421

[issue16268] dir(closure) does not find __dir__

2012-10-30 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: The same fix, but with a unit test. Note that object.__dir__ did not exist in previous versions, but I found a similar failure with __format__, which also applies to 2.7. -- nosy: +amaury.forgeotdarc Added file: http://bugs.python.org/file27801

[issue16268] dir(closure) does not find __dir__

2012-10-30 Thread Amaury Forgeot d'Arc
Changes by Amaury Forgeot d'Arc amaur...@gmail.com: -- stage: - patch review ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16268 ___ ___ Python

[issue16322] time.tzname on Python 3.3.0 for Windows is decoded by wrong encoding

2012-10-25 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: Looking at the CRT source code, tznames should be decoded with mbcs. See also http://mail.python.org/pipermail/python-3000/2007-August/009290.html -- nosy: +amaury.forgeotdarc ___ Python tracker rep

[issue16305] possible segfault in math.factorial

2012-10-23 Thread Amaury Forgeot d'Arc
New submission from Amaury Forgeot d'Arc: import math, sys math.factorial(sys.maxsize - 1) (Hit Ctrl-C) Segmentation fault The cause is probably in mathmodule.c::factorial_odd_part(): error: Py_DECREF(outer); done: Py_DECREF(inner); return outer; In case of error, the function

[issue9011] ast_for_factor unary minus optimization changes AST

2012-10-18 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: Indeed, -1j is not a literal: dis.dis(lambda :-1j.real) 1 0 LOAD_CONST 0 (1j) 3 LOAD_ATTR0 (real) 6 UNARY_NEGATIVE 7 RETURN_VALUE -- nosy

[issue16151] Deferred KeyboardInterrupt in interactive mode

2012-10-16 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: My Python interpreter does not have auto-completion. Do you import something special at startup? -- nosy: +amaury.forgeotdarc ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16151

[issue5476] datetime: timedelta(minutes = i) silently fails with numpy.int32 input

2012-10-16 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: From the macro posted earlier: Py##child##ArrType_Type.tp_base = Py##parent2##ArrType_Type; tp_base is *not* PyInt_Type, so I was wrong when I said that the dominant base was int. This is wrong IMO: tp_base should be int, for the type to be correctly

[issue16194] imp.load_dynamic imports wrong module when called several times on a multi-module .so

2012-10-16 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: To prevent initializing an extension module more than once, we keep a static dictionary 'extensions' keyed by module name (for built-in modules) or by filename (for dynamically loaded modules), containing these modules. So there can be only one

[issue10836] regression: TypeError during exception handling in urllib.request.urlretrieve

2012-10-15 Thread Amaury Forgeot d'Arc
Changes by Amaury Forgeot d'Arc amaur...@gmail.com: -- keywords: +easy ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10836 ___ ___ Python-bugs

[issue15721] PEP 3121, 384 Refactoring applied to tkinter module

2012-10-15 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: Andrew, I have questions about the following part of commit bf9d118779f5: + PyTclObject_Type_slots[3].pfunc = PyObject_GenericGetAttr; First, the 3 refers to the position of Py_tp_getattro in the array, which is a fragile thing IMO. Then, this hack

[issue16231] pickle persistent_id return value

2012-10-15 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: An easy workaround (and probably the preferred method) it to return a (tag, index) tuple, like the example in http://docs.python.org/release/3.2/library/pickle.html#pickle-persistent Testing for the None value introduces a slight incompatibility, so IMO

[issue16119] Python 2.7 _socket DLL import error on Windows Vista

2012-10-09 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: Note: the error message above is mojibake (cp1253-encoded message written to a cp737 console) for: Δεν ήταν δυνατό να εντοπιστεί η καθορισμένη μονάδα (The specified module could not be found) Spiros, you closed the issue. How did you fix it exactly

[issue15956] backreference to named group does not work

2012-09-18 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: And why isn't \ggroupname part of the pattern language, anyway, or at least some way to refer to a match made in a previous *named* group? But this way exists: (?P=startquote) is what you want. To me \g is an exception, and frankly I did not know

[issue15956] backreference to named group does not work

2012-09-18 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: Thanks for the patch! The new formulation looks much better, but I'll let a native speaker have another check. Some comments: I preferred the previous example id because it's not obvious what \042\047 is. And a bullet list would be less heavyweight IMO

[issue15956] backreference to named group does not work

2012-09-18 Thread Amaury Forgeot d'Arc
Changes by Amaury Forgeot d'Arc amaur...@gmail.com: -- assignee: - docs@python nosy: +docs@python stage: committed/rejected - patch review ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15956

[issue15956] backreference to named group does not work

2012-09-17 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: \g is meant to be used in re.sub(), in the replacement text (see the docs); in the search pattern, (?P=startquote) can be used to refer to a named group. The docs of (?Pname...) looks clear to me. -- nosy: +amaury.forgeotdarc resolution

[issue15923] Building from a fresh clone breaks on Parser/asdl_c.py

2012-09-12 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: It's most probably related to issue15801: if 'name' is an instance of Python-defined class, then it was considered as a mapping... -- nosy: +amaury.forgeotdarc ___ Python tracker rep...@bugs.python.org http

[issue15904] file,close() can fail assert on Windows in 2.7

2012-09-10 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: Is it also the case for other file operations? Here is a list that may use a closed FILE object: f.write('something') f.read(1) print f, 'something' f.seek(0) f.tell() f.truncate(0) f.flush() f.isatty() f.readlines

[issue15903] Make rawiobase_read() read directly to bytes object

2012-09-10 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: It works as along as the bytes object cannot leak to Python code, (imagine a custom readinto() method which plays with gc.get_referrers, then calls hash(b)...) This is OK with this patch. -- nosy: +amaury.forgeotdarc

[issue15877] xml.dom.minidom cannot parse ISO-2022-JP

2012-09-07 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: This is similar to issue13612: pyexpat does not support multibytes encodings. -- nosy: +amaury.forgeotdarc ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15877

[issue15879] set.__or__, __and__, etc create subclass types, but ignore __new__

2012-09-07 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: This was already fixed (in the 3.x releases) by issue1721812. -- nosy: +amaury.forgeotdarc resolution: - out of date status: open - closed superseder: - A subclass of set doesn't always have __init__ called

[issue15775] Add StopParser() to expat

2012-09-06 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: Your first point is true, even if the Python zen (try import this) states that Errors should never pass silently. For your second point: exceptions are a common thing in Python code. This is similar to the EAFP principle http://docs.python.org

[issue15870] PyType_FromSpec should take metaclass as an argument

2012-09-06 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: The patch is a bit light: see how type_new also computes the metaclass from the base classes. -- nosy: +amaury.forgeotdarc ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15870

[issue15775] Add StopParser() to expat

2012-09-05 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: Below is a sample script that shows that it's possible to stop parsing XML in the middle, without an explicit call to XML_StopParser(): raise StopParsing from any handler, and catch it around the Parse() call. This method covers the two proposed use

[issue15535] Fix pickling efficiency of named tuples in 2.7.3

2012-09-05 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: Adding def __getstate__(self): return None to the namedtuple template fixes the issue. Here is a patch with test. -- nosy: +amaury.forgeotdarc Added file: http://bugs.python.org/file27131/namedtuple-pickle.diff

[issue15811] ElementTree.write() raises TypeError when xml_declaration = True and encoding is a unicode string

2012-08-29 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: Why is it a problem? Encoding must be a text string: encoding='utf-8' works with both Python 2 and 3. Or if you used from __future__ import unicode_literals, str('utf-8') works as well. -- nosy: +amaury.forgeotdarc

[issue15775] Add StopParser() to expat

2012-08-27 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: If a handler function raises an exception, the Parse() method exits and the exception is propagated; internally, this also calls XML_StopParser(). Why would one call XML_StopParser() explicitely? -- nosy: +amaury.forgeotdarc

[issue15753] No-argument super in method with variable arguments raises SystemError

2012-08-24 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: The failing assertion is the assert(PyTuple_Check(obj)) added by your patch. At this point, obj is not the arguments tuple, but the first entry in f-f_localsplus. Maybe this block should be moved a bit earlier? -- nosy: +amaury.forgeotdarc

[issue15637] Segfault reading null VMA (works fine in python 2.x)

2012-08-21 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: The example script has two errors IMO: - XOpenDisplay accepts a char*, but display_url is certainly a unicode string; it should be converted to a bytes string:: xlib.XOpenDisplay(display_url.encode('utf-8')) - XOpenDisplay.restype is not set, so

[issue5765] stack overflow evaluating eval(() * 30000)

2012-08-19 Thread Amaury Forgeot d'Arc
Changes by Amaury Forgeot d'Arc amaur...@gmail.com: Added file: http://bugs.python.org/file26903/compiler_recursion_limit_check-2.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5765

[issue5765] stack overflow evaluating eval(() * 30000)

2012-08-19 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: The patch is incomplete: the VISIT macro contains a return 0; and in this case st-recursion_depth is not decremented. OTOH errors are never caught, so it's not necessary to do any cleanup in case of errors. Here is a simplified patch

[issue15425] Another strange Tracebacks with importlib

2012-07-29 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: I like the concept of exit points that Antoine introduced with a special method name. Maybe we coule generalize this and have a execute_and_hide_frames(func, *args, **kwargs) that is recognized by the caller in import.c

[issue15466] Python/importlib.h is different on 32bit and 64bit

2012-07-28 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc amaur...@gmail.com added the comment: Here is a patch that write TYPE_INT64 on most platforms (where either long or long long is 64bit). It is admittedly much larger than Martin's... -- Added file: http://bugs.python.org/file26554/marshal_use_int64.patch

[issue15466] Python/importlib.h is different on 32bit and 64bit

2012-07-28 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc amaur...@gmail.com added the comment: Are there really platforms which don't use two's complement? (If there are, I'm not sure to want to share binary data with them. Same for EBCDIC) -- ___ Python tracker rep...@bugs.python.org

[issue15425] Another strange Tracebacks with importlib

2012-07-28 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: IMO we should not ship 3.3 without a fix for this. -- priority: normal - high ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15425

[issue15466] Python/importlib.h is different on 32bit and 64bit

2012-07-28 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: Removing TYPE_INT64 was indeed the most reasonable choice. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15466

[issue15431] Cannot build importlib.h on Windows

2012-07-28 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: Comments about PyImport_FrozenModules linkage have not been addressed. Now the build is failing on all Unix machines... -- status: closed - open ___ Python tracker rep...@bugs.python.org http

[issue14578] importlib doesn't check Windows registry for paths

2012-07-27 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc amaur...@gmail.com added the comment: So I tried to make proper changes in _bootstrap.py, and regenerate importlib.h on Linux. I don't have any Windows machine; all this is completely untested, but at least it can help some Windows developer to finish the work, and write

[issue14578] importlib doesn't check Windows registry for paths

2012-07-27 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc amaur...@gmail.com added the comment: pywin32 used to install modules this way, but it seems it doesn't anymore: http://pywin32.hg.sourceforge.net/hgweb/pywin32/pywin32/file/16707e6f1624/pywin32_postinstall.py#l307 # It is possible people with old versions installed

[issue15466] Python/importlib.h is different on 32bit and 64bit

2012-07-27 Thread Amaury Forgeot d'Arc
New submission from Amaury Forgeot d'Arc amaur...@gmail.com: As shown in a patch in issue15431, frozen.c does not output the same data on different platforms. The first difference looks like this (extracted from the patch): -101,73,255,255,255,255,0,0,0,0,40,10,0,0,0,117

[issue15431] Cannot build importlib.h on Windows

2012-07-27 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc amaur...@gmail.com added the comment: IMO dependencies is not a big issue here. In the worst case, the developer can build a second time... I think your patch won't work on Unix machines: _freeze_importlib.c is linked with all Python files *except* frozen.c which defines

[issue15466] Python/importlib.h is different on 32bit and 64bit

2012-07-27 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc amaur...@gmail.com added the comment: I realize that uppercase I and lowercase L are easily confused: On first row, 'I' (=TYPE_INT64) followed by 0x on 8 bytes. On second row, 'l' (=TYPE_LONG) followed by 3 followed by 0x (in 3 chunks of 15 bits

[issue15466] Python/importlib.h is different on 32bit and 64bit

2012-07-27 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc amaur...@gmail.com added the comment: My primary goal is to have a stable importlib.h, and currently all developer work on machines where PY_LONG_LONG is 64bit. So the restriction is OK. -- ___ Python tracker rep

[issue15431] Cannot build importlib.h on Windows

2012-07-27 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc amaur...@gmail.com added the comment: If you look at Makefile.pre.in, you'll see that on Unix it builds a special binary: Modules/_freezeimportlib.c; it uses most of Python machinery (except importlib, of course), and manually open importlib/_bootstrap.py, compiles

[issue15431] Cannot build importlib.h on Windows

2012-07-27 Thread Amaury Forgeot d'Arc
Changes by Amaury Forgeot d'Arc amaur...@gmail.com: -- Removed message: http://bugs.python.org/msg166584 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15431

[issue15431] Cannot build importlib.h on Windows

2012-07-27 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc amaur...@gmail.com added the comment: (Sorry for the previous message, it was wrong, and I also pressed the wrong button...) A Unix Makefile cannot stand circular dependencies, so _freezeimportlib.c cannot depend on frozen.o. OTOH it's not simple to have almost-similar

[issue15454] Allow dircmp.report() output stream to be customized

2012-07-26 Thread Amaury Forgeot d'Arc
Changes by Amaury Forgeot d'Arc amaur...@gmail.com: -- stage: - needs patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15454 ___ ___ Python

[issue15438] Incredible issue in math.pow

2012-07-26 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc amaur...@gmail.com added the comment: C comparison rules are different from Python's. In the program below (which outputs 1), the mixed comparison will first convert the literal to a double, and lost some precision. Python does the opposite: the (imprecise) float

[issue15431] Cannot build importlib.h on Windows

2012-07-23 Thread Amaury Forgeot d'Arc
New submission from Amaury Forgeot d'Arc amaur...@gmail.com: On Windows, the _freeze_importlib tool is not built, so it's not possible to refresh the file Python/importlib.h, which makes development on the importlib very difficult on Windows. The Makefile contains the rules below, it's

[issue14578] importlib doesn't check Windows registry for paths

2012-07-23 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc amaur...@gmail.com added the comment: importlib.h is not rebuilt on Windows, see issue15431. -- dependencies: +Cannot build importlib.h on Windows ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14578

[issue10854] Output .pyd name in error message of ImportError when DLL load fails

2012-07-22 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc amaur...@gmail.com added the comment: How it the new message better than ImportError: No module named '_socket'? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10854

[issue15425] Another strange Tracebacks with importlib

2012-07-22 Thread Amaury Forgeot d'Arc
New submission from Amaury Forgeot d'Arc amaur...@gmail.com: Two easy ways to get tracebacks which contain useless importlib._bootstrap rows: - When there is a syntax error in the imported module - On import package.module, when top-level package cannot be imported $ ./python -c import foo

[issue14578] importlib doesn't check Windows registry for paths

2012-07-22 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc amaur...@gmail.com added the comment: I don't have Windows, but here is an example of a WindowsRegistryImporter, written outside importlib (the script also contains a fake implementation of winreg, so I could test it...) Of course it needs to be rewritten to fit

[issue15416] 3 * [] gives a list of 3 cross-referenced lists, a[1]='blah' writes in to ALL three!

2012-07-21 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc amaur...@gmail.com added the comment: The * operator does not create copies, it duplicates references to existing objects. Please read: http://docs.python.org/faq/programming.html#how-do-i-create-a-multidimensional-list -- nosy: +amaury.forgeotdarc resolution

[issue15092] Using enum PyUnicode_Kind

2012-07-18 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc amaur...@gmail.com added the comment: I'd strongly prefer not having enum everywhere. PyUnicode_Kind alone is certainly possible, maybe with a typedef? -- nosy: +amaury.forgeotdarc ___ Python tracker rep...@bugs.python.org http

[issue15379] Charmap decoding of no-BMP characters

2012-07-18 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc amaur...@gmail.com added the comment: In 3.2, narrow build is also broken when the charmap is a string: codecs.charmap_decode(b'\0', 'strict', '\U0002000B') returns (' ', 1) with a wide unicode build, but ('\ud840', 1) with a narrow build. 3.2 could be fixed to allow

[issue15360] Behavior of assigning to __dict__ is not documented

2012-07-18 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc amaur...@gmail.com added the comment: What kind of behavior are you referring to? Are there really differences between versions? -- nosy: +amaury.forgeotdarc ___ Python tracker rep...@bugs.python.org http://bugs.python.org

[issue15379] Charmap decoding of no-BMP characters

2012-07-18 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc amaur...@gmail.com added the comment: About the patch for 3.2: needed = 6 - extrachars Where does this 6 come from? There is another part which uses this extrachars. Why is the allocation strategy different here

[issue15379] Charmap decoding of no-BMP characters

2012-07-18 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc amaur...@gmail.com added the comment: Ah, I was worried by the possible quadratic behavior. So the other (existing) case is quadratic as well (I was mislead by the , which made me think there is something clever there). That's good enough for 3.2, I guess

[issue15320] thread-safety issue in regrtest.main()

2012-07-12 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc amaur...@gmail.com added the comment: I wrote this patch with the assumption that it shouldn't hurt if multiple threads call deque.extend() at the same time. By looking at the implementation, I found that if multiple threads call dequeue.extend() at the same time, all

[issue15329] clarify which deque methods are thread-safe

2012-07-12 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc amaur...@gmail.com added the comment: Pypy tends to make fewer guarantees because it implements more classes in pure python. This is not exactly true; in PyPy the _collection module was rewritten in RPython (which is translated to C) for this very reason: to make

[issue7652] Merge C version of decimal into py3k.

2012-07-12 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc amaur...@gmail.com added the comment: I compared both implementations, and they are the same. I noticed that on line 7537, the call to mpd_qshiftl() may goto malloc_error;. I think there is a memory leak in this case, mpd_del(c) and 2 others lines are skipped

[issue15341] Cplex and python

2012-07-12 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc amaur...@gmail.com added the comment: Hi, the bug tracker is not designed to get help. Please ask questions on the python-list forum, or the comp.lang.python newsgroup. There are many friendly people there... Be ready to come with a short script showing the error

[issue15320] thread-safety issue in regrtest.main()

2012-07-11 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc amaur...@gmail.com added the comment: There is indeed a race condition here. Fortunately unit tests take much more time than the generator loop. Is it enough to turn the generator into a fixed list? Or is the late binding behavior of args_tuple important? (For example

[issue15320] thread-safety issue in regrtest.main()

2012-07-11 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc amaur...@gmail.com added the comment: I was about to say yes, listiter.__next__ is atomic (it should, really), but that's not true (Hint: there is a Py_DECREF in the code...). The script below crashes with: Fatal Python error: Objects/listobject.c:2774 object

[issue15316] runpy swallows ImportError information with relative imports

2012-07-10 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc amaur...@gmail.com added the comment: Looks very similar to issue15111. -- nosy: +amaury.forgeotdarc resolution: - duplicate status: open - closed superseder: - Wrong ImportError message with importlib ___ Python tracker rep

[issue15306] Python3 segfault? (works in Python2)

2012-07-09 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc amaur...@gmail.com added the comment: How is the fix related to Python? Also, you pass a unicode string to freetype.FT_New_Face. You should probably pass a bytes string there, and in any case set the argtypes and restypes attributes to ctypes functions, to prevent

[issue15306] Python3 segfault? (works in Python2)

2012-07-09 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc amaur...@gmail.com added the comment: In Python2, strings are bytes; in Python3, they are unicode. You need to use the b'' syntax. -- resolution: - invalid status: open - closed ___ Python tracker rep...@bugs.python.org http

[issue15242] PyImport_GetMagicTag() should use the same const char * as sys.implementation.cache_tag

2012-07-09 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc amaur...@gmail.com added the comment: It's not necessary. The fix looks good as is. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15242

[issue15110] strange Tracebacks with importlib

2012-07-08 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc amaur...@gmail.com added the comment: I really like the _exec_module trick, but it should be applied to builtin modules as well. I hacked _sre.c and got: ~/python/cpython3.x$ ./python Traceback (most recent call last): File /home/amauryfa/python/cpython3.x/Lib/site.py

[issue15110] strange Tracebacks with importlib

2012-07-07 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc amaur...@gmail.com added the comment: Does it work for extension modules? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15110

[issue15110] strange Tracebacks with importlib

2012-07-07 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc amaur...@gmail.com added the comment: I added to _ssl.c: PyErr_SetString(PyExc_ValueError, Just a test); return NULL; Then I tried to import the module: ~/python/cpython3.x$ ./python -c import ssl Traceback (most recent call last): File string, line 1, in module

[issue15110] strange Tracebacks with importlib

2012-07-07 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc amaur...@gmail.com added the comment: See also msg164937 -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15110

[issue15261] os.stat(fd) crashes on Windows if fd does not exist

2012-07-06 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc amaur...@gmail.com added the comment: Many os functions started to accept file descriptors. I don't know how many are available on Windows, but IMO _PyVerify_fd() could be used for all of them; it's a no-op macro on Unix anyway. -- nosy: +amaury.forgeotdarc, larry

[issue15263] Guard against invalid file handles in os functions

2012-07-06 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc amaur...@gmail.com added the comment: Windows will also crash if you pass INVALID_HANDLE_VALUE (which is not a file descriptor) to crt functions... How did you want to use this macro? -- ___ Python tracker rep...@bugs.python.org

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