[issue45416] "loop argument must agree with lock" instantiating asyncio.Condition

2021-10-08 Thread Simon Willison
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

[issue43137] webbrowser to support "gio open "

2021-10-22 Thread Simon McVittie
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

[issue38789] difflib lacks a way to check if results are empty

2019-11-13 Thread Simon Friedberger
Change by Simon Friedberger : -- type: -> enhancement ___ Python tracker <https://bugs.python.org/issue38789> ___ ___ Python-bugs-list mailing list Unsubscrib

[issue38789] difflib lacks a way to check if results are empty

2019-11-13 Thread Simon Friedberger
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

[issue38789] difflib lacks a way to check if results are empty

2019-11-18 Thread Simon Friedberger
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

[issue38789] difflib lacks a way to check if results are empty

2019-11-18 Thread Simon Friedberger
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

[issue39112] Misleading documentation for tuple

2019-12-20 Thread Simon Berens
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

[issue39652] sqlite3 bug handling column names that contain square braces

2020-02-16 Thread Simon Willison
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.

[issue39652] sqlite3 bug handling column names that contain square braces

2020-02-16 Thread Simon Willison
Change by Simon Willison : -- type: -> behavior ___ Python tracker <https://bugs.python.org/issue39652> ___ ___ Python-bugs-list mailing list Unsubscrib

[issue39652] sqlite3 bug handling column names that contain square braces

2020-02-16 Thread Simon Willison
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

[issue40280] Consider supporting emscripten/webassembly as a build target

2020-04-14 Thread Simon Biggs
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

[issue40280] Consider supporting emscripten/webassembly as a build target

2020-04-14 Thread Simon Biggs
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

[issue28002] ast.unparse can't roundtrip some f-strings

2020-04-19 Thread Simon Percivall
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

[issue40562] SEO: differentiate between Python 2 and Python 3 docs on Google SERP

2020-05-08 Thread Simon Willison
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

[issue40562] SEO: differentiate between Python 2 and Python 3 docs on Google SERP

2020-05-08 Thread Simon Willison
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

[issue42783] asyncio.sleep(0) idiom is not documented

2020-12-29 Thread Simon Willison
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

[issue42783] asyncio.sleep(0) idiom is not documented

2020-12-29 Thread Simon Willison
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

[issue42957] os.readlink produces wrong result on windows

2021-01-18 Thread simon mackenzie
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

[issue42957] os.readlink produces wrong result on windows

2021-01-19 Thread simon mackenzie
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

[issue42957] os.readlink produces wrong result on windows

2021-01-19 Thread simon mackenzie
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

[issue43105] Can't import extension modules resolved via relative paths in sys.path on Windows don't don't

2021-02-02 Thread Simon Munday
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

[issue43105] Can't import extension modules resolved via relative paths in sys.path on Windows

2021-02-02 Thread Simon Munday
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 ___

[issue12029] Allow catching virtual subclasses in except clauses

2020-07-02 Thread Simon Charette
Change by Simon Charette : -- nosy: +charettes ___ Python tracker <https://bugs.python.org/issue12029> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue41903] PyNumber_InPlacePower ignores o3 if o1 implements __ipow__

2020-10-01 Thread Simon Cross
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

[issue41903] PyNumber_InPlacePower ignores o3 if o1 implements __ipow__

2020-10-01 Thread Simon Cross
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__

[issue42262] [C API] Add Py_NewRef() function to get a new strong reference to an object

2020-11-04 Thread Simon Cross
Change by Simon Cross : -- nosy: +hodgestar ___ Python tracker <https://bugs.python.org/issue42262> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue13742] Add a key parameter (like sorted) to heapq.merge

2012-01-16 Thread Simon Sapin
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

[issue14196] Unhandled exceptions in pdb return value display

2012-03-04 Thread Simon Chopin
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

[issue21009] Potential deadlock in concurrent futures when garbage collection occurs during Queue.get

2017-09-10 Thread Simon Jagoe
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

[issue20309] Not all method descriptors are callable

2018-11-21 Thread Simon Ruggier
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

[issue35617] unittest discover does not work with implicit namespaces

2018-12-30 Thread Simon Fagerholm
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

[issue35617] unittest discover does not work with implicit namespaces

2018-12-30 Thread Simon Fagerholm
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

[issue35617] unittest discover does not work with implicit namespaces

2018-12-30 Thread Simon Fagerholm
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

[issue29966] typing.get_type_hints doesn't really work for classes with ForwardRefs

2017-04-03 Thread Simon Percivall
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

[issue29966] typing.get_type_hints doesn't really work for classes with ForwardRefs

2017-04-11 Thread Simon Percivall
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

