Evgeny added the comment:
Eryk, I agree, that implementing TemporaryFile() in Windows goes hand in hand
with the decision to stop using O_TEMPORARY in NamedTemporaryFile()
The only thing I want to point out is that your suggestion also includes this
"unlinking trick" (sorry, ma
Evgeny added the comment:
> Eryk Sun added the comment:
> Just implement a separate function for TemporaryFile() instead of aliasing it
> to NamedTemporaryFile(). See msg390814.
Eryk, forgive my ignorance, but aren't in your msg390814 you are proposing yet
another enhance
Evgeny added the comment:
>Paul Moore added the comment:
>Evgeny, would you be willing to update your PR (including adding the docs
>change, and tests to catch as many edge cases as you can think up) to match
>this behaviour?
Paul, thank you for moving this forward. I will g
Evgeny added the comment:
>Eryk Sun added the comment:
>I replied twice that I thought using the CM exit instead of O_TEMPORARY is
>okay for NamedTemporaryFile() -- but only if a separate implementation of
>TemporaryFile() that uses O_TEMPORARY is added at the same
Evgeny added the comment:
On Mon, Apr 12, 2021 at 12:51 AM Jason R. Coombs wrote:
> Jason R. Coombs added the comment:
> At least I and Ethan and Martin have expressed a desire for the default,
> preferred usage work well in a portable environment. Requiring
> `delete_on
Evgeny added the comment:
Dear all, thank you very much for the discussion, I will just try to summarize
the results of it.
In my PR I used solution, proposed by Eryk. My solution involves introduction
of the extra flag delete_on_close and making sure, that new situation is fully
Evgeny added the comment:
Dear all, how can we realistically move this forward?
This issue is 9 years old by now.
Everybody from the discussion agrees, this is an issue.
There were several proposals made, all of them slightly different.
7 months ago I have implemented solution, pretty much
New submission from Evgeny Naumov :
A simple example is documented here:
https://github.com/samuelcolvin/pydantic/issues/2233 but it doesn't look like
it was actually filed as a bug against CPython... Copy paste of the minimal
reproducing example:
from dataclasses import asdict, data
Change by Evgeny :
--
keywords: +patch
pull_requests: +22618
stage: needs patch -> patch review
pull_request: https://github.com/python/cpython/pull/22431
___
Python tracker
<https://bugs.python.org/issu
Evgeny added the comment:
Hello, this is to let you know, that I have created a pull request for this
issue
https://github.com/python/cpython/pull/22431
I am not really an experienced programmer, but I will give it a try
--
nosy: +ev2geny
Evgeny Boytsov added the comment:
I checked both my test example and real production code with your patch. I'm
unable to reproduce the bug, so I think it is fixed now. Thank you!
--
___
Python tracker
<https://bugs.python.org/is
Evgeny Boytsov added the comment:
Also I understood the source of your crash with my initial example. Since you
haven't used CMake to configure project, pybind didn't setup required macroses
to enable threading support. So no issues
Evgeny Boytsov added the comment:
I rewrote my example without pybind and eliminated C++ module (I realized that
time.sleep() also releases the GIL, so we achieve the same effect). Still the
same results: with python 3.7.3 app crashes with attached ASAN output, with
python 3.7.3 without
Evgeny Boytsov added the comment:
Your callstack is very strange. At line 30 of main.cpp GIL is obviously locked:
// importing module in this tread
gstate = PyGILState_Ensure();
py::module crash_test = py::module::import( "crash_test" ); <-- import
PyGILState_Re
Evgeny Boytsov added the comment:
I'am unable to reproduce neither my or your issues with python 3.6. The program
runs infinitely as it meant to be. Can you please give me C++ traceback from
the core dump, which was created when you ran my pr
Evgeny Boytsov added the comment:
Thank you for feedback. I will try to reproduce the issue with 3.6. By the way,
haven't you used gdb with python pretty-printers enabled to examine the state
of the program? I've got the same error message, then I breaked the execution
in debugger
Evgeny Boytsov added the comment:
Please note, that UnlockGILandSleep takes GIL back before returning. In a real
production code there is a database query. In this example I emulate them with
random sleep. So I don't see any problems
New submission from Evgeny Boytsov :
Hello everybody!
We are using Python 3.7 running at CentOS 7 x64. Python is used as a library to
create dynamic extensions for our app server.
Some time ago we began to experience crashes in decimal module in some
heavy-multithreaded scenarios. After
Evgeny Nizhibitsky added the comment:
Oh, I see that in the initial code with leakage (it was heavy
ThreadPoolExecutor + xgboost thing) there was an await but I must have lost it
somewhere while reducing it to the minimal example and finished in the wrong
direction.
Glad too see that it
New submission from Evgeny Nizhibitsky :
I have run into a memory leak caused by using run_in_executor +
ThreadPoolExecutor while running some stability tests with custom web services.
It was 1 MB leaked for 1k requests made for my case and I've extracted the root
cause and converted it
Evgeny added the comment:
You don't need action='append'.
For desired behavior you can pass action='store' with nargs='*'.
I think it's a simplest workaround.
--
nosy: +gun146
___
Python trac
Evgeny Prilepin added the comment:
Hi RĂ©mi, it would be great if you posted a PR.
--
___
Python tracker
<https://bugs.python.org/issue34035>
___
___
Python-bug
Evgeny Prilepin added the comment:
I think the line 1031 also contains the misprint and will raise NameError.
> self._decompressor = zipfile._get_decompressor(self._compress_type)
"zipfile." is not correct code in this place.
--
_
New submission from Evgeny Prilepin :
The misprint in the file lib/zipfile.py in the line 704 leads to
AttributeError: '_SharedFile' object has no attribute 'writing'
"self.writing()" should be replaced by "self._writing()". I also th
Evgeny Boytsov added the comment:
The same behaviour is reprodusible at ubuntu 16.04 with python 3.5.2. And a
colleague of mine said that he was able to reproduce the issue with python 3.6.
--
___
Python tracker
<http://bugs.python.org/issue30
New submission from Evgeny Boytsov:
Hello everybody!
We are using Python 3.4 running at CentOS 7 x64 and experiencing some problems
with simulatenous import of modules from different threads of execution.
The attached archive contains simple example, which demonstrates the issue.
There is
New submission from Evgeny Kapun:
Code:
import asyncio as a
import socket as s
@a.coroutine
def coro():
s1, s2 = s.socketpair()
s1.setblocking(False)
s2.setblocking(False)
try:
yield from a.wait_for(loop.sock_recv(s2, 1), 1
Evgeny Kapun added the comment:
The problem is that the task doesn't catch CancelledError, yet it disappears.
--
___
Python tracker
<http://bugs.python.org/is
New submission from Evgeny Kapun:
If I run this code:
import asyncio as a
@a.coroutine
def coro1():
yield from a.ensure_future(coro2())
print("Still here")
yield from a.sleep(1)
print("Still here 2")
@a.coroutine
def co
New submission from Evgeny Kapun:
>From the documentation for GzipFile.peek():
At most one single read on the compressed stream is done to satisfy the
call.
If "compressed stream" means the underlying file object, then this is not true.
The method tries to return at l
Changes by Evgeny Kapun :
--
nosy: +abacabadabacaba
___
Python tracker
<http://bugs.python.org/issue13322>
___
___
Python-bugs-list mailing list
Unsubscribe:
Changes by Evgeny Kapun :
--
nosy: +abacabadabacaba
___
Python tracker
<http://bugs.python.org/issue15994>
___
___
Python-bugs-list mailing list
Unsubscribe:
New submission from Evgeny Kapun:
GzipFile's underlying stream can be a raw stream (such as FileIO), and such
streams can return short reads and writes at any time (e.g. due to signals).
The correct behavior in case of short read or write is to retry the call to
read or write the rema
Evgeny Kapun added the comment:
Unfortunately, on Linux, handling names as Unicode can cause some problems. For
example, merely print()-ing such a name can cause UnicodeEncodeError.
--
___
Python tracker
<http://bugs.python.org/issue27
Evgeny Kapun added the comment:
Unfortunately, this doesn't work if I pass a file descriptor.
--
resolution: rejected ->
status: closed -> open
___
Python tracker
<http://bugs.python.
Evgeny Kapun added the comment:
Mostly for consistency with other functions. Also, this provides an easy way to
walk a directory tree recursively: just call listdir on every member, and if it
doesn't raise OSError, that member must be a directory. With
follow_symlinks=False, this m
Evgeny Kapun added the comment:
Not a problem, just two unnecessary syscalls. Also, I think that many of those
who pass a file descriptor to os.listdir don't need it afterwards, because
after you fstat() a file descriptor (to discover that it points to a directory)
and read the dire
Evgeny Kapun added the comment:
1. Yes, it's possible to emulate dir_fd this way, so this is just for
convenience.
2. If follow_symlinks is False, O_NOFOLLOW is passed to the underlying open(2)
syscall. Of course, this doesn't make sense if a file descriptor is passe
New submission from Evgeny Kapun:
Currently, when given a file descriptor, os.listdir will duplicate it so that
the original file descriptor is not closed. In many cases, a file descriptor is
not needed anymore after directory is listed, so this is not necessary. I
propose adding a keyword
New submission from Evgeny Kapun:
Currently, os.listdir returns a list of strings, unless called with a bytes
argument, in which case a list of byte strings is returned. I think that there
should be a keyword argument to override this selection.
--
components: Library (Lib)
messages
Changes by Evgeny Kapun :
--
nosy: +abacabadabacaba
___
Python tracker
<http://bugs.python.org/issue25996>
___
___
Python-bugs-list mailing list
Unsubscribe:
New submission from Evgeny Kapun:
Many functions in os module support dir_fd and follow_symlinks keyword
arguments. I think that os.listdir and os.scandir should do likewise.
See also: issue25996.
--
components: Library (Lib)
messages: 266091
nosy: abacabadabacaba
priority: normal
Evgeny Kapun added the comment:
So, it looks like OpenSSL doesn't support keys using arbitrary curves at all.
Then why don't I get an exception when trying to load such a key? Instead it
just quietly disables all authenticated ciphersuites (anonymous ciphersuites
still work) and th
New submission from Evgeny Kapun:
I tried to use ssl module to create a server with a certificate that uses an
ECC key. However, this didn't work. Here is how to reproduce this:
First, generate a key and a certificate:
$ openssl req -newkey ec -pkeyopt ec_paramgen_curve:prime256v1
Changes by Evgeny Kapun :
--
nosy: +abacabadabacaba
___
Python tracker
<http://bugs.python.org/issue2142>
___
___
Python-bugs-list mailing list
Unsubscribe:
Changes by Evgeny Kapun :
--
nosy: +abacabadabacaba
___
Python tracker
<http://bugs.python.org/issue18531>
___
___
Python-bugs-list mailing list
Unsubscribe:
Evgeny Kapun added the comment:
There are methods that accept a single argument and behave like a binary
operation or a predicate. It would be useful to be able to turn them into
binary functions for use with higher-order functions like map and reduce:
reduce(methodcaller("combine&qu
New submission from Evgeny Kapun:
Implementations of repr for some of the types in the standard library doesn't
check for self-referential structures. As a result, when calling repr() on such
objects, Python crashes due to infinite recursion.
Example:
>>> import f
New submission from Evgeny Kapun:
Currently, operator.methodcaller behaves like this:
def methodcaller(name, *args, **kwargs):
def caller(obj):
return getattr(obj, name)(*args, **kwargs)
return caller
That is, it is possible to supply arguments when the object
Changes by Evgeny Kapun :
--
nosy: +abacabadabacaba
___
Python tracker
<http://bugs.python.org/issue24129>
___
___
Python-bugs-list mailing list
Unsubscribe:
Evgeny Kapun added the comment:
Prohibiting tabs after spaces is not enough. For example, Python rejects this
code:
if 1:
if 1:
pass
because its indentation is invalid if tab width is 1. However, it accepts this
code:
if 1:
if 1:
<10 spaces>pass
despi
Changes by Evgeny Kapun :
--
nosy: +abacabadabacaba
___
Python tracker
<http://bugs.python.org/issue14228>
___
___
Python-bugs-list mailing list
Unsubscribe:
New submission from Evgeny Kapun:
Currently, Python always changes handling of certain signals on startup:
SIGPIPE is ignored, and SIGINT is handled by a function that raises
KeyboardInterrupt exception. As a result, if the user presses Ctrl-C, a
backtrace is printed to stderr.
Some program
New submission from Evgeny Kapun:
In the documentation, it is said:
Indentation is rejected as inconsistent if a source file mixes tabs and
spaces in a way that makes the meaning dependent on the worth of a tab in
spaces; a TabError is raised in that case.
But that's not true
Changes by Evgeny Kapun :
--
nosy: +abacabadabacaba
___
Python tracker
<http://bugs.python.org/issue22672>
___
___
Python-bugs-list mailing list
Unsubscribe:
Changes by Evgeny Kapun :
--
nosy: +abacabadabacaba
___
Python tracker
<http://bugs.python.org/issue2636>
___
___
Python-bugs-list mailing list
Unsubscribe:
Evgeny Kapun added the comment:
This patch doesn't fix the issue. The problem is that the list starting with
state->repeat doesn't necessarily contains all repeat contexts that are
allocated. Indeed, here [1] and here [2] repeat contexts are temporarily
removed from the list.
New submission from Evgeny Kapun:
This pattern matches:
re.match('(?:()|(?(1)()|z)){2}(?(2)a|z)', 'a')
But this doesn't:
re.match('(?:()|(?(1)()|z)){0,2}(?(2)a|z)', 'a')
The difference is that {2} is replaced by {0,2}. This shouldn't
Changes by Evgeny Kapun :
--
nosy: +abacabadabacaba
___
Python tracker
<http://bugs.python.org/issue9134>
___
___
Python-bugs-list mailing list
Unsubscribe:
Changes by Evgeny Kapun :
--
nosy: +abacabadabacaba
___
Python tracker
<http://bugs.python.org/issue433030>
___
___
Python-bugs-list mailing list
Unsubscribe:
Evgeny Kapun added the comment:
Tracemalloc code:
import re
import signal
import tracemalloc
class AlarmError(Exception):
pass
def handle_alarm(signal, frame):
raise AlarmError
signal.signal(signal.SIGALRM, handle_alarm)
s1
Evgeny Kapun added the comment:
Aren't Python strings immutable?
Also, match functions still permit execution of signal handlers, which can
execute any Python code.
If GIL is needed during matching, can it be released temporarily to permit
thread swit
Evgeny Kapun added the comment:
Memory leak only happens if match operation terminates abruptly, e.g. because
of SIGINT. In this case, DO_JUMP doesn't come back.
--
___
Python tracker
<http://bugs.python.org/is
New submission from Evgeny Kapun:
Iterator returned by re.finditer includes a SRE_STATE value, which is not
designed to be used concurrently. However, it is possible to call __next__ on
such iterator while another such call is in progress, e.g. from a signal
handler. This may result in
New submission from Evgeny Kapun:
Looks like function in re module (match, fullmatch and so on) don't release
GIL, even though these operations can take much time. As a result, other
threads can't run while a pattern is being matched, and thread switching
doesn't
New submission from Evgeny Kapun:
In Modules/sre_lib.h on line 882 [1], a block of memory is allocated. If
SRE(match) function later terminates abruptly, either because of a signal or
because subsequent memory allocation fails, this block is never released.
[1] https://hg.python.org/cpython
New submission from Evgeny Kapun:
>>> import collections
>>> collections.Counter(self=1)
Traceback (most recent call last):
File "", line 1, in
TypeError: __init__() got multiple values for argument 'self'
>>> collections.OrderedDict(self=&q
Changes by Evgeny Kapun :
--
nosy: +abacabadabacaba
___
Python tracker
<http://bugs.python.org/issue22524>
___
___
Python-bugs-list mailing list
Unsubscribe:
Changes by Evgeny Kapun :
--
nosy: +abacabadabacaba
___
Python tracker
<http://bugs.python.org/issue7434>
___
___
Python-bugs-list mailing list
Unsubscribe:
New submission from Evgeny Luttsev:
Code:
n = 2
perms = permutations(range(n), n)
if list(perms) == [(0, 1), (1, 0)]:
print("==")
print("len(list(perms)):", len(list(perms)))
Result:
==
len(list(perms)): 0 # SHOULD BE 2
--
components: Library (Lib)
m
New submission from Evgeny Kapun:
According to the documentation, PyIter_Next should raise TypeError if passed an
object which is not an iterator as an argument. Instead, it calls a function
through a null pointer, which leads to a crash.
--
components: Interpreter Core
messages
New submission from Evgeny Sologubov:
Please see the patch attached.
It quite is primitive and self-explanatory: the code wouldn't attempt to load
*libc* via ctypes.CDLL, if all necessary functions are already found in
*libuuid*.
This patch also can serve as a work-around solution to
Evgeny Kapun added the comment:
Simple test:
while True:
try:
listdir(0)
except NotADirectoryError:
pass
--
___
Python tracker
<http://bugs.python.org/issue17
Evgeny Kapun added the comment:
To make fdopendir fail, just pass any valid FD which points to a non-directory,
such as a file or a pipe.
--
___
Python tracker
<http://bugs.python.org/issue17
New submission from Evgeny Kapun:
When called with a file descriptor as an argument, os.listdir() duplicates it
to pass to fdopendir(3). If this call fails, the new file descriptor is not
closed, which leads to file descriptor leak.
--
components: Library (Lib)
messages: 188322
nosy
Changes by Evgeny Kapun :
--
nosy: +abacabadabacaba
___
Python tracker
<http://bugs.python.org/issue11406>
___
___
Python-bugs-list mailing list
Unsubscribe:
Evgeny Kapun added the comment:
The way how argparse currently parses option arguments is broken. If a long
option requires an argument and it's value isn't specified together with the
option (using --option=value syntax), then the following argument should be
interpreted as that
Changes by Evgeny Kapun :
--
nosy: +abacabadabacaba
___
Python tracker
<http://bugs.python.org/issue9334>
___
___
Python-bugs-list mailing list
Unsubscribe:
Changes by Evgeny Kapun :
--
nosy: +abacabadabacaba
___
Python tracker
<http://bugs.python.org/issue1508475>
___
___
Python-bugs-list mailing list
Unsubscribe:
Changes by Evgeny Kapun :
--
nosy: +abacabadabacaba
___
Python tracker
<http://bugs.python.org/issue12729>
___
___
Python-bugs-list mailing list
Unsubscribe:
Changes by Evgeny Kapun :
--
nosy: +abacabadabacaba
___
Python tracker
<http://bugs.python.org/issue12983>
___
___
Python-bugs-list mailing list
Unsubscribe:
New submission from Evgeny Kapun :
This code crashes Python:
import gc
gc.get_referents(object.__dict__)[0].clear()
gc.get_referents(type.__dict__)[0].clear()
type("A", (), {})()
--
components: Interpreter Core
messages: 139572
nosy: abacabadabacaba
priority: normal
severi
New submission from Evgeny Kapun :
TemporaryDirectory.cleanup follows symbolic links to directories and tries to
clean them as well. Try this (on Linux):
import os, tempfile
with tempfile.TemporaryDirectory() as d:
os.symlink("/proc", d + "/test")
--
comp
Changes by Evgeny Tarasov :
--
nosy: +Evgeny.Tarasov
___
Python tracker
<http://bugs.python.org/issue12251>
___
___
Python-bugs-list mailing list
Unsubscribe:
New submission from Evgeny Kapun :
This code crashes Python:
import io, mmap
io.BytesIO(b' ').readinto(memoryview(mmap.mmap(-1, 1, prot=mmap.PROT_READ)))
--
components: Interpreter Core
messages: 121446
nosy: abacabadabacaba
priority: normal
severity: normal
status:
Turnaev Evgeny added the comment:
I am sorry for my poor english. You must be misunderstood me.
I attached a file try it like this:
wget -o /dev/null http://localhost:9022/
then 5-7 times
wget -o /dev/null http://localhost:9022/s
then 4-5 times
wget -o /dev/null http://localhost:9022/
i
New submission from Turnaev Evgeny :
i have a very basic setup of logging in a long running daemon app..
I use TimedRotatingFileHandler with rotating at midnight.
The bug:
The last open logging file was for 2009-05-25..
app was running without logging anything for about a week or more.
After a
87 matches
Mail list logo