Changes by Nikolaus Rath :
--
nosy: +Nikratio
___
Python tracker
<http://bugs.python.org/issue1230540>
___
___
Python-bugs-list mailing list
Unsubscribe:
Nikolaus Rath added the comment:
On 09/13/2011 07:41 PM, STINNER Victor wrote:
>
> STINNER Victor added the comment:
>
>> According to
>> http://docs.python.org/library/threading.html#condition-objects,
>> threading.Condition is a class.
>
> Nope, it
Nikolaus Rath added the comment:
On 09/14/2011 04:29 AM, STINNER Victor wrote:
>
> STINNER Victor added the comment:
>
>> Yes, but further down it still says:
>>
>> """
>> class threading.Condition([lock])
>>
>> If the lock ar
New submission from Nikolaus Rath :
I'd like to propose addding the CleanupManager class described in
http://article.gmane.org/gmane.comp.python.ideas/12447 to the contextlib
module. The idea is to add a general-purpose context manager to manage (python
or non-python) resources that
Nikolaus Rath added the comment:
Here's the first part of the patch with the implementation. I'll add tests and
documentation as soon as someone confirms that the idea & API is okay.
--
keywords: +patch
Added file: http://bugs.python.org/file23923/CleanupManager
Nikolaus Rath added the comment:
Hmm. Does the total lack responses mean agreement, disagreement or lack of
interest? I'm attaching a patch against Python 3.3 in the hope of moving this
forward.
--
keywords: +patch
Added file: http://bugs.python.org/file23924/patch_v1
Changes by Nikolaus Rath :
--
title: Language References does not specify exception raised by final yield()
-> Language Reference: Clarify behaviour of yield when generator is not resumed
___
Python tracker
<http://bugs.python.org/issu
Nikolaus Rath added the comment:
Not sure what you mean with "posted as a recipe" -- are you thinking of a
specific website/mailing list?
Example: which one do you mean? The one in the issue or the one in the patch?
With statement: what advantages do you have in mind?
Try/finall
Nikolaus Rath added the comment:
On 12/11/2011 10:17 PM, Raymond Hettinger wrote:
>
> Raymond Hettinger added the comment:
>
> '''
> Example code:
>
> with CleanupManager() als mngr:
> tmpdir = tempfile.mkdtemp()
> mngr.register(shutil.rmt
Changes by Nikolaus Rath :
Added file: http://bugs.python.org/file23933/CleanupManager_patch_v2.diff
___
Python tracker
<http://bugs.python.org/issue13585>
___
___
Pytho
Nikolaus Rath added the comment:
On 12/12/2011 03:31 PM, Sven Marnach wrote:
> Adding this as a cookbook recipe first seems like a good idea.
This is the second time that this is mentioned, so I would be very
grateful if someone could elucidate what "adding as a cookbook recipe"
Nikolaus Rath added the comment:
On 12/21/2011 11:46 AM, Éric Araujo wrote:
>
> Éric Araujo added the comment:
>
>> The idea is to add a general-purpose context manager to manage (python
>> or non-python) resources that don't come with their own context manager.
&g
Nikolaus Rath added the comment:
On 12/21/2011 12:03 PM, Éric Araujo wrote:
>
> Éric Araujo added the comment:
>
>>> In the passage I quoted, I don’t understand what is meant by “non-Python
>>> resources”.
>> Think about e.g. mounting a file system.
>
Changes by Nikolaus Rath :
--
nosy: -Nikratio
___
Python tracker
<http://bugs.python.org/issue5689>
___
___
Python-bugs-list mailing list
Unsubscribe:
New submission from Nikolaus Rath :
>From http://docs.python.org/reference/simple_stmts.html#the-yield-statement:
"As of Python version 2.5, the yield statement is now allowed in the try clause
of a try ... finally construct. If the generator is not resumed before it is
finalized (by
Nikolaus Rath added the comment:
>From http://www.python.org/dev/peps/pep-0342/ I believe that the last yield
>will raise GeneratorExit. So my suggestion is to replace the above mentioned
>paragraph with:
"""
As of Python version 2.5, yield is an expression rat
Changes by Nikolaus Rath :
--
nosy: +Nikratio
___
Python tracker
<http://bugs.python.org/issue1346874>
___
___
Python-bugs-list mailing list
Unsubscribe:
New submission from Nikolaus Rath :
According to http://docs.python.org/library/threading.html#condition-objects,
threading.Condition is a class. However, in fact it turns out to be function
that constructs a _Condition instance.
I don't know the reason for that, but it seems to me
Changes by Nikolaus Rath :
--
versions: +Python 3.1, Python 3.2, Python 3.3, Python 3.4
___
Python tracker
<http://bugs.python.org/issue12704>
___
___
Python-bug
New submission from Nikolaus Rath :
I believe the following should print only one log message, not two:
import logging
class Filter(object):
def filter(self, record):
return record.name == 'foo'
logger = logging.getLogger()
formatter = logging.Formatter('%(messa
Changes by Nikolaus Rath :
--
title: logging filter is ignored when added to root handler -> logging filter
is not applied to messages from descendant loggers
___
Python tracker
<http://bugs.python.org/iss
Nikolaus Rath added the comment:
@Swapnil: the rules you quote are correct for the C extension, but do not apply
when using ctypes, because ctypes is doing the required initializations
automatically.
However, if Amaury is correct, ctypes performs the initializations in a way
that break the
Changes by Nikolaus Rath :
--
resolution: invalid ->
___
Python tracker
<http://bugs.python.org/issue6627>
___
___
Python-bugs-list mailing list
Unsubscri
Nikolaus Rath added the comment:
No, I am not saying that the behaviour of ctypes is wrong. It just happens to
have some effects on threading.local that I think should be documented. That's
why I reassigned this as a documentation bug.
Please reconsider closing this bug. I'm als
Nikolaus Rath added the comment:
To be a bit more constructive, why not add something like this in paragraph to
http://docs.python.org/library/ctypes.html#callback-functions:
"Note that if the callback function is called in a new thread that has been
created outside of Python's co
Nikolaus Rath added the comment:
One point of ctypes is to save the user the trouble of having to create a full
blown C extension, so I don't think it's reasonable to expect a ctypes user to
have read the full C API documentation as well. Only a very small subset of the
page that y
New submission from Nikolaus Rath :
http://docs.python.org/c-api/string.html says about the return value of
AsStringAndSize:
"If length is NULL, the resulting buffer may not contain NUL characters; if it
does, the function returns -1 and a TypeError is raised."
"If string
Nikolaus Rath added the comment:
Georg, this is an important piece of information, but I think it is not yet
clearly stated in the documentation. Here is what
http://docs.python.org/c-api/intro.html says about return codes:
"In general, when a function encounters an error, it se
New submission from Nikolaus Rath :
The following is a very subtle bug and it took me a couple of days to reduce it
to a manageable test case. So please bear with me even if it's tedious.
The problem is that in some cases the use of ctypes for a callback function
freezes the entire pr
Changes by Nikolaus Rath :
Added file: http://bugs.python.org/file15943/call_hello.py
___
Python tracker
<http://bugs.python.org/issue7736>
___
___
Python-bugs-list mailin
Changes by Nikolaus Rath :
Added file: http://bugs.python.org/file15944/hello_ll.c
___
Python tracker
<http://bugs.python.org/issue7736>
___
___
Python-bugs-list mailin
Changes by Nikolaus Rath :
Added file: http://bugs.python.org/file15945/libfuse26.py
___
Python tracker
<http://bugs.python.org/issue7736>
___
___
Python-bugs-list mailin
Changes by Nikolaus Rath :
Added file: http://bugs.python.org/file15946/libfuse28.py
___
Python tracker
<http://bugs.python.org/issue7736>
___
___
Python-bugs-list mailin
Changes by Nikolaus Rath :
Added file: http://bugs.python.org/file15947/call_hello.py
___
Python tracker
<http://bugs.python.org/issue7736>
___
___
Python-bugs-list mailin
Changes by Nikolaus Rath :
Removed file: http://bugs.python.org/file15943/call_hello.py
___
Python tracker
<http://bugs.python.org/issue7736>
___
___
Python-bugs-list m
Nikolaus Rath added the comment:
Reproduced with Python 3.1
--
versions: +Python 3.1
___
Python tracker
<http://bugs.python.org/issue7736>
___
___
Python-bug
Changes by Nikolaus Rath :
Removed file: http://bugs.python.org/file15947/call_hello.py
___
Python tracker
<http://bugs.python.org/issue7736>
___
___
Python-bugs-list m
Changes by Nikolaus Rath :
Added file: http://bugs.python.org/file15948/call_hello.py
___
Python tracker
<http://bugs.python.org/issue7736>
___
___
Python-bugs-list mailin
Nikolaus Rath added the comment:
Wow, great! Thanks for looking into this. How did you manage to get the
backtrace? As I said, on my system gdb -p just hangs with when attaching.
I'm changing the component, since it seems that it's the os module that's at
fault
Changes by Nikolaus Rath :
--
title: ctypes freezes/deadlocks process -> os.listdir hangs since opendir() and
closedir() do not release GIL
___
Python tracker
<http://bugs.python.org/iss
Nikolaus Rath added the comment:
In this simple example, FUSE does not fork and does not start any threads.
Note that PyGILState_Ensure() cannot do anything here. What happens is this:
- call_hello.py calls FUSE in a new thread, releasing the GIL.
- FUSE mounts the file system and waits for
Nikolaus Rath added the comment:
I have used both of them in the past, but in the end I wrote my own bindings
(currently only available as part of the http://code.google.com/p/s3ql source
code, but I intend to factor it out at some point),
since neither fuse.py (http://code.google.com/p
Nikolaus Rath added the comment:
On 01/20/2010 07:19 AM, Antoine Pitrou wrote:
> Ah, thanks for the explanation. Yes indeed the patch looks ok for the
> job. You should just be aware that similar problems may appear with
> other system calls. I don't think we have ever considered
Nikolaus Rath added the comment:
The patch works fine for me too. Also, I did not discover any other such
problems for other syscalls (but I did not systematically try all os.*
functions).
--
___
Python tracker
<http://bugs.python.org/issue7
New submission from Nikolaus Rath :
On my system (Ubuntu Karmic, Python 2.6.4 (r264:75706, Dec 7 2009, 18:45:15),
Kernel 2.6.31-17-generic, libc6 2.10.1-0ubuntu16) the attached test script
produces the following output:
Traceback (most recent call last):
File "test1.py", l
Nikolaus Rath added the comment:
I can confirm that without the path it works for me too.
But I have to admit that I don't really understand your explanation. Should I
generally not use full paths with CDLL? Or just in the case of libc?
In either case, I think the ctypes dokumentation
Nikolaus Rath added the comment:
Here is a short testcase that reproduces the problem. If you run the script it
daemonizes correctly, but then the daemon does not terminate but hangs forever.
The crucial part seems to be to daemonize the program while there is more than
one thread running
Changes by Nikolaus Rath :
--
title: Python hangs after last thread has exited -> Interpreter does not
terminate if daemonized while running multithreaded
___
Python tracker
<http://bugs.python.org/iss
Nikolaus Rath added the comment:
Does this patch still need review? Both Martin and Antoine already commented
that the patch is ok, so it'd be great if someone could actually apply it...
--
___
Python tracker
<http://bugs.python.org/i
Changes by Nikolaus Rath :
--
nosy: +Nikratio
___
Python tracker
<http://bugs.python.org/issue6715>
___
___
Python-bugs-list mailing list
Unsubscribe:
New submission from Nikolaus Rath :
$ cat test.py
#!/usr/bin/env python
import os
import stat
dbfile = './testfile.test'
with open(dbfile, 'w') as fh:
print('Opened file for writing')
os.unlink(dbfile)
os.mknod(dbfile, stat.S_IRUSR | stat.S_IWUSR | stat.S_IFREG
Change by Nikolaus Rath :
--
nosy: -nikratio
___
Python tracker
<https://bugs.python.org/issue17681>
___
___
Python-bugs-list mailing list
Unsubscribe:
Change by Nikolaus Rath :
--
nosy: -nikratio
___
Python tracker
<https://bugs.python.org/issue34624>
___
___
Python-bugs-list mailing list
Unsubscribe:
Change by Nikolaus Rath :
--
nosy: -nikratio
___
Python tracker
<https://bugs.python.org/issue17852>
___
___
Python-bugs-list mailing list
Unsubscribe:
Nikolaus Rath added the comment:
Is there a good reason to not explicitly initialize them nevertheless? Valgrind
is a common tool, and this false positive will affect everyone attempting to
run it on a Python extension module.
--
___
Python
New submission from Nikolaus Rath:
With a particularly atrocious network connection, I often get the following
exception:
File "/usr/lib/python3/dist-packages/dugong/__init__.py", line 503, in connect
self._sock = self.ssl_context.wrap_socket(self._sock,
server_hostname=serve
Nikolaus Rath added the comment:
Regarding "atrocious connection": I wish I knew, but I have no control of the
connection. All I can tell is that there are frequent disconnects, occasional
latency spikes, my remote ip address seems to change frequently (while the
apparent local on
New submission from Nikolaus Rath :
With current git master, configured --with-valgrind --with-pydebug, I get:
==31074== Command: /home/nikratio/clones/cpython/python
/home/nikratio/in-progress/pyfuse3/test/../examples/hello.py
/tmp/pytest-of-nikratio/pytest-11/test_hello_hello_py_0
==31074
Nikolaus Rath added the comment:
Same error with 3.7.1 and 3.6.7 (though line numbers differ slightly).
--
___
Python tracker
<https://bugs.python.org/issue35
Nikolaus Rath added the comment:
$ ./configure CFLAGS="-O0 -g" --with-valgrind && make -j8
still gives
==13281== Memcheck, a memory error detector
==13281== Copyright (C) 2002-2015, and GNU GPL'd, by Julian Seward et al.
==13281== Using Valgrind-3.12.0.SVN and Li
Nikolaus Rath added the comment:
Sorry, no. I have long lost context and interest in this.
--
___
Python tracker
<https://bugs.python.org/issue20177>
___
___
Nikolaus Rath added the comment:
Given the apparent difficulties getting this right, how about not attempting to
implicitly flush buffers in the finalizer at all? This means scripts relying on
this will break, but in contrast to the current behavior they will break
consistently so it's
Change by Nikolaus Rath :
--
nosy: -nikratio
___
Python tracker
<https://bugs.python.org/issue1230540>
___
___
Python-bugs-list mailing list
Unsubscribe:
New submission from Nikolaus Rath :
According to
https://docs.python.org/3/library/warnings.html#describing-warning-filters:
"The meaning of each of these fields [of PYTHONWARNINGS] is as described in
."
The description of the "The Warnings filter" says
"module
Nikolaus Rath added the comment:
yes, this is a duplicate.
--
___
Python tracker
<https://bugs.python.org/issue34920>
___
___
Python-bugs-list mailing list
Unsub
Change by Nikolaus Rath :
--
nosy: +nikratio
title: -W option does not accept module regexes -> -W option and PYTHONWARNINGS
env variable does not accept module regexes
___
Python tracker
<https://bugs.python.org/issu
New submission from Nikolaus Rath:
[0] nikratio@vostro:~/tmp$ cat bugme.py
#!python
import getpass
import warnings
warnings.simplefilter('default')
getpass.getpass("What's up?")
[0] nikratio@vostro:~/tmp$ python3 --version
Python 3.3.2
[0] nikratio@vostro:~/tmp$ p
Nikolaus Rath added the comment:
No, it doesn't.
--
___
Python tracker
<http://bugs.python.org/issue18116>
___
___
Python-bugs-list mailing list
Unsubsc
Nikolaus Rath added the comment:
Yes, I'm pretty sure:
[0] nikratio@vostro:~/tmp$ cp /usr/lib/python3.3/getpass.py .
[0] nikratio@vostro:~/tmp$ patch -p2 < issue18116.diff
patching file getpass.py
Hunk #1 succeeded at 57 (offset -1 lines).
[0] nikratio@vostro:~/tmp$ python3 bugme.
Changes by Nikolaus Rath :
--
keywords: +patch
Added file: http://bugs.python.org/file30736/subprocess_rst.diff
___
Python tracker
<http://bugs.python.org/issue17
Nikolaus Rath added the comment:
patch attached.
--
___
Python tracker
<http://bugs.python.org/issue17814>
___
___
Python-bugs-list mailing list
Unsubscribe:
New submission from Nikolaus Rath:
When using the three parameter form of type to create a new class, and any of
the base classes has a metaclass with a __prepare__ function, the __prepare__
function is not executed:
>>> class CustomMetaclass(type):
... @cl
Nikolaus Rath added the comment:
In that cases, maybe type(name, cls, clsdict) should actually raise an error if
there's a metaclass with __prepare__ involved?
Presumably that would break only code that was already broken, but it would
convert previously hidden behavioral bugs in
New submission from Nikolaus Rath:
The read1() docstring says: "Reads up to n bytes, with at most one read()
system call."
However, in the implementation read1() calls peek() to refill the buffer if
necessary, and then returns whatever is available in the buffer.
This means that re
Nikolaus Rath added the comment:
I think stdout redirection is very useful, and I'm actually have a very similar
context manager in my own code.
However, I'd like to raise the question if using a context manager for this
purpose should really be "officially blessed" in t
Nikolaus Rath added the comment:
On 07/24/2013 07:35 AM, Antoine Pitrou wrote:
>
> Antoine Pitrou added the comment:
>
>> This means that read1() will only return up to n bytes if n is smaller
>> than the buffer size, otherwise it will return at most
>> bytes.
&g
Nikolaus Rath added the comment:
On 07/24/2013 02:28 PM, Antoine Pitrou wrote:
>
> Antoine Pitrou added the comment:
>
> Le mercredi 24 juillet 2013 à 18:24 +0000, Nikolaus Rath a écrit :
>> There should be no problem reading 20 bytes with a single call to
>> BytesIO.
Nikolaus Rath added the comment:
On 07/24/2013 02:51 PM, Antoine Pitrou wrote:
>
> Antoine Pitrou added the comment:
>
> Le mercredi 24 juillet 2013 à 21:45 +0000, Nikolaus Rath a écrit :
>> The documentation is correct that read1(n) never returns more than n bytes.
>>
Nikolaus Rath added the comment:
On 07/24/2013 03:04 PM, Antoine Pitrou wrote:
> However, 3.2 didn't get that improvement, sorry. See changeset 27bf3d0b8e5f
> and issue #13393.
>
> --
> resolution: -> duplicate
> status: open -> closed
Duh. So much bac
New submission from Nikolaus Rath:
The handle_expect_100() implementation in BaseHTTPRequestHandler currently
calls send_response_only(100) followed by flush_headers(). However, even a 1xx
response is always followed by a (potentially empty) set of response headers
(cf. http://tools.ietf.org
Nikolaus Rath added the comment:
The correct link is http://tools.ietf.org/html/rfc2616#section-10.1:
10.1 Informational 1xx
This class of status code indicates a provisional response,
consisting only of the Status-Line and optional headers, and is
terminated by an empty line
New submission from Nikolaus Rath:
Consider this:
$ python3 test_exc.py
Traceback (most recent call last):
File "test_exc.py", line 14, in
fail1()
File "test_exc.py", line 11, in fail1
fail2()
File "test_exc.py", line 5, in fail2
raise R
Nikolaus Rath added the comment:
The second paragraph should of course read "...consequence of the 'First'
exception *and* should thus be chained..."
--
___
Python tracker
<http://bug
Nikolaus Rath added the comment:
*ping*
--
___
Python tracker
<http://bugs.python.org/issue12704>
___
___
Python-bugs-list mailing list
Unsubscribe:
Nikolaus Rath added the comment:
On 09/04/2013 06:03 AM, Eli Bendersky wrote:
> Why guess... did you try it in the code?
I don't follow... why guess what? And try what in code?
> it would be nice to have a short code sample here demonstrating what's
> happening. The parag
Nikolaus Rath added the comment:
I've attached an updated patch.
I agree with Tim that the docs on the yield expression are already very good,
so instead of extending the yield statement documentation I have shortened it
to instead reduce the overlap that already exists.
In the
New submission from Nikolaus Rath:
Occasionally, the isclosed() method of HTTPResponse instances returns False,
even though a preceding read() call returned '' (or something else that evalues
to False).
This is a problem, because then the corresponding HTTPConnection can still b
Nikolaus Rath added the comment:
The problem seems to occur regularly, just with large intervals in between. Is
there any specific information that might help here? I am not quite sure what
to save when the problem happens the next time. Can the response object be
pickled
Nikolaus Rath added the comment:
The call should be read(size), with size a number. I will make sure to check
size, "fp", "length", "chunked" and "chunk_left" when it happens the next time.
--
___
Python tra
Nikolaus Rath added the comment:
This is just a heads-up that I'm still trying to debug this. So far, the
problem doesn't seem to have shown up again (for reference, the original report
for this is http://code.google.com/p/s3ql/issues/det
Nikolaus Rath added the comment:
I don't think that we can just introduce path normalization in phase0. Even
though I agree that this would be the proper way to do it when reimplementing
from scratch, it breaks backward compatibility.
There also is a small mistake in that the *
Changes by Nikolaus Rath :
--
title: filecmp.dircmp does exact match only -> Add match parameter to
filecmp.dircmp to ignore name patterns
versions: +Python 3.5 -Python 3.2
___
Python tracker
<http://bugs.python.org/iss
Changes by Nikolaus Rath :
--
title: Add match parameter to filecmp.dircmp to ignore name patterns -> Add
match parameter to filecmp.dircmp to ignore using patterns
___
Python tracker
<http://bugs.python.org/iss
New submission from Nikolaus Rath:
When using non-blocking operation, the SSLSocket.send method returns 0 if no
data can be sent at this point.
This is counterintuitive, because in the same situation (write to non-blocking
socket that isn't ready for IO):
* A regular (non-SSL) socket r
Nikolaus Rath added the comment:
This is actually seems to be not just an inconvience, but a real bug: since
SSLSocket.sendall() uses SSLSocket.send() internally, the former method will
busy-loop when called on a non-blocking socket.
Note also that the .sendto and .write methods already
Nikolaus Rath added the comment:
Antoine, do you know that there are frameworks out there using this, or is that
a guess? asyncio, for example, seems to expect an SSLWantWrite exception as
well. (it also works with a zero return, but it's not clear from the code if
that's by desi
Nikolaus Rath added the comment:
Twisted does not seem to rely on it either (there's no mention of SSLWant* in
the source at all, and without that, you can't possibly have support for
non-blocking ssl sockets).
--
___
Python trac
Nikolaus Rath added the comment:
gevent is calling _sslobject.write() directly, so it would not be affected by
any change.
--
___
Python tracker
<http://bugs.python.org/issue20
Nikolaus Rath added the comment:
Tornado uses SSLSocket.send(), and it looks as if a SSLWantWrite exception is
not caught but would propagate, so this would probably break.
--
___
Python tracker
<http://bugs.python.org/issue20
Nikolaus Rath added the comment:
More info on twisted: it uses PyOpenSSL rather than the stdlib ssl module, so
it's not affected at all.
--
___
Python tracker
<http://bugs.python.org/is
1 - 100 of 303 matches
Mail list logo