Barry A. Warsaw added the comment:
> Ah, signed=False by default, so (128).to_bytes() will work. But I still worry
> that it can provoke writing more errorprone code.
Can you elaborate on that? Obviously no existing code will change behavior. I
really don’t expect people to write
Barry A. Warsaw added the comment:
For the common case where you’re using all defaults, it won’t matter.
byteorder doesn’t matter when length=1.
> On Sep 9, 2021, at 18:12, Raymond Hettinger wrote:
>
>
> Raymond Hettinger added the comment:
>
> Perhaps instead
Barry A. Warsaw added the comment:
Just to point out, struct module also uses “native” (i.e. system) byte order by
default. Any choice other than that for to_bytes() seems both arbitrary and
inconsistent.
> On Sep 10, 2021, at 00:48, Petr Viktorin wrote:
>
> Exactly, a platform-
Barry A. Warsaw added the comment:
On Sep 10, 2021, at 04:06, STINNER Victor wrote:
>
> If the intent is to create a bytes string of length 1, I'm not sure that
> "re-using" this existing API for that is a good idea.
Why not? It seems an obviou
Barry A. Warsaw added the comment:
Petr Viktorin added the comment:
>
> Exactly, a platform-dependent default is a bad idea. A default allows using
> the function without the code author & reviewer even being *aware* that there
> is a choice, and that is dangerous.
I’m not
Barry A. Warsaw added the comment:
That’s okay, Brandt’s improved sys.byteorder is fastest .
% ./python.exe -m timeit -r11 -s 'x=3452452454524' 'x.to_bytes(10, "little")'
200 loops, best of 11: 94.6 nsec per loop
% ./python.exe -m timeit -r11 -s 'x=
Barry A. Warsaw added the comment:
I created a Discourse poll:
https://discuss.python.org/t/what-should-be-the-default-value-for-int-to-bytes-byteorder/10616
--
___
Python tracker
<https://bugs.python.org/issue45
Barry A. Warsaw added the comment:
> I'd probably say "In the face of ambiguity, refuse the temptation to guess".
>
> As there's disagreement about the 'correct' default, make it None and require
> either "big" or "little" if len
Barry A. Warsaw added the comment:
On Sep 13, 2021, at 13:38, STINNER Victor wrote:
> It seems like your proposal is mostly guided by: convert an int to a byte
> (bytes string of length 1). IMO this case is special enough to justify the
> usage of a different function.
Barry A. Warsaw added the comment:
On Sep 13, 2021, at 13:39, Vedran Čačić wrote:
>
> The poll is invalid, since the option that most people want is deliberately
> not offered.
*Is* there an option that most people want?
--
___
Pytho
Barry A. Warsaw added the comment:
On Sep 13, 2021, at 22:12, Vedran Čačić wrote:
>
>
> Vedran Čačić added the comment:
>
> I'd say yes. Of course, one way to ascertain that would be to conduct a valid
> pool. ;-)
People can always comment otherwise
Barry A. Warsaw added the comment:
"big" by default
--
___
Python tracker
<https://bugs.python.org/issue45155>
___
___
Python-bugs-list mailing
Barry A. Warsaw added the comment:
This bug made my day! :-D
--
___
Python tracker
<https://bugs.python.org/issue45202>
___
___
Python-bugs-list mailin
Barry A. Warsaw added the comment:
New changeset 07e737d002cdbf0bfee53248a652a86c9f93f02b by Barry Warsaw in
branch 'main':
bpo-45155 : Default arguments for int.to_bytes(length=1,
byteorder=sys.byteorder) (#28265)
https://github.com/python/cpyt
Change by Barry A. Warsaw :
--
resolution: -> fixed
stage: patch review -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.or
Barry A. Warsaw added the comment:
On Sep 16, 2021, at 00:36, STINNER Victor wrote:
>
> The commit title is wrong, the default "big" not sys.byteorder:
>
>int.to_bytes(length=1, byteorder='big', *, signed=False)
>int.from_bytes(bytes, byte
Change by Barry A. Warsaw :
--
nosy: +barry
___
Python tracker
<https://bugs.python.org/issue45020>
___
___
Python-bugs-list mailing list
Unsubscribe:
Change by Barry A. Warsaw :
--
nosy: +barry
___
Python tracker
<https://bugs.python.org/issue45324>
___
___
Python-bugs-list mailing list
Unsubscribe:
Barry A. Warsaw added the comment:
FWIW, Greg's test case does not fail for me with 6a533a4238
--
nosy: +barry
___
Python tracker
<https://bugs.python.org/is
Change by Barry A. Warsaw :
--
nosy: -barry
___
Python tracker
<https://bugs.python.org/issue37722>
___
___
Python-bugs-list mailing list
Unsubscribe:
Barry A. Warsaw added the comment:
Weird. PR 28655 is merged on GH, but still shows open on this bpo ticket.
--
___
Python tracker
<https://bugs.python.org/issue21
Barry A. Warsaw added the comment:
This doesn't seem right, given that PEP 663 has not been approved by the SC yet:
3.9.7 (default, Oct 13 2021, 06:45:31)
[Clang 13.0.0 (clang-1300.0.29.3)]
ABC.a ABC.b ABC.c ABC.a
|main=|@presto[~/projects/python/cpython:1058]% python3.10 /tmp/f
Barry A. Warsaw added the comment:
I'm going to take a look at this during the Python core sprint.
--
assignee: -> barry
___
Python tracker
<https://bugs.python.org
Change by Barry A. Warsaw :
--
versions: +Python 3.10, Python 3.11, Python 3.9 -Python 3.6, Python 3.7, Python
3.8
___
Python tracker
<https://bugs.python.org/issue35
Change by Barry A. Warsaw :
--
keywords: +patch
pull_requests: +27320
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/29049
___
Python tracker
<https://bugs.python.org/issu
Barry A. Warsaw added the comment:
First crack at a PR for this issue.
--
keywords: +needs review -patch
___
Python tracker
<https://bugs.python.org/issue35
Barry A. Warsaw added the comment:
Since the documentation problem reported here has since been fixed, and really
all that's left is to expose NamespaceLoader publicly and register it with the
abc, this is technically a new feature so it can't be backported. Thus,
targeting
Barry A. Warsaw added the comment:
I can see why Ethan might be overwhelmed by reverting this change. I tried to
merge in his branch but failed, so I'm chucking that work and will try again.
--
___
Python tracker
<https://bugs.py
Barry A. Warsaw added the comment:
I don't know. What benefit would be gained? That should probably be a
separate issue/PR in either case.
--
___
Python tracker
<https://bugs.python.org/is
Change by Barry A. Warsaw :
--
keywords: +patch
pull_requests: +27347
stage: test needed -> patch review
pull_request: https://github.com/python/cpython/pull/29078
___
Python tracker
<https://bugs.python.org/issu
Barry A. Warsaw added the comment:
Woot! I finally figured out the problem and how to fix it. It has nothing to
do with Python and everything to do with AT&T. They run a service called DNS
Error Assist, quoting:
"Sometimes we enter a wrong search word, or a wrong web address, or
Change by Barry A. Warsaw :
--
pull_requests: +27351
pull_request: https://github.com/python/cpython/pull/29085
___
Python tracker
<https://bugs.python.org/issue42
New submission from Barry A. Warsaw :
TL;DR module.__spec__.parent is read-only but module.__package__ is r/w despite
documentation that implies that these two attributes should be identical, and
various issues that focus on migrating from direct module attributes to
ModuleSpec attributes
Change by Barry A. Warsaw :
--
nosy: +brett.cannon, eric.snow
___
Python tracker
<https://bugs.python.org/issue45540>
___
___
Python-bugs-list mailing list
Unsub
Barry A. Warsaw added the comment:
New changeset 876fc7fcec9a79a11546b7588d3683a5ccb4d31c by Barry Warsaw in
branch 'main':
bpo-35673: Add a public alias for namespace package __loader__ attribute
(#29049)
https://github.com/python/cpython/commit/876fc7fcec9a79a11546b7588d3683
Change by Barry A. Warsaw :
--
nosy: +barry
___
Python tracker
<https://bugs.python.org/issue38782>
___
___
Python-bugs-list mailing list
Unsubscribe:
Change by Barry A. Warsaw :
--
resolution: -> fixed
stage: patch review -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.or
Barry A. Warsaw added the comment:
On Oct 20, 2021, at 11:27, Brett Cannon wrote:
>
>> That should probably be a separate issue/PR in either case.
>
> https://bugs.python.org/issue38782 and I was trying to rope you into doing
> the work. 😁
Ha! You should have nosie
Barry A. Warsaw added the comment:
Does this mean that CWD could be in a directory that you couldn't chdir() back
into?
--
nosy: +barry
___
Python tracker
<https://bugs.python.org/is
Barry A. Warsaw added the comment:
On Oct 20, 2021, at 11:38, Eric Snow wrote:
>
> Regardless, I expect the primary reason __package__ is writable is
> because modules have never had any read-only attrs.
So historical accident mostly.
> The more important question now
Barry A. Warsaw added the comment:
On Oct 20, 2021, at 11:31, Brett Cannon wrote:
>
>> +1 on a proxy (with read-only attrs) for everything but __name__, __file__,
>> and __path__ (which can all be different than the spec).
>
> I'm -1 on a proxy as that doesn't
Barry A. Warsaw added the comment:
On Oct 20, 2021, at 08:18, Eric Snow wrote:
> The spec identifies how a module should be loaded (or how it was loaded and
> should be reloaded). We should be careful to preserve that identify and not
> invite uses to modify the spec after (or w
Barry A. Warsaw added the comment:
On Oct 20, 2021, at 08:28, Eric Snow wrote:
>
> The only catch I see is where the module's code sets one of the attrs. Would
> the proxy (or import machinery) pick those up, or maybe for some of them emit
> a warning or fail?
>
>
Barry A. Warsaw added the comment:
> Yes, precisely. Besides being an unreachable long abs path, it might have
> been deleted since last visited. I’m working on a few more odd test cases.
Ah, the deleted case. Sounds like LBYL wouldn’t work in that cas
Change by Barry A. Warsaw :
--
nosy: +barry
___
Python tracker
<https://bugs.python.org/issue45552>
___
___
Python-bugs-list mailing list
Unsubscribe:
Barry A. Warsaw added the comment:
Thank you for doing this work Irit! Just to point out that anybody who wants a
modern replacement for smtpd should look at aiosmtpd:
https://aiosmtpd.readthedocs.io/en/latest/
--
___
Python tracker
<ht
Barry A. Warsaw added the comment:
Thanks for your comprehensive comments Eric! While I digest them, my TL;DR is
that we probably need a PEP to describe everything from the current situation,
to the the desired end state and migration path. I'm willing to put that
together with yo
Barry A. Warsaw added the comment:
Does a LBYL strategy actually fix the problem? E.g. what if the directory gets
rm'd between __enter__ and __exit__? Maybe we shouldn't try to be clever at
all and just leave it to the user to decide what to do, and how to handle any
chdir-bac
Barry A. Warsaw added the comment:
> A LBYL won't always raise errors early as you point out. It will give earlier
> warnings for a lot of cases, but makes contextlib.chdir usable in less places
> than os.chdir.
> Some return paths will always be errors, and some wi
Change by Barry A. Warsaw :
--
nosy: +barry
___
Python tracker
<https://bugs.python.org/issue22789>
___
___
Python-bugs-list mailing list
Unsubscribe:
Change by Barry A. Warsaw :
--
nosy: +barry
___
Python tracker
<https://bugs.python.org/issue38743>
___
___
Python-bugs-list mailing list
Unsubscribe:
Barry A. Warsaw added the comment:
One simple restriction would be to disallow relative paths outside of the
resource anchor location.
--
___
Python tracker
<https://bugs.python.org/issue36
New submission from Felipe A. Hernandez :
os.rmtree has fd-based symlink replacement protection when iterating with
scandir (after bpo-28564).
This logic could be greatly simplified simply by os.fwalk in supported
platforms, which already implements a similar (maybe safer) protection
Felipe A. Hernandez added the comment:
After some tests, due the accumulating nature of fwalk, I've just realised it's
not very safe for big directories, so I'll be closing this issue.
Alternatively, using py37+ fd based scandir, and dir_fd unlink and rmdir calls
would re
New submission from Ananthakrishnan A S :
add a function called 'median' that we can use like:
list=[1,2,3,4,5,6,7,8,9] # declaring list
median(list) #returns 5
--
components: Library (Lib)
messages: 360873
nosy: Ananthakrishnan A S
priority: normal
severity: nor
New submission from Ananthakrishnan A S :
can we add an lcm and gcd function that can work as:
lcm(4,6) # returns 12
gcd(4,6) # returns 2
--
components: Library (Lib)
messages: 360875
nosy: Ananthakrishnan A S
priority: normal
severity: normal
status: open
title: can we add a lcm and
Ananthakrishnan A S added the comment:
I created this issue as i came across the following question:
There are n students in class A,and m students in class B.each class divides
into teams for a competition.What is the biggest possible team size that can be
divided,such that each team has
Ananthakrishnan A S added the comment:
Should i proceed with adding a pull request for adding a 'lcm' function in
python's math module.
--
___
Python tracker
<https://bugs.pyt
Ananthakrishnan A S added the comment:
some problems that needs lcm function:
1:find the least number which when divided by 'a','b','c','d' leaves remainder
'e' in each case.
2:person A exercises every 'n' days and person B every
Ananthakrishnan A S added the comment:
I agree with Vedran Čačić.As the modules are not made for one person but it is
for the ease of coding.There are so many functions which i don't use but used
by other people.We are using functions to make coding easy and if lcm function
is added
Ananthakrishnan A S added the comment:
Yes,I want to put together a PR.
--
___
Python tracker
<https://bugs.python.org/issue39479>
___
___
Python-bugs-list m
Change by Barry A. Warsaw :
--
nosy: +barry
___
Python tracker
<https://bugs.python.org/issue39791>
___
___
Python-bugs-list mailing list
Unsubscribe:
Change by Barry A. Warsaw :
--
nosy: +barry
___
Python tracker
<https://bugs.python.org/issue40453>
___
___
Python-bugs-list mailing list
Unsubscribe:
Barry A. Warsaw added the comment:
This issue was brought to the Python Steering Council, and we deliberated it at
today's SC meeting. With a vote of 4 approvals and one abstention, we have
approved the addition of this API.
--
nosy: +
Christopher A. Chavez added the comment:
This was already reported to Tcl/Tk:
https://core.tcl-lang.org/tk/info/855049e799 . They determined it was caused by
a bug in macOS 10.15.1. There are workarounds implemented for this in Tcl/Tk
8.6.10 and the upcoming 8.6.11 releases
Change by Barry A. Warsaw :
--
nosy: +barry, jaraco
___
Python tracker
<https://bugs.python.org/issue42728>
___
___
Python-bugs-list mailing list
Unsubscribe:
Barry A. Warsaw added the comment:
Thanks for the report and fix!
--
stage: patch review -> resolved
status: open -> closed
versions: +Python 3.10, Python 3.8, Python 3.9
___
Python tracker
<https://bugs.python.org/i
On 20.01.2021 12:07, STINNER Victor wrote:
> Maybe we should even go further in Python 3.10 and only split at "&" by
> default, but let the caller to opt-in for ";" separator as well.
+1.
Personally, I've never seen URLs encoded with ";" as query parameter
separator in practice on the server sid
On 17.02.2021 10:55, Anders Munch wrote:
import locale
locale.setlocale(locale.LC_ALL, 'en_DE')
> 'en_DE'
locale.getlocale()
> Traceback (most recent call last):
> File "", line 1, in
> File "C:\flonidan\env\Python38-64\lib\locale.py", line 591, in getlocale
> return _parse_
On 17.02.2021 15:02, Anders Munch wrote:
>> BTW: What is wxWidgets doing with the returned values ?
>
> wxWidgets doesn't call getlocale, it's a C++ library (wrapped by wxPython)
> that uses C setlocale.
>
> What does use getlocale is time.strptime and datetim
Barry A. Warsaw added the comment:
I don't think there's really anything more to do here. I'm closing the issue.
Let's open a new one if needed at some future point.
--
resolution: -> fixed
stage: patch review -> resol
Barry A. Warsaw added the comment:
Thanks for keeping the first 'F' in FLUFL! :D
--
___
Python tracker
<https://bugs.python.org/issue41251>
___
___
Felipe A. Hernandez added the comment:
import traceback
import multiprocessing.managers
class MyManager(multiprocessing.managers.SyncManager):
pass
class DictList(multiprocessing.managers.BaseProxy):
_method_to_typeid_ = {'__getitem__': 'dict'}
def _
Change by Felipe A. Hernandez :
--
components: +Library (Lib)
type: -> behavior
versions: +Python 3.5, Python 3.6, Python 3.7, Python 3.8, Python 3.9
___
Python tracker
<https://bugs.python.org/issu
New submission from Howard A. Landman :
I have a program qtd.py that reliably dies with free(): invalid pointer after
about 13 hours of runtime (on a RPi3B+). This is hard to debug because (1)
try:except: will not catch SIGABRT
(2) signal.signal(signal.SIGABRT, sigabrt_handler) also fails to
Change by Howard A. Landman :
--
hgrepos: -389
___
Python tracker
<https://bugs.python.org/issue41335>
___
___
Python-bugs-list mailing list
Unsubscribe:
Howard A. Landman added the comment:
This is not a memory leak problem. "Top" reports VIRT 21768 RES 13516 for the
whole run, and Python internal resource reporting says 13564 kb for the whole
run. So that's less than 1 kb leaked in 118.6M measurement cycles; mo
Howard A. Landman added the comment:
I don't think changing the documentation makes this not be a bug. My situation:
I have a Python 3.7.3 program that reliably dies (after about 13 hours, having
called its measure() method between 118.6M and 118.7M times) with free():
invalid po
Howard A. Landman added the comment:
After a quick glance at the source code for the spidev library, I think it is
unlikely but not impossible to be the home for the bug. It does do malloc() and
free(), but only for data that is greater than 256 bytes. Short tx and rx data
is kept in static
Howard A. Landman added the comment:
I'm running under 32-bit Raspbian, so let's assume the magic number is 13.
There are only two places in my own code where the number 13 appears:
(1) My result_list is 14 items long, i.e. 0 to 13. Relevant code from qtd.py:
cum_results = [0, 0,
Howard A. Landman added the comment:
Made some progress. By running it under gdb and breaking in malloc_printerr(),
I got a better stack trace:
Breakpoint 1, malloc_printerr (str=0x76e028f8 "free(): invalid pointer")
at malloc.c:5341
5341malloc.c: No such file or directory
Howard A. Landman added the comment:
Getting closer to isolating this. A small program that does nothing but call
read_regs24() over and over dies with the same error after about 107.4M
iterations. So it seems to be definitely in that method. But that only takes a
few hours, not half a day
Howard A. Landman added the comment:
It appears to be in the spidev library xfer method, when used for reading.
Calling that 107.4M times (using the same code as inside my read_regs24()
method) causes the free() error.
Breakpoint 1, malloc_printerr (str=0x76e028f8 "free(): invalid po
Howard A. Landman added the comment:
OK, this has been filed against the spidev library:
https://github.com/doceme/py-spidev/issues/107
Do you want it closed, or left open until that gets resolved?
--
resolution: -> third party
___
Python trac
Howard A. Landman added the comment:
As far as we can tell, this is a known Py_DECREF problem with spidev==3.4.
Testing on spidev==3.5 has not triggered the bug so far, so it appears to be
already fixed.
Under 3.4, changing the list to a tuple did not affect the behavior
New submission from D. A. Pellegrino :
The activate scripts created by the venv module do not pass checks by
ShellCheck (https://www.shellcheck.net/). ShellCheck generally has a point for
each warning and note generated against the venv activate scripts. Addressing
the ShellCheck reports
D. A. Pellegrino added the comment:
Leveraging GNU Parallel (https://www.gnu.org/software/parallel/) might help
simplify implementation. Perhaps that could be used as a subprocess call?
--
___
Python tracker
<https://bugs.python.org/issue37
On 23.09.2020 14:56, STINNER Victor wrote:
> Marc-Andre Lemburg explained:
>
> "There is no API to unregister a codec search function, since deregistration
> would break the codec cache used by the registry to speedup codec
> lookup."
>
> One simple solut
Just found an internal API which already takes care of
unregistering a search function: _PyCodec_Forget().
All that needs to be done is to expose this as codecs.unregister()
and add the clearing of the lookup cache.
--
Marc-Andre Lemburg
eGenix.com
Professional Python Services directly from
Barry A. Warsaw added the comment:
I agree that we should close this issue, possibly with a documentation fix. I
wrote a blog posting about my investigations:
https://wefearchange.org/2018/11/forkmacos.rst.html
I don't think there's really much Python itself can do, and devel
Change by Barry A. Warsaw :
--
versions: +Python 3.10
___
Python tracker
<https://bugs.python.org/issue37741>
___
___
Python-bugs-list mailing list
Unsubscribe:
Change by Barry A. Warsaw :
--
keywords: +patch
nosy: +barry
nosy_count: 1.0 -> 2.0
pull_requests: +21740
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/22775
___
Python tracker
<https://bugs.python.org/i
New submission from Barry A. Warsaw :
This is very likely caused by something janky my ISP (AT&T) is doing with IPv6,
but the above named test fails for me because IPv6 addresses like `::1q` do not
fail to resolve as the test expects.
I'm not sure what can or should be done about i
Barry A. Warsaw added the comment:
My understanding is that this is specifically a problem with the Objective-C
runtime that _scproxy.c accesses. The runtime is not thread safe and whereas
in earlier versions of macOS, it silently failed, now macOS is explicitly
aborting the process
Barry A. Warsaw added the comment:
Thanks everyone for the fixes; I think this bug is now resolved. Closing.
--
resolution: -> fixed
stage: patch review -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.or
Barry A. Warsaw added the comment:
Thank you all for the fix. Closing.
--
resolution: -> fixed
stage: patch review -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.or
Change by Barry A. Warsaw :
--
resolution: -> fixed
stage: patch review -> resolved
status: open -> closed
versions: +Python 3.10, Python 3.9 -Python 3.7
___
Python tracker
<https://bugs.python.or
Barry A. Warsaw added the comment:
Thanks for the PR @iritkatriel but I'm inclined to close this as won't fix.
There are plenty of other changes someone would need to migrate to Python 3 for
the email package, so I think this is of limited benefit.
--
resolution: -> w
Change by Barry A. Warsaw :
--
assignee: -> barry
___
Python tracker
<https://bugs.python.org/issue1823>
___
___
Python-bugs-list mailing list
Unsubscrib
Barry A. Warsaw added the comment:
Updating the Python versions to the only active ones on which this bug could
conceivably be fixed. I haven't validated that it's still a problem, and I
haven't decided whether it's appropriate to backport to 3.9 and 3.8.
I'll wo
901 - 1000 of 2560 matches
Mail list logo