Petr Viktorin added the comment:
> perhaps Petr's patch to accept both magic numbers should be submitted
> upstream so it's the default in 3.5.4+?
I don't think it can be submitted in the current state; it's a one-time hack
intended to be removed and forgotten at the
Petr Viktorin added the comment:
According to issue27286, Ubuntu 16.04LTS has the fix and uses the new magic
number. (And this is one reason undoing the change in CPython is out of the
question.)
The patch Nick mentioned is brewing at
https://github.com/encukou/cpython/commit/magic-number
Petr Viktorin added the comment:
> How would you propose to fix broken bytecodes in a bugfix be fixed if you
> can't bump the magic number?
That would depend on the situation. I can imagine that if the bug is severe
enough, the number could be bumped, after careful discussion, a
Petr Viktorin added the comment:
For the record, the magic number was changed in issue27286
--
___
Python tracker
<http://bugs.python.org/issue29514>
___
___
Pytho
Changes by Petr Viktorin :
--
nosy: +ncoghlan
___
Python tracker
<http://bugs.python.org/issue1353344>
___
___
Python-bugs-list mailing list
Unsubscribe:
New submission from Petr Viktorin:
The Py_UNUSED macro, which was added in Python 3.4, is not documented.
Is this an omission, or is it undocumented on purpose?
I can prepare a patch if it's the former.
The macro was added in: http://bugs.python.org/issue19976
and referenced in:
Petr Viktorin added the comment:
The backwards compatibility is not as strong as it could be: previously,
HAVE_LONG_LONG was defined to 1; now it's defined but empty.
At least that's the case on Fedora.
Found in the Python plugin for GCC:
https://bugzilla.redhat.com/show_bug.cgi?
Petr Viktorin added the comment:
ping
Anything I can do to move this forward?
--
___
Python tracker
<http://bugs.python.org/issue27910>
___
___
Python-bugs-list m
Petr Viktorin added the comment:
In portingguide [0] I could only recommend sitecustomize with a (possibly
third-party) codec that emits warnings; not 'undefined'.
The things that aren't ported yet are generally either Non-Python applications
with Python bindings or plugi
Petr Viktorin added the comment:
(Please ignore that comment – I was on vacation and, when clearing my backlog,
got to this issue before the Fedora discussions.)
--
___
Python tracker
<http://bugs.python.org/issue27
Petr Viktorin added the comment:
Indeed, I'd close WONTFIX.
IMO, applications that:
- run at early boot, and
- get built with an older kernel than they run on
fall squarely into the enterprise distro turf, and CPython code shouldn't
include hacks needed to make this work. That's
Petr Viktorin added the comment:
This was a deliberate change in 3.5.
Issue: https://bugs.python.org/issue17911
News entry: https://docs.python.org/3/whatsnew/3.5.html#traceback
Why do you think it is a regression?
Who would be the person that can decide if it is a doc bug or regression
New submission from Petr Viktorin:
There are two "barrier" like abstractions on Lib/logging/handlers.py in the
_monitor method.
First _monitor has two loops, what is already kind of a hint something is not
right.
Second, it has two ways to exit the loop, that also exit the thre
Petr Viktorin added the comment:
Hi! I'm on a tight schedule this week, so I'm not looking into this in detail.
But please let me know if you need any help and I'll raise the priority.
--
___
Python tracker
<http://bugs.pyt
Petr Viktorin added the comment:
The conversation seems to have stalled. Rémi, are you still working on the
patch? Should someone take over?
--
nosy: +encukou
___
Python tracker
<http://bugs.python.org/issue27
Petr Viktorin added the comment:
Hello,
Is there anything I can do to help get this issue resolved?
--
___
Python tracker
<http://bugs.python.org/issue27
Changes by Petr Viktorin :
--
nosy: +encukou
___
Python tracker
<http://bugs.python.org/issue27201>
___
___
Python-bugs-list mailing list
Unsubscribe:
New submission from Petr Viktorin:
Currently, Argument Clinic generates "PyModuleDef * module" for the first
argument of module-level functions. But, the functions are passed the actual
module object, not the ModuleDef.
The correct type to use is PyObject*, which is used for modu
New submission from Petr Viktorin:
The Py_VISIT macro (in Include/objimpl.h) does nothing if passed NULL (and did
this since its introduction). It would be nice to have this formally documented.
--
assignee: docs@python
components: Documentation
files: 0001-Doc-c-api-Clarify-that
Petr Viktorin added the comment:
Indeed, the size is 0 there:
{'family': 'DejaVu Sans Mono', 'size': 0, 'slant': 'roman', 'weight': 'normal',
'overstrike': 0, 'underline': 0}
--
Petr Viktorin added the comment:
buggy:
configuredFont: ('DejaVu Sans Mono', 0, 'normal')
fontSize: 0
good:
configuredFont: ('courier', 10, 'normal')
fontSize: 10
--
___
Python tra
Petr Viktorin added the comment:
I can reproduce this with Python 2.7.11 and somewhat recent build from hg
default (3.6.0a0) on Fedora 23.
Putting these lines in my personal config-main.cfg solves this::
[EditorWindow]
font= courier
idlelib/config-main.def has a different default
New submission from Petr Viktorin:
According to the docs [0], traceback.extract_tb should return 4-tuples
(filename, line number, function name, text).
[0] https://docs.python.org/3/library/traceback.html#traceback.extract_tb
Instead, since Python 3.5, it returns FrameSummary objects, which
Petr Viktorin added the comment:
Regarding the patch: if trailing underscores are not allowed, `0 if 1_else
1` should be illegal.
--
nosy: +encukou
___
Python tracker
<http://bugs.python.org/issue26
New submission from Petr Viktorin:
Evaluating the expression f"{(lambda: 0):x}" crashes Python.
$ ./python
Python 3.6.0a0 (default, Feb 5 2016, 02:14:48)
[GCC 5.3.1 20151207 (Red Hat 5.3.1-2)] on linux
Type "help", "copyright", "credits" or "licens
New submission from Petr Viktorin:
Exceptions from the decimal module are quite unfriendly:
>>> Decimal(42) / Decimal(0)
...
decimal.DivisionByZero: []
>>> huge = Decimal('9' * 99)
>>> huge.quantize(Decimal('0.1'))
...
Petr Viktorin added the comment:
As it says in the docs, a "logical line that contains only spaces, tabs,
formfeeds and possibly a comment, is ignored."
If you write:
if a=b:
statement
# Comment
another statement
both statements belong to the "if" block.
In your
Petr Viktorin added the comment:
Thank you for the license.
I mentioned my project mainly as a place where this code can be *tested*. I
have no problem with keeping capsulethunk.h in the Python docs, and
synchronizing the two projects if changes are made on either side. In other
words, feel
Petr Viktorin added the comment:
As capsulethunk.h is only needed for Python 2.6 and below, which are no longer
maintained, in issue24937 we are discussing moving the header to an external
project.
--
nosy: +encukou
___
Python tracker
<h
Petr Viktorin added the comment:
This patch removes capsulethunk.h from the docs, and directs the kind reader to
the py3c project, which carries a fixed and tested version of it, along with
the docs.
Larry, would you be OK with releasing capsulethunk.h under the MIT license? The
PSF license
Petr Viktorin added the comment:
Sorry for the delay; I lost the mail notification.
I don't have a config-main.cfg file.
The last output from the test, with the print added:
test_dialog (idlelib.idle_test.test_configdialog.ConfigDialogTest) ...
('.139655680391704', 'confi
Petr Viktorin added the comment:
So, if I understand correctly, the problem is that the new imp.load_dynamic in
3.5.0b checks sys.modules, so if a module of the same name was loaded
previously, it's only reloaded, skipping the create_module step.
This patch bypasses that check, so
Petr Viktorin added the comment:
Indeed. I don't have access to a Windows machine, but I will try reproducing
the problem on another system.
--
___
Python tracker
<http://bugs.python.org/is
Petr Viktorin added the comment:
I'd be happy to do any further testing (modulo a vacation until this Tuesday),
but unfortunately I don't have time to dive into tkinter myself and look for
the cause.
IDLE starts normally on this box.
Also note: Fedora 23 is currently in alpha (tho
Petr Viktorin added the comment:
Thanks! I'll take good care of it :)
Give me a few days to prepare the docs change; this isn't very high priority.
--
___
Python tracker
<http://bugs.python.o
Petr Viktorin added the comment:
Note:
I'm including a tested (+fixed, now) copy of capsulethunk.h in my set of
Python3 C extension porting helpers, http://py3c.readthedocs.org
Unfortunately the tests can't be added to CPython, because they need to run on
Python 2.6 to be useful.
New submission from Petr Viktorin:
In https://docs.python.org/3/howto/cporting.html#cobject-replaced-with-capsule
(added in issue13053):
1) __PyCapsule_GetField is defined as::
#define __PyCapsule_GetField(capsule, field, default_value) ...
but called as::
__PyCapsule_GetField
Petr Viktorin added the comment:
I see some typos in aifc.py:
+_aifc_params.sampwidth.__doc__ = 'Ample width in bytes'
+_aifc_params.compname.__doc__ = ("""A human-readable version ofcompression type
Should that be "Sample width" and "of
Petr Viktorin added the comment:
Right. I think a common helper is cleaner than calling a clinic-generated
wrapper.
--
___
Python tracker
<http://bugs.python.org/issue24
Petr Viktorin added the comment:
Apologies for the delay; I was on vacation.
This was indeed a mistake in PEP 489 implementation. I agree with Nick on the
solution.
Here is a patch that adds exec_builtin, with implementation shared with
exec_dynamic.
--
keywords: +patch
Added file
Petr Viktorin added the comment:
Eric or me.
I'm not sure I understand the description clearly. Etienne, would it be
possible to write a smaller reproducer, that wouldn't be tied to Windows?
Or is this Windows-only behavior?
--
___
Pyth
Petr Viktorin added the comment:
Originally found here: https://bugzilla.redhat.com/show_bug.cgi?id=1244261
--
___
Python tracker
<http://bugs.python.org/issue24
New submission from Petr Viktorin:
A Python int larger than a C int but smaller than a C long is silently
truncated to int when passed to a ctypes function without C type information
attached.
Ints longer than C long fail with an OverflowError; I believe the same should
happen for numbers
New submission from Petr Viktorin:
In 3.4, `imp.reload` was deprecated in favor of `importlib.reload`.
https://docs.python.org/3/library/imp.html
--
assignee: docs@python
components: Documentation
files: docs.patch
keywords: patch
messages: 247319
nosy: docs@python, encukou
Changes by Petr Viktorin :
--
nosy: +encukou
___
Python tracker
<http://bugs.python.org/issue19713>
___
___
Python-bugs-list mailing list
Unsubscribe:
New submission from Petr Viktorin:
When this program is invoked as a script (`python reproducer.py`), the __del__
is never called:
---
class ClassWithDel:
def __del__(self):
print('__del__ called')
a = ClassWithDel()
a.link = a
raise SystemExit(0)
---
Raising a
Petr Viktorin added the comment:
Verifying modules to work ith subinterpreters is tricky. What level of
assurance do you want?
Subinterpreters themselves require that you embed Python, which doesn't lend
itself to an easy example. I hope 2.6 makes the situation better.
Example code
Petr Viktorin added the comment:
Yes!
Aside from the callback problem, which is left for another PEP, but limits PEP
489 usefulness in the real world :(
It turns out that one is quite a rabbit hole. I'll post my findings on that
soo
Petr Viktorin added the comment:
Thanks for the review.
I've added the explanation you suggested, and I've made the names monospace (or
linked them, where it seemed appropriate). I've also marked *NULL*s like in the
rest of the doc.
--
Added file: http://bugs.pytho
New submission from Petr Viktorin:
Hello,
Here is a patch documenting PEP 489.
I don't feel comfortable rewriting the tutorial [0] yet: before the issue with
callbacks/module state [1] is solved, which is 3.6 material, multi-phase init
is not suitable for all modules.
So everything in PE
Petr Viktorin added the comment:
ping; this issue can be closed.
--
___
Python tracker
<http://bugs.python.org/issue23642>
___
___
Python-bugs-list mailin
Petr Viktorin added the comment:
Since PEP 489 (Python 3.5.0b1), loaders now support create_module/exec_module.
For modules which don't use the PEP's new multi-phase init mechanism (which is
most of them, currently), load_module() does all the work and exec_module is a
no-op.
So,
Petr Viktorin added the comment:
tp_traverse is completely orthogonal to tp_dealloc, it's needed to detect (and
then break) reference cycles like:
obj = xxlimited.Xxo()
obj.foo = obj
As for tp_finalize: yes, mentioning it in tp_dealloc docs would be good, but
I'll need
Petr Viktorin added the comment:
I've posted a patch that fixes the remaining refleak in issue24373.
--
___
Python tracker
<http://bugs.python.org/is
New submission from Petr Viktorin:
The example object in the xxlimited module can be part of a reference loop (it
can contain itself), so it needs GC and tp_traverse.
The tp_dealloc hook was incorrect, and a correct version would be difficult to
generalize for something more complicated than
Petr Viktorin added the comment:
I meant "stable ABI", of course
--
title: Conditionalize 3.5 additions to the stable API -> Conditionalize 3.5
additions to the stable ABI
___
Python tracker
<http://bugs.pytho
New submission from Petr Viktorin:
I have sent patches to 3.5 that add new stable API, and later I learned [0]
that additions should be conditional on the value of Py_LIMITED_API.
This patch adds #ifdef blocks for what was added in issues #24268 and #24345.
[0] https://mail.python.org
New submission from Petr Viktorin:
PEP 442 added the tp_finalize member for objects, but there's no corresponding
Py_tp_finalize slot. This means that types defined using PyType_FromSpec (and
in particular, extensions using the stable ABI) can't take advantage of the new
GC fi
Petr Viktorin added the comment:
And, the remaining refleak is a known issue from 2012: PyType_FromSpec-created
types with custom tp_dealloc leak references when instantiated.
See issue 16690
There's more discussion is in issue 15653
Martin v. Löwis notes:
> So I'd propose that i
Petr Viktorin added the comment:
I've opened issue24328 for that regression.
--
___
Python tracker
<http://bugs.python.org/issue24268>
___
___
Python-bugs-l
New submission from Petr Viktorin:
A regression in the PEP 489 implementation prevents loading extension modules
with single-character names (because length-1 bytestrings are interned).
Here is a fix. It would be great to have it in 3.5.0b2.
--
files: fix-short-names.patch
keywords
Petr Viktorin added the comment:
Ah, indeed. I need to create a new bytes object here after all.
Here is a fix, with a test.
Thank you Stefan!
--
Added file: http://bugs.python.org/file39546/fix-short-names.patch
___
Python tracker
<h
New submission from Petr Viktorin:
When obtaining the signature of a bound method, inspect.signature, by default,
omits the "self" argument to the method, since it is already specified in the
bound method. However, if you create a wrapper around a bound method with
functools.upda
Petr Viktorin added the comment:
Reported by David Gibson here:
https://bugzilla.redhat.com/show_bug.cgi?id=1201990
--
___
Python tracker
<http://bugs.python.org/issue24
Petr Viktorin added the comment:
issue 24268 has a patch with a test case.
--
nosy: +encukou
___
Python tracker
<http://bugs.python.org/issue24285>
___
___
Pytho
Petr Viktorin added the comment:
Yes, you did find an error. Thanks for reporting it!
Here is a fix with a test case.
--
Added file: http://bugs.python.org/file39493/fix-pep489-submodule.patch
___
Python tracker
<http://bugs.python.org/issue24
Petr Viktorin added the comment:
Steve, could you please merge it?
--
___
Python tracker
<http://bugs.python.org/issue24268>
___
___
Python-bugs-list mailin
Petr Viktorin added the comment:
Thank you, Steve.
A similar problem is on other platforms as well. This patch should fix it;
could someone look at it?
--
Added file: http://bugs.python.org/file39477/fix-dynload-init-name.patch
___
Python tracker
Petr Viktorin added the comment:
FWIW, the remaining refleak occurs when unloading an extension module object.
This is something that wasn't possible before PEP 489 -- extension modules were
never deleted.
--
___
Python tracker
Petr Viktorin added the comment:
The array module is good if you *really* drop references:
$ ./python -X showrefcount
Python 3.5.0a4+ (default, May 23 2015, 16:44:38)
[GCC 4.9.2 20150212 (Red Hat 4.9.2-6)] on linux
Type "help", "copyright", "credits" or
Petr Viktorin added the comment:
Fix some refleaks
- one in PyModule_FromDefAndSpec2 - this is my fault
- one in PyType_FromSpecWithBases - I guess this is
the first time PEP-384 built-in types are GC'd
- one in the new PEP 489 tests
There's still one more in the new test
Petr Viktorin added the comment:
And here are all changes in a single patch.
--
keywords: +patch
Added file: http://bugs.python.org/file39471/pep0489.patch
___
Python tracker
<http://bugs.python.org/issue24
New submission from Petr Viktorin:
Here is the implementation for the recently accepted PEP 489.
Tested on Linux.
--
files: pep0489.patches
messages: 243893
nosy: encukou, eric.snow, ncoghlan
priority: normal
severity: normal
status: open
title: PEP 489 -- Multi-phase extension module
Petr Viktorin added the comment:
Just a reminder: if you want this to be in Python 3.5, please review the patch
--
___
Python tracker
<http://bugs.python.org/issue23
Petr Viktorin added the comment:
Here is a version with PyErr_BadArgument.
--
Added file: http://bugs.python.org/file39455/richcompare-macro-badargument.patch
___
Python tracker
<http://bugs.python.org/issue23
Petr Viktorin added the comment:
Well, in my opinion NotImplemented is a good value for "unknown operation", but
I'll be happy to change to PyErr_BadArgument(); return NULL; if there's support
for that.
--
___
P
Petr Viktorin added the comment:
Conceptually there's a distinction between the two cases, but you can implement
one in terms of the other, so I don't think it's worth adding two
functions/macros here. So let's pick the better API.
"Py_cmp_to_bool" is better i
Petr Viktorin added the comment:
What can I, not a core developer, do to resolve this disagreement?
Should I submit a PEP?
--
___
Python tracker
<http://bugs.python.org/issue23
Petr Viktorin added the comment:
Well, as a newcomer, I think the macro makes it easier to both grok what the
code does, and is about equally difficult when it comes to checking correctness
of the code.
But I understand that's a subjective.
Marc-Andre, Barry, you expressed interest i
Petr Viktorin added the comment:
Is it really not better to give the operation a name, rather than repeating the
same ten lines every time? (Well, not the same -- all the modules code it a bit
differently, but with the same meaning.)
I might be true that the types in Python itself are "
Petr Viktorin added the comment:
>From the discussion on the list:
- It needs to be a macro, not function, to support various types (unsigned long
long, float; possibly C++ stuff with overriden operators)
- Another suggestion to change the order of arguments; I still think being the
same
Petr Viktorin added the comment:
Issues #17762 and #9514 had patches to improve these functions. Time to close
them?
--
___
Python tracker
<http://bugs.python.org/issue1
Petr Viktorin added the comment:
The functions have been deprecated in #1322, is it time to close this?
--
___
Python tracker
<http://bugs.python.org/issue17
Changes by Petr Viktorin :
--
nosy: +encukou
___
Python tracker
<http://bugs.python.org/issue17762>
___
___
Python-bugs-list mailing list
Unsubscribe:
Changes by Petr Viktorin :
--
nosy: +encukou
___
Python tracker
<http://bugs.python.org/issue1322>
___
___
Python-bugs-list mailing list
Unsubscribe:
Petr Viktorin added the comment:
The note is *correct* concerning the length, but I don't think it's relevant:
in a NUL-terminated string without embedded NULs, the length is unambiguous.
The other issues are about "u" itself, not the note. (I have nothing against
the &
Petr Viktorin added the comment:
Not true (on 3.3 & 2.7).
>>> import sys
>>> import x
Traceback (most recent call last):
File "", line 1, in
File "/tmp/x.py", line 1, in
import y
File "/tmp/y.py", line 1, in
1/0
ZeroDivisionEr
New submission from Petr Viktorin:
A note in the docs for the "u" format unit saus NULs are not allowed, but the
previous sentence says they aren't accepted.
--
assignee: docs@python
components: Documentation
files: 0002-Remove-obsolete-note-in-argument-parsing-docs
New submission from Petr Viktorin:
imp.reload() and importlib.reload() docs state::
If a module is syntactically correct but its initialization fails, the first
:keyword:`import` statement for it does not bind its name locally, but does
store a (partially initialized) module object
Changes by Petr Viktorin :
--
nosy: +encukou
___
Python tracker
<http://bugs.python.org/issue24056>
___
___
Python-bugs-list mailing list
Unsubscribe:
Petr Viktorin added the comment:
ping
Anything I can do to help move this forward?
--
___
Python tracker
<http://bugs.python.org/issue23699>
___
___
Python-bug
Petr Viktorin added the comment:
ping?
--
___
Python tracker
<http://bugs.python.org/issue22198>
___
___
Python-bugs-list mailing list
Unsubscribe:
Petr Viktorin added the comment:
Changed the macro to Py_RETURN_RICHCOMPARE. This is not an expression, allowing
the use of a switch statement. On the other hand, it's even larger macro than
before now.
>From the discussion it seems that doing this correctly is tricky to do this
&g
Petr Viktorin added the comment:
Making it a function might help with the following issues:
- series of comparisons and PyBool_FromLong is less efficient than switch and
Py_RETURN_*. But it would add a function call.
- it might be too complex for a macro
Do you think that would help?
As for
Petr Viktorin added the comment:
Attaching another patch:
- Leave _decimal alone per maintainer's wishes
- Fixes issues pointed out in the review
- Use Py_RICHCOMPARE also in _tkinter
- More improvements in the other affected modules
--
Added file:
http://bugs.python.org/file
Petr Viktorin added the comment:
Serhiy: Thanks for looking at this!
I think it should fall in the same category as Py_RETURN_TRUE or
Py_RETURN_NONE. Sure, it's easy to reimplement, but a lot of extensions need
it; why should everyone need to write the same code in a dozen different wa
Petr Viktorin added the comment:
Here is a patch that uses the macro in all the places it can help.
--
Added file:
http://bugs.python.org/file38542/0002-Use-Py_RICHCOMPARE-in-rich-comparisons.patch
___
Python tracker
<http://bugs.python.
New submission from Petr Viktorin:
Rich comparison functions of many builtin types include a block of boilerplate
which can be consolidated in a macro. The macro can be useful for third-party
extensions as well as CPython itself.
See this e-mail for a longer write-up:
https://mail.python.org
Petr Viktorin added the comment:
ping, is there anything I can do to help push the patch forward?
--
___
Python tracker
<http://bugs.python.org/issue22
Petr Viktorin added the comment:
ping, could someone please review the patch?
--
___
Python tracker
<http://bugs.python.org/issue22198>
___
___
Python-bugs-list m
801 - 900 of 907 matches
Mail list logo