Kristján Valur Jónsson added the comment:
Having given this some thougt, years laters, I believe it _is_ possible to
write nested() (and nested_delayed()) in a correct way in python, without the
ContextManagerExit function.
Behold!
import contextlib
@contextlib.contextmanager
def
Kristján Valur Jónsson added the comment:
Great throwback.
As far as I know, context managers are still not first class citizens. You
cannot _compose_ two context managers into a new one programmatically in the
language, in the same way that you can, for instance, compose two functions
Kristján Valur Jónsson added the comment:
I gave up contributing a long time ago now because it was too emotionally
exhausting to me. This issue was one that helped tip the scales. I hope things
have become easier now because good projects like Python need the enthusiasm
and spirit
Kristján Valur Jónsson added the comment:
So you have already stated, and this issue is six years old now.
While I no longer have a stake in this, I'd just like to reiterate that IMHO it
breaks several good practices of architecture, particularly that of separation
of roles.
The abstraction
Kristján Valur Jónsson added the comment:
Nice necro :)
Socketserver is already subclassable and overridable for so many things. Hard
to understand the reluctancy to _allow_ for a different way to handle accept
timeouts. But this is also why I stopped contributing to core, because
Kristján Valur Jónsson added the comment:
imho posix made a mistake in allowing signal/broadcast outside the mutex.
Otherwise an implementation could rely on the mutex for internal state
manipulation. I have my own fast condition variable lib implemented using
semaphores and it is simple
Kristján Valur Jónsson added the comment:
super, good catch!
--
___
Python tracker
<https://bugs.python.org/issue8410>
___
___
Python-bugs-list mailing list
Unsub
Kristján Valur Jónsson added the comment:
Interesting. Yet another reason to always do condition signalling with the
lock held, such as is good practice to avoid race conditions. That's the whole
point of condition variables.
--
___
Python
Kristján Valur Jónsson added the comment:
Please note that this fix appears to be the cause of #37788
--
nosy: +kristjan.jonsson
___
Python tracker
<https://bugs.python.org/issue36
Kristján Valur Jónsson added the comment:
I think I'll pass Raymond, its been so long since I've contributed, in the mean
time there is github and argument clinic and whatnot so I'm out of training.
I´m lurking around these parts and maybe shall return one day
Kristján Valur Jónsson added the comment:
Interesting, I'll have a look when I'm back from vacation.
On Tue, 4 Sep 2018, 07:04 Raymond Hettinger, wrote:
>
> Raymond Hettinger added the comment:
>
> Also take a look at the other places that have similar logic. I believe
>
Kristján Valur Jónsson added the comment:
Hi there! By the time pep 442 was introduced, I wasn't very active in python
core stuff anymore, and still am not.
The intent of this patch, which is explained (IMHO) quite clearly in the first
few comments was to
- Formalize a way for custom
Kristján Valur Jónsson <swesk...@gmail.com> added the comment:
OP here, lurking.
The need to load server certificates from memory is quite real. Some seven
years ago I wrote custom code to handle that for CCPs python branch, and
contributed patches to that effect.
It's always dismaying
Kristján Valur Jónsson added the comment:
Thanks for the mention, @pitrou.
CCP was using Py_AddPendingCall but not from signal handlers, but external
threads. Also on windows only.
You'll also be happy to know that I have left CCP and the Eve codebase is being
kept stable while regularly
Kristján Valur Jónsson added the comment:
My favorite topic :)
You could use threading.Barrier() which is designed to synchronize N threads
doing this kind of lock-step processing. The problem is that the Barrier() is
implemented using Condition variables, so for unit-testing, Condition
Kristján Valur Jónsson added the comment:
It is a tricky issue. How deep do you go?what if you are chaining several
of the itertools? Seems like we're entering a semantic sinkhole here.
Deepcopy would be too deep...
The original copy support in these objects stems from the desire to support
Kristján Valur Jónsson added the comment:
Hi there.
Looking at the API docs today
(https://msdn.microsoft.com/en-us/library/windows/desktop/ms686304(v=vs.85).aspx)
it appears that the timeout case is documented. I'm fairly sure that it wasn't
when I implemented it. There was a good reason
Kristján Valur Jónsson added the comment:
fyi, I just observed this in the field in 2.7.3 using requests 2.5.3
I don't think requests has a workaround for 2.7 from reading the release logs.
--
nosy: +kristjan.jonsson
___
Python tracker <
Kristján Valur Jónsson added the comment:
Seems to have fizzled out due to the intense amount of bikeshedding required.
--
___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/
Kristján Valur Jónsson added the comment:
As already stated, this error bubbles up from the TCP layer. It means that the
tcp stack, for example, gave up resending a tcp frame and timed out,
determining that the recipient was no longer listening.
You cannot create this error yourself. If you
Kristján Valur Jónsson added the comment:
This error is a protocol error. It is the analog to WSAECONNRESET.
ECONNRESET occurs when the local host receives a RST packet from the peer,
usually because the peer closed the connection.
WSAECONNABORT occurs when the local tcp layer decides
New submission from Kristján Valur Jónsson:
On a quad-core raspberrypi, i have experienced that subprocess.Popen()
sometimes does not return immediatelly, but only much later, when an unrelated
process has exited.
Debugging the issue, I find the parent process hanging
Kristján Valur Jónsson added the comment:
Hi there, everyone.
I'm sorry for my rash remarks about the state of IDLE, I'm sure it is alive and
well and its good to see that fine people like Terry are working on keeping it
up to date.
Michael, please understand that python developers
Kristján Valur Jónsson added the comment:
I think that the select.select calls there are a red herring, since I see no
evidence that the rpc socket is ever put in non-blocking mode.
But the line
self.rpcclt.listening_sock.settimeout(10)
indicates that the socket is in timeout mode, and so
Kristján Valur Jónsson added the comment:
Caveat emptor: I know nothing of IDLE, and I even suspect it to be dead or
dying code. Non the less, it could be patched.
I found this in the code:
def putmessage(self, message):
self.debug("putmessage:%d:" % message[0])
Kristján Valur Jónsson added the comment:
Hi there.
I don't think this is in relation to issue #9090.
That one had to do with the internal mechanisms of doing blocking IO with
timeout. this is done internally by using non-blocking sockets and select(),
and the backport dealt with some edge
Kristján Valur Jónsson added the comment:
This could be fixed by saving the accumulate state in a tuple. It would break
protocol, though. I don't recall the rules for backwards compatibility of
pickles.
I've argued before that the state of runtime structures such as generators is
so
Changes by Kristján Valur Jónsson <swesk...@gmail.com>:
--
nosy: -kristjan.jonsson
___
Python tracker <rep...@bugs.python.org>
<http://bugs.python
Changes by Kristján Valur Jónsson <swesk...@gmail.com>:
--
stage: -> resolved
___
Python tracker <rep...@bugs.python.org>
<http://bugs.pyt
Kristján Valur Jónsson added the comment:
Thanks, I'll get this committed and merged asap.
--
___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/i
Kristján Valur Jónsson added the comment:
Interesting. Let me have a look.
--
___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/i
Kristján Valur Jónsson added the comment:
An alternative patch. Please test this since I don't have a development system.
--
keywords: +needs review
Added file: http://bugs.python.org/file40404/itertoolsmodule.c.patch
___
Python tracker <
Kristján Valur Jónsson added the comment:
There are two problems with the previous patch:
1) it can put out of bounds values into lz->indices. This can cause problems
then next time product_next() is called.
2) the case of a pool having zero size is not dealt with (it wasn't before
eit
Kristján Valur Jónsson added the comment:
looks good to me, although it has been pointed out that marshal _write_ speed
is less critical than read speed :)
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23344
Kristján Valur Jónsson added the comment:
lgtm :)
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22113
___
___
Python-bugs-list mailing list
Kristján Valur Jónsson added the comment:
Nope, closing as fixed :)
--
resolution: - fixed
status: open - closed
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20434
Kristján Valur Jónsson added the comment:
Just want to restate my +1 for Michael's idea. I'm hit by this all the time
and it is beautiful and expressive. It also does not preclude the annoying
mix-in way of doing it.
--
___
Python tracker rep
Kristján Valur Jónsson added the comment:
Thanks. Can you confirm that it resolves the issue? I'll get it checked in
once I get the regrtest suite run.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20737
Kristján Valur Jónsson added the comment:
I see, I wasn't able to compile it yesterday when I did it :)
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20737
Kristján Valur Jónsson added the comment:
nope, let's not do that :)
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20737
___
___
Python-bugs
Changes by Kristján Valur Jónsson krist...@ccpgames.com:
--
resolution: - fixed
status: open - closed
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20737
Kristján Valur Jónsson added the comment:
changing long to DWORD doesn't really fix the overflow issue.
The fundamental problem is that some of the apis, e.g. WaitForSingleObject have
a DWORD maximum. so, we cannot support sleep times longer than some particular
time.
Microseconds was chosen
Kristján Valur Jónsson added the comment:
Tim, how about changing the variable to unsigned long? I'd like the
signature of the function to be the same for all platforms.
This will change the code and allow waits for up to 4000 seconds.
There is still an overflow problem present, though
Kristján Valur Jónsson added the comment:
Hi there.
When I said 4000, that was because of the conversion to microseconds which
happens early on.
I'm not trying to be difficult here Tim, it's just that you've pointed out a
problem and I'd like us to have a comprehensive fix.
unsigned long
Kristján Valur Jónsson added the comment:
(cont.)
so, I suggest that we modify the API to use Py_LONG_LONG usec
Does that sound reasonable?
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20737
Kristján Valur Jónsson added the comment:
Ah, I saw this code here in thread_nt.h:
if ((DWORD) milliseconds != milliseconds)
Py_FatalError(Timeout too large for a DWORD,
please check PY_TIMEOUT_MAX);
the PyCOND_TIMEDWAIT is currently only used by the GIL
Kristján Valur Jónsson added the comment:
Here is a proposed alternative patch.
No additional checks, just a wider Py_LONG_LONG us wide enough to accommodate
32 bits of milliseconds as before.
--
Added file: http://bugs.python.org/file35175/condwait.patch
Kristján Valur Jónsson added the comment:
fix patch, was using git format
--
Added file: http://bugs.python.org/file35176/condwait.patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20737
Changes by Kristján Valur Jónsson krist...@ccpgames.com:
--
resolution: - fixed
status: open - closed
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue7105
Kristján Valur Jónsson added the comment:
This significantly helps fragmentation in programs with dynamic memory
usage, e.g. long running programs.
On which programs? The fragmentation of the memory depends a lot on how the
program allocates memory. For example, if a program has
Kristján Valur Jónsson added the comment:
Add comments and explicit (void) on the ignored value from _PyString_Resize as
suggested by Victor
--
Added file: http://bugs.python.org/file34951/string_resize.patch
___
Python tracker rep
Kristján Valur Jónsson added the comment:
Antoine: The location of the arenas when they're individually allocated with
mmap does not matter, no, but preferring to keep low address ones reduces vmem
fragmentation, since they end up being clustered together in memory. For the
usable-arenas
Kristján Valur Jónsson added the comment:
sorry, I meant of course performance of pybench.py goes up
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue21220
Kristján Valur Jónsson added the comment:
Sure. I'm flying home from PyCon this afternoon. I´ll produce and tabulate
data once I'm home on my workstation again.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue21220
Kristján Valur Jónsson added the comment:
Update patch with suggestions from Larry
--
Added file: http://bugs.python.org/file34876/obmalloc.patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue21220
Kristján Valur Jónsson added the comment:
I would also advocate for a better api, that leaves it up to the caller what to
do, much like realloc() does. A convenience macro that frees the block on
error could then be provided. But this is 2.7 and we don't change stuff there
:)
Can you
Kristján Valur Jónsson added the comment:
This is _PyString_Resize(). I don't immediatlly see an error case where the
string isn't freed:
int
_PyString_Resize(PyObject **pv, Py_ssize_t newsize)
{
register PyObject *v;
register PyStringObject *sv;
v = *pv;
if (!PyString_Check(v
Kristján Valur Jónsson added the comment:
Ok, are we good to go then?
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20434
___
___
Python-bugs
New submission from Kristján Valur Jónsson:
A new allocation policy, lowest address strategy improves fragmentation of
memory in obmalloc. pools with available memory are chosen by lowest address
preference. This increases the likelihood that unused pools are released to
their corresponding
Kristján Valur Jónsson added the comment:
Sure, there was at least one case in the patch, where the string resize was
consider optional, and the code tried to recover if it didn't succeed.
But I don't think we should be trying to change apis, even internal ones in
python 2.7
Changes by Kristján Valur Jónsson krist...@ccpgames.com:
--
nosy: +larry
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue21220
___
___
Python-bugs
Kristján Valur Jónsson added the comment:
Could someone please review this patch? I'd like to see it committed asap.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20434
Kristján Valur Jónsson added the comment:
Ok, retrying without the --git flag (I thought that was recommended, it was
once...)
--
Added file: http://bugs.python.org/file34784/string_resize.patch
___
Python tracker rep...@bugs.python.org
http
Changes by Kristján Valur Jónsson krist...@ccpgames.com:
Removed file: http://bugs.python.org/file34779/string_resize.patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20434
Kristján Valur Jónsson added the comment:
Here we are. There were a lot of places where this was being incorrectly done.
And some places where this was being considered a recoverable error, which it
isn't because the source is freed.
Which sort of supports my opinion that this is bad
Changes by Kristján Valur Jónsson krist...@ccpgames.com:
--
status: open - closed
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17522
Changes by Kristján Valur Jónsson krist...@ccpgames.com:
--
status: open - closed
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16475
Kristján Valur Jónsson added the comment:
Closing this as won-t fix. Exiting with running threads is a can of worms.
--
status: open - closed
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17969
Kristján Valur Jónsson added the comment:
Closing this issue.
It is largely superseded. For our Python 2.7 branches, we have a custom GIL
lock which can have different inherent semantics from the common Lock. In
particular, we can implement a fair PyGIL_Handoff() function to be used
Changes by Kristján Valur Jónsson krist...@ccpgames.com:
--
resolution: - rejected
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue8410
Changes by Kristján Valur Jónsson krist...@ccpgames.com:
--
resolution: - wont fix
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17969
Changes by Kristján Valur Jónsson krist...@ccpgames.com:
--
resolution: - fixed
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17522
Changes by Kristján Valur Jónsson krist...@ccpgames.com:
--
resolution: - fixed
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16475
Kristján Valur Jónsson added the comment:
In our 2.7 branches, this approach has been superseded with a natively
impolemented _Condition class. This is even more efficient. It is available
if the underlying Lock implementation is based on pthread locks (not
semaphores
Kristján Valur Jónsson added the comment:
Sure. If there are issues we'll just reopen. Closing.
--
resolution: - fixed
status: open - closed
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19009
Kristján Valur Jónsson added the comment:
Are you referring to the Py_LOCAL_INLINE macro?
I see that we have no Py_INLINE. Py_LOCAL_INLINE includes the static
qualifier, and in fact, if there is no USE_INLINE defined, then all that it
does is to add static.
Would having a Py_INLINE(type
Kristján Valur Jónsson added the comment:
Well, Larry, I certainly am in no mood to start wrangling on python-dev. A 25
year old C standard is likely to be very mature and reliable by now. Why take
risks? :)
#Py_LOCAL_INLINE exists and demonstrates that we can make use of them when
Kristján Valur Jónsson added the comment:
Barring c++, are we using any C compilers that don't support inlines?
Imho these macros should be functions proper. Then we could do
Py_Assign(target, Py_IncRef(obj))
It's 2014 already.
--
___
Python
Kristján Valur Jónsson added the comment:
Better yet, embrace c++ and smart pointers :;-)
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20440
Kristján Valur Jónsson added the comment:
These macros work as assignment with builtin decref,
i.e. a smart replacement for =
We could resolve this by calling them Py_ASSIGN Py_XASSIGN
and having complementary macros Py_STORE/Py_XSTORE that will incref the new
value.
However, with an added
Kristján Valur Jónsson added the comment:
Note that the docstring does not match the doc:
PyDoc_STRVAR(throw_doc,
throw(typ[,val[,tb]]) - raise exception in generator,\n\
return next yielded value or raise StopIteration.);
Should I change the docstring too
Kristján Valur Jónsson added the comment:
Here's one for 2.7. I'm still looking at 3. The funny thing is that the
signature of generator.throw reflects 2.x conventions. I'm figuring out if it
can be used with the .with_traceback() idiom
--
keywords: +patch
Added file: http
Kristján Valur Jónsson added the comment:
And 3.x
--
Added file: http://bugs.python.org/file33888/3x.diff
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14911
Kristján Valur Jónsson added the comment:
These are very unusual semantics.
The convention in the python api is that functions are refernece-invariant when
there are errors. i.e. if a function fails or not does not change the caller's
reference passing assumptions.
For example, Py_BuildValue
Kristján Valur Jónsson added the comment:
I'm not talking about the PyObject** argument, Victor.
I'm talking about reference counting semantics. It is a rule that reference
counting semantics should be the same over a function call whether that
function raised an exception
Kristján Valur Jónsson added the comment:
No, the socket is actually closed when response's close() method is called.
The problem is that the HTTPResponse object, buried deep within the nested
classes returned from do_open(), has a circular reference, and _it_ will not go
away.
No one
Kristján Valur Jónsson added the comment:
Here it is.
Notice the incredible nesting depth in python 2.7.
The socket itself is found at
response.fp._sock.fp._sock
There are two socket._fileobjects in use!
--
Added file: http://bugs.python.org/file33205/httpleak.py
Kristján Valur Jónsson added the comment:
This is still a horrible, horrible, cludge.
I've recently done some work in this area and will suggest a different approach.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue7464
Kristján Valur Jónsson added the comment:
That's the spirit, Guido :)
I just think people are being extra careful after the regression introduced
in 2.7.5.
However, IMHO we must never let the odd mistake scare us from making necessary
moves.
Unless Antoine explicitly objects, I think I'll
Kristján Valur Jónsson added the comment:
+1
Why don't we just fix this and see where the chips fall?
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19787
Kristján Valur Jónsson added the comment:
Strictly speaking b) is not a semantic change. Depending on your semantic
definition of semantics. At any rate it is even less so than a) since the
temporary list is hidden from view and the only side effect is additional
memory usage
Kristján Valur Jónsson added the comment:
d), We could also simply issue a (documentation) warning, that the iterator
methods of these dictionares are known to be fragile, and recommend that people
use the keys(), values() and items() instead
Kristján Valur Jónsson added the comment:
Yes, the old memory argument.
But is it valid? Is there a conceivable application where a dict of weak
references would be storing a large chunk of the application memory?
Remember, all of the data must be referred to from elsewhere, or else, the weak
Kristján Valur Jónsson added the comment:
Here's a different approach.
Simply avoid the use of iterators over the underlying container.
Instead, we iterate over lists of items/keys/values etc.
--
Added file: http://bugs.python.org/file32932/weakref.patch
Kristján Valur Jónsson added the comment:
Deja vu, this has come up before. I wanted to change this because native TLS
implementation become awkward.
https://mail.python.org/pipermail/python-dev/2008-August/081847.html
--
___
Python tracker rep
Kristján Valur Jónsson added the comment:
See also issue #10517
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19787
___
___
Python-bugs-list
Kristján Valur Jónsson added the comment:
But yes, I'd like to see this behave like normal.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19787
Kristján Valur Jónsson added the comment:
Please see the rather long discussion in http://bugs.python.org/issue10517
There were issues having to do with fork.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19787
Kristján Valur Jónsson added the comment:
Only that issue #10517 mentions reasons to keep the old behavior, specifically
http://bugs.python.org/issue10517#msg134573
I don't know if any of the old arguments are still valid, but I suggested
changing this years ago and there was always some
Kristján Valur Jónsson added the comment:
No matter how it sounds, it certainly looks cleaner in code.
Look at all this code, designed to work around an unexpected GC collection with
various pointy bits and edge cases and special corners.
Compare to explicitly just asking GC to relent
1 - 100 of 924 matches
Mail list logo