Simon Willison added the comment:
It looks like the relevant test is here:
https://github.com/python/cpython/blob/a1092f62492a3fcd6195bea94eccf8d5a300acb1/Lib/test/test_asyncio/test_locks.py#L722-L727
def test_explicit_lock(self):
lock = asyncio.Lock()
cond
Change by Simon McVittie :
--
keywords: +patch
nosy: +smcv
nosy_count: 1.0 -> 2.0
pull_requests: +27431
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/29154
___
Python tracker
<https://bugs.python.org/i
Change by Simon Friedberger :
--
type: -> enhancement
___
Python tracker
<https://bugs.python.org/issue38789>
___
___
Python-bugs-list mailing list
Unsubscrib
New submission from Simon Friedberger :
It seems there is no easy way to use difflib to show a diff but only when there
actually are differences. The SequenceMatcher has ratio() but that isn't really
available through Differ or any of the convenience functions. Vice versa, when
Simon Friedberger added the comment:
Hi Tim!
Sorry, if my explanation wasn't clear.
For some of the iterators - like the one produced by ndiff - the iterator will
always return data, even if there is no difference in the files.
My current solution is to run difflib.unified_diff and
Simon Friedberger added the comment:
And, just to state this explicitly, I think you are right that there are
general idioms for checking if a generator can produce an item but I think it
would be nicer if iterators which could do this is in a cheap way (like in this
case) would allow it
New submission from Simon Berens :
Sorry if this is a silly question (my first bug report), but it seems that
https://docs.python.org/3/library/functions.html#func-tuple
should say "class tuple" instead of just "tuple", as list, dict, and set do.
--
assignee: do
New submission from Simon Willison :
Bit of an obscure bug this one. SQLite allows column names to contain [ and ]
characters, even though those are often used as delimiters in SQLite. Here's
how to create such a database with bash:
```
sqlite3 /tmp/demo.db <
In [5]: cursor.
Change by Simon Willison :
--
type: -> behavior
___
Python tracker
<https://bugs.python.org/issue39652>
___
___
Python-bugs-list mailing list
Unsubscrib
Simon Willison added the comment:
Oh how interesting - yes it looks like this is deliberate behavior introduced
in this commit:
https://github.com/python/cpython/commit/0e3f591aeeef9ed715f8770320f4c4c7332a8794
--
___
Python tracker
<ht
New submission from Simon Biggs :
Since asm.js came on the scene, and now Web Assembly people have created
CPython patches to support building CPython with emscripten. See:
* https://github.com/PeachPy/EmCPython -- Python 2.7
* https://github.com/dgym/cpython-emscripten/tree/master/3.5.2
Simon Biggs added the comment:
Hi pmp-p and Serhiy,
I'd be more than happy to attempt a pull request, but I imagine a change
such as this needs to be discussed first, trying not to "rush to make a
patch" (https://www.youtube.com/watch?v=voXVTjwnn-U&feature=youtu.be&t
Simon Percivall added the comment:
Any and all code from astunparse is certainly available for inclusion. Go ahead.
--
nosy: +simon.percivall
___
Python tracker
<https://bugs.python.org/issue28
New submission from Simon Willison :
When I search Google for a Python related term (e.g. "sqlite3 row" - see
attached screenshot) I get back two results - one for the Python 2
documentation and one for the Python 3 documentation.
There is currently no indicator which result is
Simon Willison added the comment:
I asked about this on Twitter and got a couple of tips from Google engineers:
https://twitter.com/simonw/status/1258767730263552000
It sounds like a good solution would be to explicitly design the breadcrumbs
using this mechanism:
https
New submission from Simon Willison :
asyncio.sleep(0) is the recommended idiom for co-operatively yielding control
of the event loop to another task: https://github.com/python/asyncio/issues/284
and https://til.simonwillison.net/python/yielding-in-asyncio
This isn't currently explain
Change by Simon Willison :
--
keywords: +patch
pull_requests: +22845
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/24002
___
Python tracker
<https://bugs.python.org/issu
New submission from simon mackenzie :
os.readlink gives wrong result on python 3.8 onwards for windows
os.readlink("c:/users/simon/v1")
'?\\d:\\v1'
Should read d:\\v1
--
components: Windows
messages: 385218
nosy: paul.moore, simon mackenzie, steve.dower, t
simon mackenzie added the comment:
For most people the expectation would be that it returns a path in the same
format as any other path. Furthermore it seems odd to change the default
behaviour after years when it worked as expected. I never heard of this
substitute path before and it does not
simon mackenzie added the comment:
I note os.path.realpath("v1") does produce the right path in windows. Maybe
that is what you meant. Will that work cross-platform?
On Tue, 19 Jan 2021 at 18:48, simon mackenzie wrote:
> For most people the expectation would be that it returns
New submission from Simon Munday :
If I attempt to import an extension module via something like this:
from pkg import extmodule
and it happens that "pkg" is found in a folder that is given in sys.path as a
relative path, then the import fails, with
ImportError: DLL load fa
Change by Simon Munday :
--
title: Can't import extension modules resolved via relative paths in sys.path
on Windows don't don't -> Can't import extension modules resolved via relative
paths in sys.path on Windows
___
Change by Simon Charette :
--
nosy: +charettes
___
Python tracker
<https://bugs.python.org/issue12029>
___
___
Python-bugs-list mailing list
Unsubscribe:
New submission from Simon Cross :
The documentation for PyNumber_InPlacePower [1] reads:
This is the equivalent of the Python statement o1 **= o2 when o3 is Py_None, or
an in-place variant of pow(o1, o2, o3) otherwise. If o3 is to be ignored, pass
Py_None in its place (passing NULL for o3
Simon Cross added the comment:
The documentation for __ipow__ [4] suggests that the intention was to support
the modulus argument, so perhaps that argues for fixing the behaviour of
PyNumber_InPlacePower.
[4] https://docs.python.org/3/reference/datamodel.html#object.__ipow__
Change by Simon Cross :
--
nosy: +hodgestar
___
Python tracker
<https://bugs.python.org/issue42262>
___
___
Python-bugs-list mailing list
Unsubscribe:
Simon Sapin added the comment:
heapq_merge_key_duplicate.patch is a new patch with two code path. It also
updates the function’s docstring (which the previous patch did not). Raymond,
do you think the speed is worth the DRY violation?
--
Added file: http://bugs.python.org/file24248
New submission from Simon Chopin :
This issue occurred at least in Python 2.7, I haven't checked in other versions.
When stepping on a return statement, pdb calls the return value __str__()
method to display it at the end of the line. Only, it doesn't handle the
potential excepti
Simon Jagoe added the comment:
In the script attached to the original issue, the weakref callback that causes
the hang is the callback defined in ThreadPoolExecutor._adjust_thread_count
Attached is a faulthandler stack captured from Python 3.6.1. The script
submitted here uses a patched
Simon Ruggier added the comment:
I hit this problem today with what I'd consider a valid use case: I wanted to
use a static method as a default argument to a function on the same class.
Within the class definition context, automatic unwrapping of the staticmethod
object doesn't
New submission from Simon Fagerholm :
When "python -m unittest discover" is run in a folder that is an implicit
namespace package with the structure as below, no tests are discovered.
The condition that the tests must be importable from the top level directory is
fulfilled and has b
Simon Fagerholm added the comment:
Issue originally from SO:
https://stackoverflow.com/questions/46976256/recursive-unittest-discovery-with-python3-and-without-init-py-files
--
___
Python tracker
<https://bugs.python.org/issue35
Simon Fagerholm added the comment:
Martin: Yeah, they same to be same! Can't believe I didn't find it
--
___
Python tracker
<https://bugs.python.o
New submission from Simon Percivall:
For classes with ForwardRef annotations, typing.get_type_hints is unusable.
As example, we have two files:
a.py:
class Base:
a: 'A'
class A:
pass
b.py:
from a import Base
class MyClass(Base):
b: 'B'
class B:
pass
&g
Simon Percivall added the comment:
It think it's important to document this caveat in `get_type_hints`, that there
is virtually _no_ way to use it safely with a class, and that there will always
be a high risk of getting an exception unless using this function in a highly
controlled se
Change by Simon Lipp :
--
nosy: +sloonz
___
Python tracker
<https://bugs.python.org/issue24255>
___
___
Python-bugs-list mailing list
Unsubscribe:
New submission from Simon Bouchard :
The clear list function call in made after the put(data) on the queue. But the
data is sometime clear in the queue (randomly). Since both function are call
within the same process, a race condition is not expected.
--
files: code.py
messages
New submission from Simon Lipp :
>From current `os` documentation:
> A file descriptor has an “inheritable” flag which indicates if the file
> descriptor can be inherited by child processes
from current `subprocess` documentation:
> If close_fds is true, all file descriptors exc
Simon Charette added the comment:
I stumble upon this bug when porting a Python 2 codebase to 3 and suddenly got
a NameError for the following code.
class Foo:
a = [1,2,3]
b = [4,5,6]
c = [x * y for x in a for y in b]
NameError: name 'b' is not de
Change by Simon Baird :
--
nosy: -sbaird
___
Python tracker
<https://bugs.python.org/issue12345>
___
___
Python-bugs-list mailing list
Unsubscribe:
New submission from Noah Simon :
It would be very useful to add an asynchronous lambda syntax, as a shortcut for
coroutines. I'm not experienced enough to write a PEP or edit the C source, but
I have some ideas for syntax:
import asyncio
foo = async lambda a,b: 5 + await
Noah Simon added the comment:
Actually, you wouldn't even need to import asyncio.
--
___
Python tracker
<https://bugs.python.org/issue33447>
___
___
Pytho
New submission from Simon Descarpentries :
I, it's my 1st post here. I'm a French computer-science engineer with 10 years
XP and manager at Acoeuro.com SSLL compagny. I suggested a better regexp
integration on python-ideas a few months ago failing to convince getting things
done
Simon Descarpentries added the comment:
Hi,
I missed the part of the doc you pointed out, being focused on ratio()
function family.
Thanks for your gentle reply.
--
___
Python tracker
<https://bugs.python.org/issue31
New submission from Simon Lambourn :
If you assign a ConfigParser section back to the parent ConfigParser object
(say after updating the section), the section is emptied.
(I realise now that you don't need to assign the section back to the parent as
it's a proxy for the section in
New submission from Simon Depiets :
A couple of users have been having issues on console output since the Fall 2017
Creator Update on Windows 10
An OSError is triggered randomly when rewriting data on the console (typically
with progress bars, for instance when you install a module with pip
Simon Depiets added the comment:
The issue doesn't seem to happen on either 3.6 (with the new stdio mode) or
with win_unicode_console enabled.
I was able to reproduce it on 3.6 with the PYTHONLEGACYWINDOWSSTDIO flag
enabled, it's easier to trigger when using directional keys or mo
Change by Simon Sapin :
--
nosy: +ssapin
___
Python tracker
<https://bugs.python.org/issue33698>
___
___
Python-bugs-list mailing list
Unsubscribe:
New submission from Simon Sapin :
https://docs.python.org/3/library/sys.html#sys.path documents:
> As initialized upon program startup, the first item of this list, path[0], is
> the directory containing the script that was used to invoke the Python
> interpreter.
On Window
Simon Sapin added the comment:
Removing python37._pth restores the documented behavior, I don’t know if it has
adverse effects.
--
___
Python tracker
<https://bugs.python.org/issue34
New submission from Simon Wells :
if you didn't build python as a framework it adds
sysconfig.get_config_vars('LINKFORSHARED') when you run 'python-config
--ldflags' this resolves to
>>> sysconfig.get_config_var('LINKFORSHARED')
'-Wl,-stack_si
Simon Wells added the comment:
with a fresh 3.7.0 download
./configure --prefix=... --enable-shared
make -j5
make install
path/to/python3-config --ldflags
-lpython3.7m -ldl -framework CoreFoundation -Wl,-stack_size,100 -framework
CoreFoundation
Simon Wells added the comment:
ah ok, sorry i wasn't clear at first, the issue isn't when building python its
when building a library which depends on python in this case libxml2, which
when given the --enable-python stuff uses
"PYTHON_LIBS=`python$PYTHON_VERSION-config
Simon Wells added the comment:
oh the rabbit hole...
as i have other builds of python3.7 on my system i wanted to ensure it used the
correct python and python-config (python 3.7 was built and installed into
$HOME/Projects/python/inst/) as such its a rather convoluted configure command
for
New submission from Simon Feltman:
This was a bit unexpected as memoryviews support all the methods of the
Sequence abstract base class:
>>> import collections
>>> b = bytearray(b'asdf')
>>> isinstance(b, collections.Sequence)
True
>>> m = memory
Changes by Simon Charette :
--
nosy: +charettes
___
Python tracker
<http://bugs.python.org/issue11798>
___
___
Python-bugs-list mailing list
Unsubscribe:
New submission from Simon Hayward :
HOWTOs - Argparse Tutorial, the code example will raise a syntax error when
run. A trailing python3 reference (if called as a function): 'end=""', to
suppresses a newline remains.
print "{}^{} == ".format(args.x, args.y
Simon Sapin added the comment:
I just remembered about this. I suppose it is too late for 3.3?
--
___
Python tracker
<http://bugs.python.org/issue13742>
___
___
New submission from Simon Feltman:
This came up while trying to build pygobject with Python 3.3. The problem is
there are some erroneous imports in the fromlist with these bindings that can
easily be fixed. But it is a behavioral change so I just wanted to raise
awareness if it is not already
Changes by Simon Feltman :
--
type: -> behavior
___
Python tracker
<http://bugs.python.org/issue15715>
___
___
Python-bugs-list mailing list
Unsubscri
Simon Feltman added the comment:
I think pygobject still supports Python 2.5 which it look like importlib is
available.
I've submitted a patch to pygobject which will work regardless of if this
regression is fixed or not: https://bugzilla.gnome.org/show_bug.cgi?id=6
Simon Feltman added the comment:
Should have been "...Python 2.5 which it looks like importlib is NOT available."
--
___
Python tracker
<http://bugs.python.o
New submission from Simon R:
I've simply tested the example reported in the py3k documentation, and it don't
works.
See the site:
http://docs.python.org/py3k/library/multiprocessing.html?highlight=multiprocessing#module-multiprocessing.sharedctypes
The program exit with this error:
New submission from Simon Blanchard:
_LegalCharsPatt = r"[\w\d!#%&'~_`><@,:/\$\*\+\-\.\^\|\)\(\?\}\{\=]"
The above regex in cookies.py includes the the comma character but RFC 6265
https://tools.ietf.org/html/rfc6265 section 4.1.1 says:
cookie-octet = %x21 / %x
New submission from Simon Jagoe:
At Enthought we have been tracking a deadlock in some code that turned out to
be due to the following scenario:
0) There is some cyclic garbage that requires collection; an object in the
garbage is referred to by a weakref with a callback
1) You have a
Simon Zack added the comment:
The problem is still present in python 3.4 with mingw gcc 4.8.2. I was having
trouble with compiling radare2's python swig bindings.
The solution described here:
http://ascend4.org/Setting_up_a_MinGW-w64_build_environment#Setup_Python_for_compilation_of_exten
Simon Blanchard added the comment:
I have a real world example. Using Apache, mod_wsgi and Django. Given this in
the META dict:
'HTTP_COOKIE': 'yaean_djsession=23ab7bf8b260cbb2f2bc80b1c1fd98fa,
yaean_yasession=ff2a3030ee3f428f91c6f554a63b459c',
Django via the Python c
Simon Blanchard added the comment:
'HTTP_USER_AGENT': 'Mozilla/5.0 (compatible; Baiduspider/2.0;
+http://www.baidu.com/search/spider.html)',
It's the Baidu spider according to the user agent string. (Baidu is the biggest
search engine in China.) The serving app is D
New submission from Simon Law:
The documentation in Python 2.7, 3.2, and 3.3 claim that:
PyObject* PySequence_Fast(PyObject *o, const char *m)
Return value: New reference.
Returns the sequence o as a tuple, unless it is already a tuple or list, in
which case o is returned...
Unfortunately
Simon Law added the comment:
It looks like this was caught in the 3.3 branch, but only fixed it in the
comment:
changeset: 75448:d8f68195210e
user:Larry Hastings
date:Mon Mar 05 22:59:13 2012 -0800
summary: Fix a comment: PySequence_Fast() creates a list, not a tuple
Simon Law added the comment:
>> But patching the module to allow explicitly setting dest via keyword
>> argument shouldn't hurt anybody.
>
> I agree that it wouldn't hurt anybody. If you can find a way to do
> this, feel free to provide a patch.
>
> However,
Simon Law added the comment:
Sorry, there was a small typo in the previous patch. Here's the newer version.
--
Added file: http://bugs.python.org/file27860/15125-1.patch
___
Python tracker
<http://bugs.python.org/is
Simon Law added the comment:
Note that 15125-1.patch applies to Python 2.7 cleanly as it is a bugfix.
--
___
Python tracker
<http://bugs.python.org/issue15
Simon Law added the comment:
15125-2.patch applies to the default branch.
It makes dest behave the same for positional and optional arguments in terms of
name mangling.
Also, there is a backward-compatibility path in Namespace to support old-style
getattr() access. However, it'
New submission from Simon Law:
If you look at the implementation of deque.rotate(), it does the equivalent of
deque.append(deque.popleft()) or deque.appendleft(deque.pop()).
Unfortunately, for larger rotations, the pop() and append() calls just do too
much work. Since the documentation
New submission from Simon Feltman:
This is a feature request to include a "WeakMethod" or similar object to the
weakref module. The object decomposes a bound method and holds a weakref to the
object and unbound function. This can be a very useful utility in signal and ui
based p
Simon Feltman added the comment:
Indeed a duplicate of: http://bugs.python.org/issue14631
--
resolution: -> duplicate
status: open -> closed
___
Python tracker
<http://bugs.python.org/i
Simon Feltman added the comment:
Just a note this is also referred to as a "WeakMethod" by some folks (so this
ticket shows up in those searches). See also:
http://bugs.python.org/issue813299
http://bugs.python.org/issue7464
http://bugs.python.org/
Simon Feltman added the comment:
The WeakCallableRef that was attached seemed to support regular functions (or
anything callable) which is nice. The naming also leaves room for a
WeakCallableProxy.
--
___
Python tracker
<http://bugs.python.
Simon Feltman added the comment:
Some more complex examples from various libraries:
https://github.com/django/django/blob/master/django/dispatch/saferef.py
https://github.com/11craft/louie/blob/master/louie/saferef.py
I think both of these originated in pydispatcher
Changes by Simon Law :
--
nosy: +sfllaw
___
Python tracker
<http://bugs.python.org/issue9974>
___
___
Python-bugs-list mailing list
Unsubscribe:
http://mail.pyth
Simon Law added the comment:
Raymond, looking at your patch, can we assert that deque->leftblock is never
equal to deque->rightblock? If not, you need to use memmove() instead of
memcpy(), which is unsafe for overlapping arrays.
It is not clear to me that this invariant is true. At th
Simon Naish added the comment:
I am using double backslashes in my path.
But logger\config.py is losing them, please re-read the issue description,
logger\config.py is part of the python libraries!
--
___
Python tracker
<http://bugs.python.
New submission from Simon Naish:
When attempting to use a config file with logging to set up a series of loggers
in a script, when running on windows, if the config file name starts with an
'r' then the script fails with the following error:-
File "C:\Users\simon\Docum
Simon Naish added the comment:
Example proggie.
It writes its own config file (really_cool_logging.conf), then attempts to read
it, all to ~/testlog
If you inherit from the class FileLogger with any other class you get instant
access to self.log. which will write debug and above to
Simon Naish added the comment:
Updated TestFileLogger, missed a line out in my rush to get you something,
sorry!
--
Added file: http://bugs.python.org/file32545/TestFileLogger.py
___
Python tracker
<http://bugs.python.org/issue19
Simon Naish added the comment:
And again. Damn!
--
Added file: http://bugs.python.org/file32546/TestFileLogger.py
___
Python tracker
<http://bugs.python.org/issue19
Simon Naish added the comment:
Hi Peter,
Oh well spotted!
Fair enough, but that is seriously not obvious, thanks.
Si
--
___
Python tracker
<http://bugs.python.org/issue19
New submission from Simon Weber:
In http://bugs.python.org/issue14864, this line was added to the
logging.disable docstring:
To undo the effect of a call to logging.disable(lvl), call
logging.disable(logging.NOTSET).
To prevent misunderstanding, I propose that this line be changed to
Simon Weber added the comment:
That sounds much clearer. Thanks!
--
___
Python tracker
<http://bugs.python.org/issue19789>
___
___
Python-bugs-list mailin
New submission from Simon Zack:
The python unittest module currently uses camel case. This feels rather
inconsistent with the rest of the python library, which is in lower case and
follows PEP8.
Would it be a good idea to add lower-case aliases, and possibly deprecate the
camel case methods
New submission from Simon Weber:
When dealing with implicit relative imports of the form "import
as...", the 2to3 import fixer will rewrite them as "from .
import as...".
This is invalid syntax. Here's an example:
$ tree package/
package/
├── __init__.py
├──
New submission from Simon Zack:
Functions added by addTypeEqualityFunc is not used for comparing list elements
in assertListEqual, and only used in assertEqual.
It would be nice to have assertListEqual use functions added by
addTypeEqualityFunc for comparisons of list elements. I think this
Changes by Simon Zack :
--
type: -> enhancement
___
Python tracker
<http://bugs.python.org/issue22452>
___
___
Python-bugs-list mailing list
Unsubscrib
New submission from Simon Sapin:
When given a file-like object, html5lib calls .read(0) in order to check if the
result is bytes or Unicode:
https://github.com/html5lib/html5lib-python/blob/e269a2fd0aafcd83af7cf1e65bba65c0e5a2c18b/html5lib/inputstream.py#L434
When given the result of
Simon Sapin added the comment:
Adding a proposed patch.
--
keywords: +patch
Added file: http://bugs.python.org/file33179/python-issue20007.diff
___
Python tracker
<http://bugs.python.org/issue20
Simon Sapin added the comment:
html5lib issue: https://github.com/html5lib/html5lib-python/issues/127
--
___
Python tracker
<http://bugs.python.org/issue20
Simon Sapin added the comment:
I could reproduce on 3.3.3 and tip, but not 3.2.3 or 2.7.6.
--
versions: +Python 3.5 -Python 2.7
___
Python tracker
<http://bugs.python.org/issue20
Simon Cross added the comment:
Genshi is affected by the 3.4 regression too (it has a class that defines
__getnewargs__ and __getattr__).
--
nosy: +hodgestar
___
Python tracker
<http://bugs.python.org/issue16
Simon Cross added the comment:
I have an ugly work-around for those affected:
def __getattr__(self, name):
# work around for pickle bug in Python 3.4
# see http://bugs.python.org/issue16251
if name == "__getnewargs_ex__":
raise AttributeError(
101 - 200 of 275 matches
Mail list logo