Sebastian Höfer added the comment:
I ran into the same issue and while I see that this is not a bug I would
suggest that this behaviour at least deserves a warning in the documentation
under
https://docs.python.org/3/library/enum.html#comparisons
This unexpected behaviour can not only occur
New submission from Sebastian Ramacher:
tarfile.TarInfo.frombuf has gained two more parameters: encoding and errors.
The documentation of frombuf claims that the only parameter is buf, which is
not true anymore.
--
assignee: docs@python
components: Documentation
messages: 167553
nosy
Sebastian Noack added the comment:
I would love to see a reader/writer lock implementation shipped with Python's
threading (and multiprocessing) module. But I have some issues with the patch:
1. I would avoid the terms 'read' and 'write' as those terms are referring
Sebastian Noack added the comment:
Using a lock as context manager is the same as calling
lock.acquire(blocking=True) and it will in fact block while waiting for an
other thread to release the lock. In your code, the internal lock is indeed
just hold for a very short period of time while
Sebastian Noack added the comment:
I've added a new patch, that implements a shared/exclusive lock as described in
my comments above, for the threading and multiprocessing module.
--
Added file:
http://bugs.python.org/file27350/Added-ShrdExclLock-to-threading-and-multiprocessing.
Sebastian Noack added the comment:
I was just waiting for a comment pointing out, that my patch comes without
tests. :) Note that we are still discussing the implementation and this patch
is just a proof of concept. And since the way it is implemented and the API it
provides could still
Sebastian Noack added the comment:
Yes, you could also look at the shared/exclusive lock as one lock with
different states. But this approach is neither more common, have a look at
Java's ReadWriteLock [1] for example, which works just like my patch does,
except that a factory is ret
Sebastian Noack added the comment:
@richard: I'm sorry, but both of my patches contain changes to
'Lib/threading.py' and can be applied on top of Python 3.3.0. So can you
explain what do you mean, by missing the changes
Sebastian Noack added the comment:
> If you want to argue it this way, I counter that the attributes
> "shared" and "exclusive" apply to the type of "access to the
> protected object" you are talking about, and yet, the name suggest
> that they are att
Sebastian Noack added the comment:
I would love to see how other people would implement a shared/exclusive lock
that can be acquired from different processes. However it really seems that
nobody did it before. If you know a reference implementation I would be more
than happy.
There are
Sebastian Noack added the comment:
Thanks, but as I already said there are a lot of implementations for
shared/exclusive lock that can be acquired from different threads. But we need
with threading as well as with multiprocessing.
And by the way POSIX is the standard for implementing UNIX
Sebastian Noack added the comment:
Exactly, with my implemantation "the lock acquired first will be granted
first". There is no way that either shared nor exclusive locks can starve, and
therefore it should satisfy all use cases. Since you can only share simple
datastructures lik
Sebastian Noack added the comment:
@Kristján: Uhh, that is a huge amount of code, more than twice as much (don't
counting tests) as my implementation, to accomplish the same. And it seems that
there is not much code shared between the threading and multiprocessing
implementation. And for
New submission from Sebastian Jylanki:
When debugging with some of the other very popular tools like GDB all the
threads are halted when a breakpoint is hit on any of the threads. Then threads
can be switched and analyzed separately at the current state of execution.
When debugging with PDB
New submission from Sebastian Rittau:
It was very easy to load plugin files in Python 2:
import imp
my_module = imp.load_source("what.ever", "foo.py")
Unfortunately, this became much more obscure in Python 3.3:
import importlib.machinery
loader = importlib.machin
New submission from Sebastian Kreft:
In some cases asyncio.create_subprocess_exec raises an OSError because there
are no file descriptors available.
I don't know if that is expected, but IMO I think it would be better to just
block until the required numbers of fds are available. Othe
New submission from Sebastian Kreft:
Using the asyncio.create_subprocess_exec, generates lost of internal error
messages. These messages are:
Exception ignored when trying to write to the signal wakeup fd:
BlockingIOError: [Errno 11] Resource temporarily unavailable
Getting the messages
New submission from Sebastian Kreft:
Passing an empty list/set of futures to asyncio.wait raises an Exception, which
is a little annoying in some use cases.
Probably this was the intended behavior as I see there's a test case for that.
If such, then I would propose to document that beh
Sebastian Kreft added the comment:
I agree that blocking is not ideal, however there are already some other
methods that can eventually block forever, and for such cases a timeout is
provided. A similar approach could be used here.
I think this method should retry until it can actually access
New submission from Sebastian Kreft:
Although it is already explained that the default mode of the opened tempfiles
is 'w+b' a warning/notice section should be included to make it clearer.
I think this is important as the default for the open function is to return
strings and not
Sebastian Kreft added the comment:
I'm using the Python 3.4.1 compiled from source and I'm may be hitting this
issue.
My workload is launching two subprocess in parallel, and whenever one is ready,
launches another one. In one of the runs, the whole process got stuck after
launchin
Sebastian Kreft added the comment:
@haypo: I've reproduced the issue with both 2 and 3 processes in parallel.
@glangford: the wait is actually returning after the 15 seconds, although
nothing is reported as finished. So, it's getting stuck in the while loop.
However, I imagine th
Sebastian Kreft added the comment:
The Executor is still working (but I'm using a ThreadPoolExcutor). I can
dynamically change the number of max tasks allowed, which successfully fires
the new tasks.
After 2 days running, five tasks are in this weird state.
I will change the co
Sebastian Kreft added the comment:
LGTM.
--
___
Python tracker
<http://bugs.python.org/issue21596>
___
___
Python-bugs-list mailing list
Unsubscribe:
Sebastian Kreft added the comment:
I was able to recreate the issue again, and now i have some info about the
offending futures:
State: RUNNING, Result: None, Exception: None, Waiters: 0, Cancelled: False,
Running: True, Done: False
The information does not seem very relevant. However, I can
Sebastian Kreft added the comment:
Any ideas how to debug this further?
In order to overcome this issue I have an awful workaround that tracks the
maximum running time of a successful task, and if any task has been running
more than x times that maximum I consider it defunct, and increase the
Sebastian Kreft added the comment:
I'm running actually millions of tasks, so sending them all at once will
consume much more resources than needed.
The issue happens no only with 2 tasks in parallel but with higher numbers
as well.
Also your proposed solution, has the problem that whe
Sebastian Kreft added the comment:
@glangford: Is that really your recommendation, to switch to celery? Python
3.4.1 should be production quality and issues like this should be addressed.
Note that I've successfully run millions of tasks using the same method, the
only difference being
New submission from Sebastian Kraft:
The wave module cannot read audio WAV files containing 32bit float values. This
is a very common file type for professional audio!
There has already been a patch some years ago which works fine but was finally
not applied. I can confirm that it does not
Sebastian Kraft added the comment:
Write support is no problem, I will add this.
>From reading the spec in the link you provided I think the implementation in
>general is OK.
Everything apart WAVE_FORMAT_PCM should have an extension size cbSize, that's
right. But only WAVE_FORMAT
Sebastian Kraft added the comment:
I will create a patch together with a testset of example files and also fill
out the agreement.
BTW: readframes() returns bad data for 24bit PCM if big_endian==True.
Furthermore IMO it doesn't make sense to return a byte stream in little endian
order
Sebastian Kraft added the comment:
Attached to this mail you find my patch for the implementation of support for
8, 16, 24, 32 bit signed int PCM and 32, 64 bit float.
24bit on big endian systems is buggy, but this will be reported in another
ticket.
The modified test checks all number
Sebastian Kraft added the comment:
Contribution agreement is now attached to my account. So the review can start ;)
--
___
Python tracker
<http://bugs.python.org/issue16
New submission from Sebastian Kreft:
Please find attached a patch to improve the test cases for the glob module. It
adds test cases for files starting with '.'.
--
components: Tests
files: python.patch
keywords: patch
messages: 177345
nosy: Sebastian.Kreft
priority: norma
Sebastian Kreft added the comment:
The docs don't say anything about it. However the code is there (docs bug
probably).
See the following lines in glob.py:
57 if pattern[0] != '.':
58 names = [x for x in names if x[0] != '.']
59 return fnma
New submission from Sebastian Berg:
`warnings.simplefilter` does not validate that the category passed in is
actually a class. This means that an invalid category leads to a `TypeError`
whenever a warning would otherwise occur due to `issubclass` check failing.
It is a very small thing, but
Sebastian Kraft added the comment:
Any news or feedback regarding my patch?
--
___
Python tracker
<http://bugs.python.org/issue16525>
___
___
Python-bugs-list m
New submission from Sebastian Kreft:
With Python 3.4.1 compiled from source, I'm having an issue in which every now
and then some Futures are not marked as completed even though the underlying
workload is done.
My workload is launching two subprocess in parallel, and whenever one is
Sebastian Kreft added the comment:
After more testing I finally found that in fact the process is not being
killed. That means that there is no problem with the futures. But instead it is
probably related with subprocess deadlocking, as the problematic process does
not consume any CPU.
Sorry
Sebastian Kreft added the comment:
Disregard the last messages, It seems to be a deadblocking due to subprocess.
--
___
Python tracker
<http://bugs.python.org/issue20
New submission from Sebastian Berg:
In NumPy we decided some time ago that if you have a multi dimensional buffer,
shaped for example 1x10, then this buffer should be considered both C- and
F-contiguous. Currently, some buffers which can be used validly in a contiguous
fashion are rejected
Sebastian Berg added the comment:
#12845 should be closed, seems like a bug in some old version. The definition
now is simply that the array is contiguous if you can legally access it in a
contiguous fashion. Which means first stride is itemsize, second is
itemsize*shape[0] for Fortran
Sebastian Berg added the comment:
To be clear, the important part here, is that to me all elements *can* be
accessed using that scheme. It is not correct to assume that `stride[-1]` or
`stride[0]` is actually equal to `itemsize`.
In other words, you have to be able to pass the pointer to the
Sebastian Berg added the comment:
Well, the 9223372036854775807 is certainly no good for production code and we
would never have it in a release version, it is just there currently to expose
if there are more problems. However I don't care what happens on overflow (as
long as it is n
Sebastian Berg added the comment:
An extra dimension is certainly not irrelevant! The strides *are* valid
and numpy currently actually commonly creates such arrays when slicing.
The question is whether or not we want to ignore them for contiguity
checks even if they have no effect on the memory
Sebastian Berg added the comment:
I am very sorry. The attached patch fixes this (not sure if quite right, but if
anything should be more general then necessary). One test fails, but it looks
like exactly the intended change.
--
Added file: http://bugs.python.org/file36676/relaxed
Changes by Sebastian Berg :
Added file: http://bugs.python.org/file36677/relaxed-strides-checking.patch
___
Python tracker
<http://bugs.python.org/issue22445>
___
___
Changes by Sebastian Berg :
Added file: http://bugs.python.org/file36678/contiguous.py
___
Python tracker
<http://bugs.python.org/issue22445>
___
___
Python-bugs-list m
Changes by Sebastian Berg :
Added file: http://bugs.python.org/file36680/contiguous.py
___
Python tracker
<http://bugs.python.org/issue22445>
___
___
Python-bugs-list m
Sebastian Berg added the comment:
Yeah, the code does much the same as the old numpy code (at least most of the
same funny little things, though I seem to remember the old numpy code had
something yet a bit weirder, would have to check).
To be honest, I do not know. It isn't implausible
Sebastian Berg added the comment:
Numpy 1.9. was only released recently, so 1.10. might be a while. If no
problems show up during release or until then, we will likely switch it
by then. But that could end up being a year from now, so I am not sure
if 3.6 might not fit better. The problems
Changes by Sebastian Rodriguez :
--
nosy: +srodriguez
___
Python tracker
<http://bugs.python.org/issue17140>
___
___
Python-bugs-list mailing list
Unsubscribe:
New submission from Sebastian Rittau:
Consider the attached test case. This test will run fine with Python 2.7, but
will fail with Python 3.3. If cgi.FieldStorage() tries to parse a multipart
request without a Content-Length header in the main section, segments will have
a length of 0
Changes by Sebastian Rittau :
--
type: -> behavior
___
Python tracker
<http://bugs.python.org/issue20504>
___
___
Python-bugs-list mailing list
Unsubscrib
Sebastian Kraft added the comment:
After the last changes in the development version of python 3.4 the patch
cannot be applied anymore. As the the other audio file readers and the wave
module share a common API it may be not desireable to simply enhance the wave
module with support for
Changes by Sebastian Ramacher :
--
nosy: +sebastinas
___
Python tracker
<http://bugs.python.org/issue6952>
___
___
Python-bugs-list mailing list
Unsubscribe:
New submission from Sebastian Thiel :
The section starting with:
"If a class defines a slot also defined in a base class, the instance
variable
defined by the base class slot is inaccessible rendering the meaning
of the
program undefined. [...]"
would need to be revisited as it c
Sebastian Thiel added the comment:
Additional Information:
"multiple bases have instance lay-out conflict"
This happens only if I add __slots__ to the bases so that there is no
dict. I can reproduce this easily by indirectly deriving a class from
two bases that both define the same
New submission from Sebastian Hagen :
In either python 3.0, bytes instances cannot be copied, and (even
trivial) bytes subclasses cannot be unpickled unless they explicitly
override __getnewargs__() or __reduce_ex__().
Copy problem:
>>> import copy; copy.copy(b'foo')
Tracebac
New submission from Sebastian Hagen :
Most of the functions in Python's stdlib that take filename parameters
allow for those parameters to be buffer (such as bytes, bytearray,
memoryview) objects. This is useful for various reasons, among them that
on Posix-likes, file- and pathnames ultim
Changes by Sebastian Hagen :
--
type: -> behavior
___
Python tracker
<http://bugs.python.org/issue7560>
___
___
Python-bugs-list mailing list
Unsubscri
Changes by Sebastian Hagen :
Removed file: http://bugs.python.org/file15659/posix_fn_bytes_01.patch
___
Python tracker
<http://bugs.python.org/issue7560>
___
___
Pytho
Sebastian Hagen added the comment:
I'm taking that patch back. More testing would have been in order before
posting; sorry for that, will repost once I've got the obvious problems
worked out.
--
___
Python tracker
<http://bugs.python.
Sebastian Hagen added the comment:
And further testing reveals that all of this has in fact already been
fixed in trunk. I assumed it hadn't been, because the code for at least
some of the relevant functions in Modules/_posixmodule.c is the same as
in 3.1.1; I didn't know that the sam
Changes by Sebastian Hagen :
--
status: open -> closed
versions: -Python 3.2
___
Python tracker
<http://bugs.python.org/issue7560>
___
___
Python-bugs-list mai
New submission from Sebastian Hagen :
Various functions in the 'posix' module that take filename arguments
accept bytearray values for those arguments, and mishandle those objects
in a way that leads to segfaults.
Python 3.1 (r31:73572, Jul 23 2009, 23:41:26)
[GCC 4.3.3] on linux2
Sebastian Hagen added the comment:
Not exactly. The last part fixes the second problem, which you get for
non-zero-length bytearrays. But without the first fix, zero-length
bytearrays still lead to a crash:
Python 3.2a0 (py3k:77001M, Dec 22 2009, 18:17:08)
[GCC 4.3.4] on linux2
Type "
Sebastian Hagen added the comment:
You're correct about PyUnicode_FSConverter(), which is why the very
first part of my patch fixes that function. Only fixing that one will
get rid of the segfaults, but also lead to incorrect error reporting for
the zero-length bytearray case; the byte
Sebastian Hagen added the comment:
Correction: "Only fixing that one will
get rid of the segfaults" ... well, for mkdir() on GNU/Linux, anyway.
POSIX.1-2008 doesn't specify what happens if you call mkdir() with a
NULL pointer, so I guess other conforming implementations migh
Sebastian Hagen added the comment:
I've glanced at some of the other PyByteArray_AS_STRING() (and
PyByteArray_AsStr(), which inherits this behaviour) uses in the stdlib.
By far the heaviest user is bytearrayobject.c; aside from that, there's
by my count only 24 uses in current trunk.
Sebastian Hagen added the comment:
Well, it doesn't *need* to accept them ... but it would certainly be
nice to have. If you've already got the filename in a bytearray object
for some reason, being able to pass it through directly saves you both a
copy and the explicit conversion code
Sebastian Hagen added the comment:
Oh, and *forcing* use of the PEP 383 hack for such interfaces would
really be the Wrong Thing. Byte sequences are the natural (and most
efficient, and least prone to misunderstandings) way to store filenames
on a posix-like. Storing them as unicode-except-not
Changes by Sebastian Ramacher :
--
nosy: +sebastinas
___
Python tracker
<http://bugs.python.org/issue5322>
___
___
Python-bugs-list mailing list
Unsubscribe:
New submission from Sebastian Billaudelle :
Hi there,
I just recognized a weird behaviour of the json module...
Dumpig a float like 0.1 I get some crazy output.
Here is an example:
>>> import json
>>> json.dumps([.1])
'[0.10001]'
Very simple
Changes by Sebastian Ramacher :
--
nosy: +sebastinas
___
Python tracker
<http://bugs.python.org/issue6243>
___
___
Python-bugs-list mailing list
Unsubscribe:
Changes by Sebastian Rittau :
--
nosy: -srittau
___
Python tracker
<http://bugs.python.org/issue2736>
___
___
Python-bugs-list mailing list
Unsubscribe:
Sebastian Berg added the comment:
This is closed, and maybe I am missing something. But from a general point of
view, why does hashing of NaN not raise an error as it did for decimals, i.e.
why was this not resolved exactly the other way around? I am mostly just
wondering about this it is not
Sebastian Berg added the comment:
Thanks, yes, you are right, should have googled a bit more anyway. Though I did
not find much on the hashable vs unhashable itself, so if I ever stumble across
it again, I will write a mail...
--
___
Python tracker
Changes by Sebastian Kraft :
Removed file: http://bugs.python.org/file28122/wave_float_issue16525.patch
___
Python tracker
<http://bugs.python.org/issue16525>
___
___
Sebastian Kraft added the comment:
Thanks for the hint Harvey!
I have updated my patch to include your changes, but only applied the second
hunk for the following reasons:
Wave_read should not assume any wave format, as it is expected to open a file
during initialization. So actually the only
Sebastian Berg added the comment:
@pitrou, yes of course. This would make python do the same thing as numpy does
(currently only with that compile flag given).
About the time schedule, I think I will try to see if some other numpy dev has
an opinion. Plus, should look into documenting it for
Sebastian Berg added the comment:
Antoine, sounds good to me, I don't mind this being in python rather sooner
then later, for NumPy itself it does not matter I think. I just wanted to warn
that there were problems when we first tried to switch in NumPy, which, if I
remember correctly, i
New submission from Sebastian Bank:
ConfigParser parses section lines containing square brackets like '[spam [eggs]
spam]' up to the first instead of the last occurrence of ']' preventing
roundtrips:
>>> s = StringIO()
>>> c1 = ConfigParser()
>>&g
Sebastian Bank added the comment:
If this is the intended behaviuour, I guess ConfigParser should warn the user
if he supplies a section name with a ']' (prevent failed roundtrips).
See http://bugs.python.org/issue23301
The current behaviour looks like the opposite of Po
Sebastian Berg added the comment:
Numpy does not understand suboffsets. The buffers we create will always have
them NULL. The other way around To be honest, think it is probably ignoring
the whole fact that they might exist at all :/, really needs to be fixed if it
is the case
Sebastian Berg added the comment:
I do not have an opinion either way, but I do think there is a small difference
here compared to the other issue. With the other issue, there are cases where
we cannot set the strides correctly.
If you ask numpy directly whether the array is contiguous (or
New submission from Sebastian Noack:
In order to prevent the mimetypes module from considering global files and
registry entries, you have to call mimetypes.init([]). However, this will
enforce that behavior globally, and only works if the module wasn't initialized
yet.
There is a
New submission from Sebastian Kreft:
The return type of email.header.decode_header is not consistent. When there are
encoded parts the return type is a list of (bytes, charset or None) (Note that
the documentation says it is a list of (str, charset)). However, when there are
no encoded parts
Sebastian Kreft added the comment:
And what would the new API be?
There is nothing pointing to it either in the documentation
https://docs.python.org/3.4/library/email.header.html or source code.
--
___
Python tracker
<http://bugs.python.
New submission from Sebastian Kreft:
ImportError now supports the keyword arguments name and path. However, when
passing invalid keyword arguments, the reported error is misleading, as shown
below.
In [1]: ImportError('lib', name='lib')
Out[1]: ImportError('lib
Sebastian Rittau added the comment:
Is there any progress on this? The fix seems trivial.
--
___
Python tracker
<http://bugs.python.org/issue20504>
___
___
Pytho
Sebastian Bank added the comment:
Terry: I am not so sure about that interpretation. Do we agree that the
INI-files are the data/message? ConfigParser refuses to accept dirty INI-Files
(with ']' in section names) but will produce this kind of files.
I we see the arguments given to Co
New submission from Sebastian Linke:
With the attached patch I propose to add a new function to the "collections"
module. It is meant to be used for determining whether a given subsequence is
part of a particular sequence (with respect to the ordering of the
subsequence).
Doing th
Sebastian Linke added the comment:
@Josh
What is the point of using iterators here? If the user wants an iterator to be
checked then he can throw that iterator right away because it was exhausted by
the function. I think that in most cases the user wants to do some
postprocessing on a
Sebastian Linke added the comment:
Slightly modified the implementation to return the index rather than a boolean.
--
Added file: http://bugs.python.org/file41374/subseq_index.patch
___
Python tracker
<http://bugs.python.org/issue25
New submission from Sebastian Rittau:
The HTTP status code constants in Python 3.5 http.client are not compatible
with the constants in Python 3.4, since the str() behaviour is different. This
breaks code:
srittau@moby:~$ python3.5
Python 3.5.1+ (default, Jan 13 2016, 15:09:18)
[GCC 5.3.1
Sebastian Rittau added the comment:
It is no doubt that is easy to work around. Once I found the problem it took
about five minutes to fix it and roll a new release. And of course for Python
3.5+ code it is better to use the enum http.HTTPStatus directly (I actually
like that enum a lot). But
New submission from Sebastian Bank:
Under Python 2.7.11 (Win 7), saving of the IDLE shell output produces no file
if the output contains non-ASCII characters, e.g. after doing (before this, it
does work):
>>> print u'sp\xe4m'
späm
>>>
When saving (generally),
New submission from Sebastian Rittau:
I am using cgi.py in WSGI applications, using Apache and mod_wsgi.
Unfortunately cgi.py keeps spamming the error log with messages like the
following:
Exception ignored in:
Traceback (most recent call last):
File "/usr/lib/python3.5/cgi.py"
New submission from Sebastian Cufre:
We have found that you can produce a crash when an instance of
_io.TextIOWrapper is being deallocated while there's another thread invoking
the garbage collector. I've attached a simple script that should reproduce the
issue (textiowrappe
201 - 300 of 313 matches
Mail list logo