[issue24255] Replace debuglevel-related logic with logging

2018-02-09 Thread Simon Lipp
Change by Simon Lipp : -- nosy: +sloonz ___ Python tracker <https://bugs.python.org/issue24255> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue32879] Race condition in multiprocessing Queue

2018-02-19 Thread Simon Bouchard
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

[issue33079] subprocess: document the interaction between subprocess.Popen and os.set_inheritable

2018-03-15 Thread Simon Lipp
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

[issue3692] improper scope in list comprehension, when used in class declaration

2018-03-17 Thread Simon Charette
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

[issue12345] Add math.tau

2018-04-09 Thread Simon Baird
Change by Simon Baird : -- nosy: -sbaird ___ Python tracker <https://bugs.python.org/issue12345> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue33447] Asynchronous lambda syntax

2018-05-08 Thread Noah Simon
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

[issue33447] Asynchronous lambda syntax

2018-05-08 Thread Noah Simon
Noah Simon added the comment: Actually, you wouldn't even need to import asyncio. -- ___ Python tracker <https://bugs.python.org/issue33447> ___ ___ Pytho

[issue31889] difflib SequenceMatcher ratio() still have unpredictable behavior

2017-10-28 Thread Simon Descarpentries
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

[issue31889] difflib SequenceMatcher ratio() still have unpredictable behavior

2017-11-07 Thread Simon Descarpentries
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

[issue32108] configparser bug: section is emptied if you assign a section to itself

2017-11-21 Thread Simon Lambourn
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

[issue32245] OSError: raw write() returned invalid length on latest Win 10 Consoles

2017-12-07 Thread Simon Depiets
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

[issue32245] OSError: raw write() returned invalid length on latest Win 10 Consoles

2017-12-10 Thread Simon Depiets
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

[issue33698] `._pth` does not allow to populate `sys.path` with empty entry

2018-09-29 Thread Simon Sapin
Change by Simon Sapin : -- nosy: +ssapin ___ Python tracker <https://bugs.python.org/issue33698> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue34841] Script’s directory not in sys.path with embeddable Windows distribution

2018-09-29 Thread Simon Sapin
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

[issue34841] Script’s directory not in sys.path with embeddable Windows distribution

2018-09-29 Thread Simon Sapin
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

[issue34960] python-config bad ldflags on macOS

2018-10-11 Thread Simon Wells
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

[issue34960] python-config bad ldflags on macOS

2018-10-11 Thread Simon Wells
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

[issue34960] python-config bad ldflags on macOS

2018-10-11 Thread Simon Wells
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

[issue34960] macOS builds expose stack_size option in LINKEDFOORSHARED and pyconfig

2018-10-11 Thread Simon Wells
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

[issue18690] memoryview not considered a sequence

2013-08-08 Thread Simon Feltman
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

[issue11798] Test cases not garbage collected after run

2013-08-16 Thread Simon Charette
Changes by Simon Charette : -- nosy: +charettes ___ Python tracker <http://bugs.python.org/issue11798> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue15345] HOWTOs Argparse tutorial - code example raises SyntaxError

2012-07-13 Thread Simon Hayward
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

[issue13742] Add a key parameter (like sorted) to heapq.merge

2012-08-13 Thread Simon Sapin
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> ___ ___

[issue15715] __import__ now raises with non-existing items in fromlist in 3.3

2012-08-16 Thread Simon Feltman
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

[issue15715] __import__ now raises with non-existing items in fromlist in 3.3

2012-08-16 Thread Simon Feltman
Changes by Simon Feltman : -- type: -> behavior ___ Python tracker <http://bugs.python.org/issue15715> ___ ___ Python-bugs-list mailing list Unsubscri

[issue15715] __import__ now raises with non-existing items in fromlist in 3.3

2012-08-16 Thread Simon Feltman
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

[issue15715] __import__ now raises with non-existing items in fromlist in 3.3

2012-08-16 Thread Simon Feltman
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

[issue15901] multiprocessing sharedctypes Array don't accept strings

2012-09-10 Thread Simon R
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:

[issue16362] _LegalCharsPatt in cookies.py includes illegal characters

2012-10-30 Thread Simon Blanchard
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

[issue21009] Potential deadlock in concurrent futures when garbage collection occurs during Queue.get

2014-03-21 Thread Simon Jagoe
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

[issue4709] Mingw-w64 and python on windows x64

2014-04-29 Thread Simon Zack
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

[issue16362] _LegalCharsPatt in cookies.py includes illegal characters

2012-10-30 Thread Simon Blanchard
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

[issue16362] _LegalCharsPatt in cookies.py includes illegal characters

2012-10-31 Thread Simon Blanchard
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

