New submission from Barry :
Raw strings create syntax error when last character is a backslash (\).
This problem seems to exist across all versions of python (that I have access
to)
Sample Code:
-
Under Windows Python 2.7.3
Works
New submission from Barry Schwartz :
The Objects/listsort.txt incorrectly implies that it is not possible to compute
leading zero bits in O(1) time, using only standard C. For a fixed integer size
it can be done, for instance, using de Bruijn sequences. See
https://www.chessprogramming.org
Barry Schwartz added the comment:
Yes. Actually the issue is branching, not order of complexity, because looping
at most 64 times is a linear-bounded operation. The methods I point out involve
no branching! And so can be rather fast. I don't suggest they be used, but that
the listsor
Barry Schwartz added the comment:
I meant constant bounded
--
___
Python tracker
<https://bugs.python.org/issue46488>
___
___
Python-bugs-list mailing list
Unsub
Barry Scott added the comment:
The attached patch builds on Mike's work.
The core of the problem is that the Request object
did not know what was going on. This means that it
was not possible for get_authorization() to work
for proxy-auth and www-auth.
I change Request to know which o
Barry Scott added the comment:
Attached is the code I used to test these changes.
See the README.txt file for details include
the results of a test run.
--
Added file: http://bugs.python.org/file20822/urllib2_tests.tar.gz
___
Python tracker
<h
Barry Scott added the comment:
I left out some white space changes to match the style
of the std lib code. Re posting with white space cleanup.
--
Added file: http://bugs.python.org/file20824/http_proxy_https.patch
___
Python tracker
<h
Changes by Barry Scott :
Removed file: http://bugs.python.org/file20821/http_proxy_https.patch
___
Python tracker
<http://bugs.python.org/issue7291>
___
___
Python-bug
New submission from Barry Davis :
This bug exists again: https://bugs.python.org/issue1521375
In ctypes/util we defend against gcc removing /dev/null by using a temp file,
but similar code for ld still uses /dev/null, resulting in it removing
/dev/null if it has permission, i.e. if running
New submission from Barry Muldrey :
site info is accessed externally via getusersitepackages() and getuserbase()...
for example see "pip/_internal/locations.py"
If ENABLE_USER_SITE is set to "False," or otherwise disabled,
accesses to these methods should return '
Change by Barry Muldrey :
--
keywords: +patch
pull_requests: +15888
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/16303
___
Python tracker
<https://bugs.python.org/issu
Anilyka Barry added the comment:
I'd forgotten that I did that. Looking back on it, this is indeed not a good
change. Since there hasn't been any traction on in for 5 years, I think it's
safe to say it's not something people want.
--
resolution: -> rejec
New submission from Barry McLarnon :
The error handling in mock.decorate_callable (3.5-3.7) and
mock.decoration_helper (3.8-3.9) is incorrectly implemented. If the error
handler is triggered in the loop, the `patching` variable is out of scope and
raises an unhandled `UnboundLocalError
Barry McLarnon added the comment:
After further investigation, it seems this was fixed in
https://github.com/python/cpython/commit/436c2b0d67da68465e709a96daac7340af3a5238
However, this fix was as part of an unrelated changeset and in a different
function in 3.8+, and was never rolled back
Change by Barry McLarnon :
--
components: +Library (Lib) -Tests
___
Python tracker
<https://bugs.python.org/issue40126>
___
___
Python-bugs-list mailin
Barry McLarnon added the comment:
Issue still exists in 3.7 and below, as it was part of a different function
before. Current PR doesn't resolve the original issue that was raised.
--
versions: +Python 3.5, Python 3.6
___
Python tracker
&
Barry Byford added the comment:
I was looking to control Bluetooth on Linux machines using the BlueZ Management
API available at:
https://git.kernel.org/pub/scm/bluetooth/bluez.git/tree/doc/mgmt-api.txt
The Bluetooth management sockets can be created by setting the hci_channel
member of
Barry Davis added the comment:
I've just hit this issue using Python-2.7.9, gcc-8.1.0, glibc-2.23.
The patch I made to fix the issue based on comments in this issue:
--- Python-2.7.9/setup.py 2019-01-25 09:30:39.049501423 +
+++ Python-2.7.9/setup.py 2019-01-25
Barry Davis added the comment:
The behaviour I saw (32-bit only) was a python process getting stuck.
I got this from strace:
...
futex(0xb5acc000, FUTEX_WAIT, 0, NULL) = -1 EAGAIN (Resource temporarily
unavailable)
futex(0xb5acc000, FUTEX_WAIT, 0, NULL) = -1 EAGAIN (Resource temporarily
Changes by Barry Davis :
--
versions: +Python 3.6
___
Python tracker
<http://bugs.python.org/issue18748>
___
___
Python-bugs-list mailing list
Unsubscribe:
Barry Davis added the comment:
I think this is the same issue I'm getting.
I'm hitting it when compiling python 3.6.2 compiled with gcc-4.8.4.
This wasn't occasional, it was every time I tried.
As a feeble workaround I was compiling in parallel, then in serial when it
fails, a
Changes by Emanuel Barry :
--
nosy: +haypo, serhiy.storchaka
stage: -> needs patch
type: -> behavior
___
Python tracker
<http://bugs.python.org/i
Barry Davis added the comment:
Looks like I was mistaken. My cross compiler was trying to load libgcc_s.so.1
from the standard location and not liking the one it found. Fixed for now by
setting LD_LIBRARY_PATH to point at the dir containing the right libgcc_s.so.1
--
versions
Barry Davis added the comment:
I meant my cross compiled python, not my cross compiler.
--
___
Python tracker
<http://bugs.python.org/issue18748>
___
___
Pytho
Emanuel Barry added the comment:
Unfortunately not. I no longer have the time or means to work on this, sorry. I
hope someone else can pick it up.
--
___
Python tracker
<https://bugs.python.org/issue28
Change by Emanuel Barry :
--
nosy: -ebarry
___
Python tracker
<https://bugs.python.org/issue28937>
___
___
Python-bugs-list mailing list
Unsubscribe:
New submission from Emanuel Barry :
This is a follow-up to Issue27364.
Back in Python 3.6, a silent warning was added for all invalid escape sequences
in str and bytes. It was suggested that it would remain a silent warning (which
still impacts tests, while not visually annoying the average
Emanuel Barry added the comment:
I have created Issue32912 as a follow-up to this issue for 3.8.
--
___
Python tracker
<https://bugs.python.org/issue27
Change by Emanuel Barry :
--
keywords: +patch
pull_requests: +5625
stage: needs patch -> patch review
___
Python tracker
<https://bugs.python.org/issu
Emanuel Barry added the comment:
The documentation is correct. The first argument in both of those cases is a
str, which may not be what you were expecting, but the calls are still valid.
--
nosy: +ebarry
resolution: -> not a bug
stage: -> resolved
status: open -&g
New submission from Barry Devlin :
The __bool__ method in the complex class in numbers is not tested.
--
components: Tests
messages: 315337
nosy: Barry Devlin
priority: normal
severity: normal
status: open
title: Increase test coverage for numbers.py
versions: Python 3.8
Barry Devlin added the comment:
Hey,
I updated my pull request based in your advice. Could you review it please?
Best,
Barry
On Sat, 21 Apr 2018, 03:20 Terry J. Reedy, wrote:
>
> Terry J. Reedy added the comment:
>
> Barry, thank you for your first submission.
>
> Y
Emanuel Barry added the comment:
This is because `exec` is a keyword in Python 2, whereas in Python 3 it's a
function.
--
nosy: +ebarry
resolution: -> not a bug
stage: -> resolved
status: open -> closed
___
Python t
Emanuel Barry added the comment:
Any valid variable name can be used as a an attribute; for example, "spam" is
valid while "spam-eggs" is not. This isn't unique to classes, but to all
assignments everywhere. If we allowed `o.exec = blah` then we should also allow
`e
Emanuel Barry added the comment:
`type` has a default `__format__` implementation which doesn't accept any
formatting options. This is expected behaviour.
--
nosy: +ebarry
resolution: -> not a bug
stage: -> resolved
status: ope
Change by Emanuel Barry :
--
Removed message: https://bugs.python.org/msg316153
___
Python tracker
<https://bugs.python.org/issue33423>
___
___
Python-bugs-list m
Emanuel Barry added the comment:
You don't have access to this feature, so I've deleted the message for you :)
--
nosy: +ebarry
___
Python tracker
<https://bugs.python.o
Emanuel Barry added the comment:
This is a known issue, and is properly explained here:
https://docs.python.org/3/faq/programming.html#why-does-a-tuple-i-item-raise-an-exception-when-the-addition-works
--
nosy: +ebarry
resolution: -> not a bug
stage: -> resolved
status
Emanuel Barry added the comment:
Nice initiative! I like the idea of moving towards more inclusive
documentation; as an addition, I would recommend using they/them/their instead
- it's less clumsy to read (also, singular they is perfectly valid English) and
includes everyone, even thos
New submission from Kevin Barry :
I have been trying to get PyRun_InteractiveLoop to run on a pty (Linux) without
replacing stdin and stdout with that pty; however, it seems like Python (2.6.6)
is hard-coded to only run interactively on stdin and stdout.
Compile the attached program with
Kevin Barry added the comment:
Here is a patch that corrects the problem (quoted below and attached.) This
only corrects the problem when 'PyOS_ReadlineFunctionPointer' is set, e.g. you
must 'import readline', otherwise Python will defer to stdin/stdout with
'PyOS_St
Kevin Barry added the comment:
I've attached a new example source file to demonstrate the fix.
Compile the attached program with (*after* patching and installing Python):
> gcc `python-config --cflags` working2.c -o working2 `python-config --ldflags`
and run it with:
> ./workin
Kevin Barry added the comment:
The patch from before needed a slight modification for when Python actually
defaults to an interactive session on stdin. Since I rebuild this for my
current distro (Slackware64 13.37,) I switched to the Python 2.6.6 source. This
might not be the proper way to
Kevin Barry added the comment:
I've attached a simplified example program (working3.c) that demonstrates both
the original problem and that the patch
(Python-2.6.6-Run_Interactive-fix.patch) works. It eliminates the need for a
pty, 'xterm', and redirection.
Compile the a
New submission from Barry Morrison:
Documentation here: http://docs.python.org/library/pipes.html makes no mention
of quote()
But the link to Source code: Lib/pipes.py
http://hg.python.org/cpython/file/2.7/Lib/pipes.py has:
267 def quote(file):
268 """Return a shell-escaped
Kevin Barry added the comment:
I still see the potential cause addressed by my patch in the 2.7, 3.3, and
"default" branches, so I'm assuming that all versions from 2.6 on have this
problem.
I also see that I can elect to change the "Status" and "Resolution"
Emanuel Barry added the comment:
Ow!
I can confirm the bug still happens on latest trunk. Nice finding!
--
nosy: +ebarry, ned.deily, rhettinger, serhiy.storchaka
priority: normal -> release blocker
stage: -> needs patch
___
Python tracker
Changes by Emanuel Barry :
--
nosy: +Martin.Teichmann
___
Python tracker
<http://bugs.python.org/issue28797>
___
___
Python-bugs-list mailing list
Unsubscribe:
Emanuel Barry added the comment:
Decorater: For very large projects, the switch from Python 2 to 3 is a
non-trivial task that can take up years of work, and there are many reasons why
one cannot switch.
On the issue, however, for all PyPi-related issues, please go to the PyPa
GitHub: https
Emanuel Barry added the comment:
Let's just close this.
--
nosy: +ebarry
resolution: -> rejected
stage: -> resolved
status: open -> closed
___
Python tracker
<http://bugs.pyth
Changes by Emanuel Barry :
--
nosy: +ebarry
___
Python tracker
<http://bugs.python.org/issue23722>
___
___
Python-bugs-list mailing list
Unsubscribe:
Emanuel Barry added the comment:
Additionally, trying to access an attribute before assigning it will result in
an AttributeError on all subsequent accesses (even if set).
I didn't manage to get a segfault, however.
--
nosy: +ebarry
___
P
Emanuel Barry added the comment:
Part of the copyright notice, as SilentGhost mentioned. This can't be removed.
--
nosy: +ebarry
resolution: -> not a bug
stage: -> resolved
status: open -> closed
___
Python tracker
<http:
Emanuel Barry added the comment:
As a matter of fact, A.__module__ in this case is abc.ABCMeta.__module__. A
class body creates a __module__ key, while a direct metaclass call does not.
--
nosy: +ebarry
___
Python tracker
<http://bugs.python.
Emanuel Barry added the comment:
Oh, nicely spotted! Apparently I was wrong, and it does create a key;
defaulting to __name__.
About the original issue, I don't think it's easily possible to fix, sadly.
--
___
Python trac
Emanuel Barry added the comment:
I understand the feeling. However, in a project I maintain, we want the other
way around - to be able to never have an empty list, even if the string is
empty (we resorted to using re.split in the end, which has this behaviour).
Consider:
rest = re.split
Emanuel Barry added the comment:
Changing the behaviour when sep is None is a big backwards-compatibility break,
and I'm not sure we'd even want that. It's logical to allow passing None to
mean the same thing as NULL (i.e. no arguments), and the behaviour in that case
has bee
Emanuel Barry added the comment:
That would work for my case, but it wouldn't for Barry's (unless I missed
something). He wants a non-None argument to not leave empty strings, but I want
a None argument to leave empty strings... I don't think there's a
one-size-fits-all s
Emanuel Barry added the comment:
Actually, there might be a way. We could make prune default to True if sep is
None, and default to False if sep is not None. That way, we get to keep the
existing behaviour for either case, while satisfying both of our use cases :)
If that's a bad idea (a
Emanuel Barry added the comment:
Matthew: Yes, that's exactly the way I was going about it.
Thank you Raymond for your comments (and your informative answer on that SO
question).
I think that part of the problem is that no delimiter (or None) behaves
differently than with a delimiter.
Emanuel Barry added the comment:
Here's an initial patch. It works exactly as discussed earlier, doesn't break
any tests, and retains full backwards compatibility. No doc changes (except for
the docstrings of str.[r]split) and no tests, as this is just a preliminary
patch to see
Emanuel Barry added the comment:
Yes, I agree that being able to pass in a tuple would be really useful. As far
as rolling out a custom function goes, I'd sooner reach for re.split than do
that, so I don't really have a strong argument for either side. Feel free to
play with the pat
Changes by Emanuel Barry :
Removed file: http://bugs.python.org/file45853/split_prune_1.patch
___
Python tracker
<http://bugs.python.org/issue28937>
___
___
Python-bug
Emanuel Barry added the comment:
Barry: Sure, the docs example was just a quick write-up, you can word it
however you want!
Guido: Pretty much, except the other way around (when prune is False, i.e.
"don't remove empty strings").
The attached patch exposes the behaviour (it
Emanuel Barry added the comment:
That indeed looks like a bug. Well spotted :)
That code has been there since unittest.mock was added back in March 2012. If I
were to guess, I'd say that it should be `if name is None: name = ''`. Care to
submit a patch?
-
Changes by Emanuel Barry :
--
stage: needs patch -> commit review
___
Python tracker
<http://bugs.python.org/issue28961>
___
___
Python-bugs-list mai
Emanuel Barry added the comment:
LGTM. Thanks for the patch!
--
nosy: +ebarry
stage: -> commit review
___
Python tracker
<http://bugs.python.org/issu
Emanuel Barry added the comment:
The reason why Python behaves like that in this case is a side-effect of the
way the data model is implemented. Lists are a mutable data type, which means
that referencing the same list - which is what you are doing - as opposed to
creating a new one each time
New submission from Emanuel Barry:
functools.partial is a class in C, but the Python implementation is a function.
This doesn't matter for most use cases where you only want the end result of
the call to partial.
A simple line in the REPL tells me enough (or so I thought) that I wou
Emanuel Barry added the comment:
You do raise a valid point, sequence repetition (*) on lists of mutable objects
serves very little purpose. However, as I stated, it is a side-effect of the
data model and changing it would be yet another special case, which aren't
special enough to brea
Emanuel Barry added the comment:
Attached patch turns the Python implementation of functools.partial into a
class. The implementation is as close to the C version as possible, except
__repr__ where I went for a different, more Pythonic approach (output is
identical).
I haven't yet
Emanuel Barry added the comment:
Serhiy, it seems as though _functools is always required for functools to work
- heck, tests start to fail all over the place if it isn't available, because
functools.reduce doesn't exist.
Subclassing _functools.partial is already tested for, so
Emanuel Barry added the comment:
Functionally, both versions are equivalent, but one is a class and the other is
not. From PEP 399:
"Technical details of the VM providing the accelerated code are allowed to
differ as necessary, e.g., a class being a `type` when implemented in C."
Changes by Emanuel Barry :
--
Removed message: http://bugs.python.org/msg266608
___
Python tracker
<http://bugs.python.org/issue27129>
___
___
Python-bugs-list m
Changes by Emanuel Barry :
--
Removed message: http://bugs.python.org/msg266607
___
Python tracker
<http://bugs.python.org/issue27129>
___
___
Python-bugs-list m
Emanuel Barry added the comment:
A negative return code generally means an error occurred. Negating retcode here
is equivalent to abs(retcode), which shows you want a positive integer to
appear in the message - it's not an error.
Could replace '-retcode' with 'abs(retcod
Emanuel Barry added the comment:
Works for me:
>>> class X(type): pass
...
>>> X(X)
--
nosy: +ebarry
resolution: -> works for me
stage: -> resolved
status: open -> closed
___
Python tracker
<htt
Emanuel Barry added the comment:
Works for me:
>>> class meta(type): pass
...
>>> class X(type, metaclass=meta): pass
...
>>> X.__class__ = X
>>> type(X) is X
True
>>> isinstance(X, X)
True
--
nosy: +ebarry
resolution: -> works f
Emanuel Barry added the comment:
This seems as though you might be using an older version of the interpreter (I
tested in 3.4.3, 3.5.1 and 3.6.0a1+). Where did you get your interpreter? The
official releases are on https://www.python.org/downloads/ - if you got it
somewhere else, that might
Emanuel Barry added the comment:
In Objects/typeobject.c#L2290, the code checks that the (meta?)class is exactly
`type` and that there's one argument, then returns `Py_TYPE(x)`. Subclasses of
`type` allowing a single argument is a side-effect of not overriding __new__,
not a docum
Emanuel Barry added the comment:
Yes, that would be preferable. The error message is at
Objects/typeobject.c#l2301, but keep in mind that this message is shown for
both faulty calls to type() as well as any of its subclasses that don't
override __new__, and I'm lukewarm on add
Emanuel Barry added the comment:
+1. I prefer that change, as using subclasses of `type` as if they were type
itself never made sense to me. This shouldn't break existing code, but if it
does, it was either a concealed bug or a very bad idea to begin with, and
should be fixed eithe
Changes by Emanuel Barry :
--
stage: needs patch -> patch review
___
Python tracker
<http://bugs.python.org/issue27157>
___
___
Python-bugs-list mailing list
Un
Emanuel Barry added the comment:
Yes, `metatype == &PyType_Type` makes sure that only `type` itself is valid for
the one-argument part, whereas subclasses can also do so right now. I clarified
that in a comment in the new patch, so that someone doesn't accidentally revert
this,
Changes by Emanuel Barry :
--
resolution: -> not a bug
stage: -> resolved
status: open -> closed
___
Python tracker
<http://bugs.python.org/issue27160>
___
___
Emanuel Barry added the comment:
In other words, you cannot use keys containing a colon in str.format - you'll
need to replace the colons by something else (for example an underscore, that
works fine).
--
nosy: +ebarry
___
Python tracker
Emanuel Barry added the comment:
New patch after Serhiy's comments. I kept the __dict__ in pickling to properly
pickle attributes that aren't defined by 'partial' itself; but if 'func',
'args' or 'keywords' are present and don't match
Emanuel Barry added the comment:
Fair enough. Should this get a note in What's new? Possibly in the "Changes in
Python API" section.
--
stage: patch review -> commit review
versions: +Python 3.6 -Python 2.7, Python 3.4
___
Pyt
Emanuel Barry added the comment:
The behaviour is correct, it's your assumptions that aren't :)
The code for str.format only checks for what's before the colon (here, "HGNC")
and checks if that's part of the dict provided. It isn't, so it raises a
KeyError
Emanuel Barry added the comment:
Let me just make sure I got you right - you're fine with `type` and only `type`
being able to use the one-argument form in 3.6, but prefer 3.5 and 2.7 to be
even more permissive than they currently are? Regardless, I don't think this
should go int
Changes by Emanuel Barry :
--
Removed message: http://bugs.python.org/msg266711
___
Python tracker
<http://bugs.python.org/issue27157>
___
___
Python-bugs-list m
Emanuel Barry added the comment:
New patch with tests and documentation. I didn't really know where to put the
tests; test_types seemed reasonable to me (other option was test_metaclass).
--
stage: test needed -> commit review
___
Python
Changes by Emanuel Barry :
Added file: http://bugs.python.org/file43060/type_one_argument_3.patch
___
Python tracker
<http://bugs.python.org/issue27157>
___
___
Python-bug
Emanuel Barry added the comment:
New patch with Berker's comments. I'm really not used to Sphinx markup so
thanks for that!
> Is there any person who really thinks that their own patch is *not* ready for
> commit review? :)
Partial patches aren't that uncommon in
Changes by Emanuel Barry :
--
Removed message: http://bugs.python.org/msg266751
___
Python tracker
<http://bugs.python.org/issue27166>
___
___
Python-bugs-list m
Changes by Emanuel Barry :
--
resolution: -> not a bug
stage: -> resolved
status: open -> closed
___
Python tracker
<http://bugs.python.org/issue27166>
___
___
Changes by Emanuel Barry :
--
resolution: -> fixed
stage: patch review -> resolved
___
Python tracker
<http://bugs.python.org/issue21271>
___
___
Pyth
Changes by Emanuel Barry :
--
resolution: -> duplicate
stage: -> resolved
status: open -> closed
superseder: -> Tkinter Unresponsive With Special Keys
___
Python tracker
<http://bugs.python
Changes by Emanuel Barry :
--
components: +Extension Modules
stage: -> needs patch
type: -> behavior
___
Python tracker
<http://bugs.python.org/i
Emanuel Barry added the comment:
I'd probably change all instances of ".*" in the regex matches to be "0x.+"
instead. For the docstrings that have "..." in them, I would probably make
those " at ..." as well (although you get decide if it hinders r
1 - 100 of 2685 matches
Mail list logo