[issue16395] Documentation claims that PySequence_Fast returns a tuple, when it actually returns a list.

2012-11-03 Thread Simon Law
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

[issue16395] Documentation claims that PySequence_Fast returns a tuple, when it actually returns a list.

2012-11-03 Thread Simon Law
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

[issue15125] argparse: positional arguments containing - in name not handled well

2012-11-03 Thread Simon Law
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,

[issue15125] argparse: positional arguments containing - in name not handled well

2012-11-03 Thread Simon Law
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

[issue15125] argparse: positional arguments containing - in name not handled well

2012-11-03 Thread Simon Law
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

[issue15125] argparse: positional arguments containing - in name not handled well

2012-11-03 Thread Simon Law
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'

[issue16398] deque.rotate() could be much faster

2012-11-03 Thread Simon Law
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

[issue16452] Add support for weak reference to bound methods

2012-11-11 Thread Simon Feltman
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

[issue16452] Add support for weak reference to bound methods

2012-11-11 Thread Simon Feltman
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

[issue14631] Instance methods and WeakRefs don't mix.

2012-11-11 Thread Simon Feltman
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/

[issue14631] Instance methods and WeakRefs don't mix.

2012-11-11 Thread Simon Feltman
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.

[issue14631] Instance methods and WeakRefs don't mix.

2012-11-11 Thread Simon Feltman
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

[issue9974] tokenizer.untokenize not invariant with line continuations

2012-12-03 Thread Simon Law
Changes by Simon Law : -- nosy: +sfllaw ___ Python tracker <http://bugs.python.org/issue9974> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.pyth

[issue16398] deque.rotate() could be much faster

2013-02-02 Thread Simon Law
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

[issue19528] logger.config.fileConfig cant cope with files starting with an 'r' on windows

2013-11-08 Thread Simon Naish
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.

[issue19528] logger.config.fileConfig cant cope with files starting with an 'r' on windows

2013-11-08 Thread Simon Naish
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

[issue19528] logger.config.fileConfig cant cope with files starting with an 'r' on windows

2013-11-08 Thread Simon Naish
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

[issue19528] logger.config.fileConfig cant cope with files starting with an 'r' on windows

2013-11-08 Thread Simon Naish
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

[issue19528] logger.config.fileConfig cant cope with files starting with an 'r' on windows

2013-11-08 Thread Simon Naish
Simon Naish added the comment: And again. Damn! -- Added file: http://bugs.python.org/file32546/TestFileLogger.py ___ Python tracker <http://bugs.python.org/issue19

[issue19528] logger.config.fileConfig cant cope with files starting with an 'r' on windows

2013-11-08 Thread Simon Naish
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

[issue19789] Improve wording of how to "undo" a call to logging.disable(lvl)

2013-11-25 Thread Simon Weber
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

[issue19789] Improve wording of how to "undo" a call to logging.disable(lvl)

2013-11-30 Thread Simon Weber
Simon Weber added the comment: That sounds much clearer. Thanks! -- ___ Python tracker <http://bugs.python.org/issue19789> ___ ___ Python-bugs-list mailin

[issue22250] unittest lowercase methods

2014-08-22 Thread Simon Zack
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

[issue22425] 2to3 import fixer writes dotted_as_names into import_as_names

2014-09-16 Thread Simon Weber
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 ├──

[issue22452] addTypeEqualityFunc is not used in assertListEqual

2014-09-21 Thread Simon Zack
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

[issue22452] addTypeEqualityFunc is not used in assertListEqual

2014-09-21 Thread Simon Zack
Changes by Simon Zack : -- type: -> enhancement ___ Python tracker <http://bugs.python.org/issue22452> ___ ___ Python-bugs-list mailing list Unsubscrib

[issue20007] .read(0) on http.client.HTTPResponse drops the rest of the content

2013-12-17 Thread Simon Sapin
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

[issue20007] .read(0) on http.client.HTTPResponse drops the rest of the content

2013-12-17 Thread Simon Sapin
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

[issue20007] .read(0) on http.client.HTTPResponse drops the rest of the content

2013-12-17 Thread Simon Sapin
Simon Sapin added the comment: html5lib issue: https://github.com/html5lib/html5lib-python/issues/127 -- ___ Python tracker <http://bugs.python.org/issue20

[issue20007] .read(0) on http.client.HTTPResponse drops the rest of the content

2013-12-17 Thread Simon Sapin
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

[issue16251] pickle special methods are looked up on the instance rather than the type

2014-02-16 Thread Simon Cross
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

[issue16251] pickle special methods are looked up on the instance rather than the type

2014-02-16 Thread Simon Cross
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(

<    1   2   3   >