Thomas added the comment:
@khaledk I finally got some time off, so here you go
https://github.com/1/ParallelZipFile
I can not offer any support for a more correct implementation of the zip
specification due to time constraints, but maybe the code is useful for you
anyway
I'm trying to write a program to test a persons typing speed and show
them their mistakes. However I'm getting weird results when looking
for the differences in longer strings:
import difflib
a =
'012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678
New submission from Thomas :
I'm looking for clarification as to how `from x import *` should operate when
importing file/directory-based modules versus when importing a sub-module from
within a directory-based module.
While looking into a somewhat related issue with pylint, I noticed
Thomas added the comment:
I've spent a bit of time building (and rebuilding) Python 3.9 with a modified
`Lib/importlib/_bootstrap.py`/regenerated `importlib.h` to give me some extra
logging, and believe the answer I was looking for is `_find_and_load_unlocked`.
`_find_and_load_unl
Thomas added the comment:
Ahh, I always forget about blame.
Though the form was different, the initial commit of `importlib` (authored by
Brett, so the nosy list seems fine for the moment) behaved the same way, and
had an additional comment noting that the section in question was included
Thomas added the comment:
The monkey patch works for me! Thank you very much! (I have only tested
reading, not writing).
However, the lock contention of Python's ZipFile is so bad that using multiple
threads actually makes the code run _slower_ than single threaded code when
reading
Change by Thomas :
--
keywords: +patch
nosy: +thmsdnnr
nosy_count: 6.0 -> 7.0
pull_requests: +25650
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/27105
___
Python tracker
<https://bugs.python.org/i
New submission from Thomas :
@classmethod defines a __wrapped__ attribute that always points to the inner
most function in a decorator chain while functool's update_wrapper has been
fixed to set the wrapper.__wrapped__ attribute after updating the
wrapper.__dict__ (see
Thomas added the comment:
I added a pull request to attempt to fix this issue. It received a label but no
review and has gone stale, so I am sending out a ping.
--
___
Python tracker
<https://bugs.python.org/issue34
New submission from Thomas :
There is no heappush function for a max heap when the other supporting helper
functions are already implemented (_siftdown_max())
--
components: Library (Lib)
messages: 402351
nosy: ThomasLee94
priority: normal
severity: normal
status: open
title: No
Change by Thomas :
--
nosy: +rhettinger, stutzbach -ThomasLee94
___
Python tracker
<https://bugs.python.org/issue45259>
___
___
Python-bugs-list mailin
Change by Thomas :
--
versions: +Python 3.10, Python 3.11, Python 3.6, Python 3.7, Python 3.8
___
Python tracker
<https://bugs.python.org/issue45259>
___
___
Thomas added the comment:
Hello everyone,
A quick look on SO and Google + this python issue + this blog post and its
comments:
https://florimond.dev/en/posts/2018/10/reconciling-dataclasses-and-properties-in-python/
show that this is still a problem where dataclass users keep hitting a
Thomas added the comment:
Thinking a little more about this, maybe a different solution would be to have
default values be installed at the class level by default without being
overwritten in the init, as is the case today. default_factory should keep
being set in the init as is the case
Thomas added the comment:
Scratch that last one, it leads to problem when mixing descriptors with actual
default values:
@dataclass
class Foo:
bar = field(default=some_descriptor)
# technically this is a descriptor field without a default value or at the
very least, the dataclass
Thomas added the comment:
Agreed on everything but that last part, which I'm not sure I understand:
> If we allow descriptor to accept an iterable as well you could have multiple
> descriptors just like normal.
Could you give an example of what you mean with a regular class?
I
Thomas added the comment:
Just to rephrase, because the explanation in my last message can be ambiguous:
At dataclass construction time (when the @dataclass decorator inspects and
enhances the class):
for field in fields:
if descriptor := getattr(field, 'descriptor'):
Thomas added the comment:
> An example of multiple descriptors would be to have:
> @cached_property
> @property
> def expensive_calc(self):
> #Do something expensive
That's decorator chaining. The example you gave is not working code (try to
return something from expe
New submission from Thomas :
According to https://docs.python.org/3.5/whatsnew/changelog.html#id108
bpo-14099, reading multiple ZipExtFiles should be thread-safe, but it is not.
I created a small example where two threads try to read files from the same
ZipFile simultaneously, which crashes
Change by Thomas :
--
components: +Library (Lib)
type: -> crash
___
Python tracker
<https://bugs.python.org/issue42369>
___
___
Python-bugs-list mai
Thomas added the comment:
I have not observed any segfaults yet. Only zipfile.BadZipFile exceptions so
far.
The exact file at which it crashes is fairly random. It even crashes if all
threads try to read the same file multiple times.
I think the root cause of the problem is that the reads
Thomas added the comment:
Scratch what I said in the previous message. I thought that the lock was
created in _SharedFile and did not notice that it was passed as a parameter.
--
___
Python tracker
<https://bugs.python.org/issue42
Thomas added the comment:
I have simplified the test case a bit more:
import multiprocessing.pool, zipfile
# Create a ZipFile with two files and same content
with zipfile.ZipFile("test.zip", "w", zipfile.ZIP_STORED) as z:
z.writestr("file1", b"0"*1
Thomas added the comment:
We ran into this issue in the context of asyncio which uses an internal
ThreadPoolExecutor to provide an asynchronous getaddrinfo / getnameinfo.
We observed an async application spawned more and more threads through several
reconnects. With a maximum of 5 x CPUs
Thomas added the comment:
Martin: Thanks for your quick answer (and sorry for sending the whole file) !
I think it is indeed a good idea to detach the proxy connection and treat it as
any other connection, as you did in your patch. It would be great if you would
be able to dig it up
New submission from Thomas:
Passing ctypes.Union types as arguments crashes python.
Attached is a minimal example to reproduce. Due to undefined behavior, you may
have to increase the union _fields_ to reproduce. I tested with 3.5.1 and
2.7.11.
It seems that cffi treats the union as a normal
Thomas added the comment:
Note [http://www.atmark-techno.com/~yashi/libffi.html]
> Although ‘libffi’ has no special support for unions or bit-fields, it is
> perfectly happy passing structures back and forth. You must first describe
> the structure to ‘libffi’ by creating a new
Thomas added the comment:
So after some more pondering about the issue I read the documentation again:
> Warning ctypes does not support passing unions or structures with bit-fields
> to functions by value.
Previously I always read this as 'does not support passing unions with
New submission from Thomas:
SimpleHTTPServer and http.server allow directory traversal on Windows.
To exploit this vulnerability, replace all ".." in URLs with "c:c:c:..".
Example:
Run
python -m http.server
and visit
127.0.0.1:8000/c:c:c:../secret_file_that_should_be_s
Thomas added the comment:
Martin Panter: Regarding the warning, you appear to be correct.
However, reading the source of http.server again made me notice
_url_collapse_path(path)
which seems to have some overlap with translate_path. Also it
crashes with an IndexError if path contains '..
Thomas added the comment:
Looks ok to me security-wise. But I just noticed that it the trailing slash is
inconsistent on Windows, e.g.:
translate_path('asdf/')
==
'C:\\Users\\User\\Desktop\\temp\\asdf/' <- this slash
because path += '/' is used instead of o
Changes by Thomas :
Added file: http://bugs.python.org/file42372/libfoo.c
___
Python tracker
<http://bugs.python.org/issue26628>
___
___
Python-bugs-list mailin
Thomas added the comment:
Thanks Eryk for the additional explanation. I added a more elaborate example
that doesn't abuse the standard c function that actually doesn't expect a union:
% gcc -shared -fPIC libfoo.c -o libfoo.so -Wall
% python pyfoo.py
New submission from Thomas:
Trying to use any kind of python gdb integration results in the following error:
(gdb) py-bt
Traceback (most recent call first):
Python Exception Invalid cast.:
Error occurred in Python command: Invalid cast.
I have tracked it down to the _type_... globals, and I
Thomas added the comment:
I have done a bit more digging, turns out it is actually no problem at all to
debug python in gdb with gdb with python support (at least using a fixed
python-gdb-py).
Turns out the type->length of the the globally initialized ptr types is wrong:
It is 4 instead o
Thomas added the comment:
The second option seems like the safest choice, attached is a patch that
addresses just that.
--
keywords: +patch
Added file: http://bugs.python.org/file42538/gdb-python-invalid-cast.patch
___
Python tracker
<h
Thomas added the comment:
Thank you for the quick integration and fixing the return. I have signed the
electronic form yesterday.
--
___
Python tracker
<http://bugs.python.org/issue26
New submission from Thomas:
If a callback function returns a ctypes._SimpleCData object, it will fail with
a type error and complain that it expects a basic type.
Using the qsort example:
def py_cmp_func(a, b):
print(a.contents, b.contents)
return c_int(0)
> TypeError: an integer
Change by Thomas Klausner :
--
pull_requests: +28257
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/30032
___
Python tracker
<https://bugs.python.org/issu
Thomas Klausner added the comment:
gcc supports this flag. According to the man page:
This option consistently for both compilation and linking. This option is
supported on GNU/Linux targets, most other Unix derivatives, and also on x86
Cygwin and MinGW targets.
On NetBSD, using -pthread
Thomas Klausner added the comment:
I must confess, I don't know.
This patch has been in pkgsrc since at least the import of the first python 2.7
package in 2011, and I haven't dug deeper.
If you think it is unnecessary, I'll trust you. I've just removed it from the
py
Thomas Klausner added the comment:
Not interested in this any longer, and Dragonfly's Dports doesn't carry this
patch, so it's probably not needed any longer.
--
stage: -> resolved
status: open -> closed
___
P
New submission from Thomas Klausner :
On NetBSD by default, the following tests do not finish in > 1h:
1:07:13 load avg: 0.00 running: test_compileall (1 hour 7 min),
test_multiprocessing_fork (1 hour 7 min), test_concurrent_futures (1 hour 6 min)
Defining HAVE_BROKEN_POSIX_SEMAPHORES fi
Change by Thomas Klausner :
--
keywords: +patch
pull_requests: +28272
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/30047
___
Python tracker
<https://bugs.python.org/issu
New submission from Thomas Klausner :
When compiling Python on NetBSD, the ossaudio module is not enabled.
1. the code tries to export some #define that are not in the public OSS API
(but that some other implementations provide)
2. on NetBSD, you need to link against libossaudio when using OSS
Change by Thomas Klausner :
--
keywords: +patch
pull_requests: +28285
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/30065
___
Python tracker
<https://bugs.python.org/issu
Change by Thomas Klausner :
--
pull_requests: +28286
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/30066
___
Python tracker
<https://bugs.python.org/issu
New submission from Thomas Wouters :
The PyUnicode_FSConverter function has confusing reference semantics, and
confusing documentation.
https://docs.python.org/3/c-api/unicode.html#c.PyUnicode_FSConverter says the
output argument "must be a PyBytesObject* which must be released when it
Thomas Grainger added the comment:
> Actually I don't agree with Thomas's logic... his argument feels like
> consistency for its own sake.
Do you expect sync and async contextmanagers to act differently?
Why would sync contextmanagers raise AttributeError and async contextm
Thomas Gläßle added the comment:
Ok, it seems at least the incorrect documentation has been fixed in the mean
time.
I'm going to close this as there seems to be no capacity to deal with this.
--
___
Python tracker
<https://bugs.py
Change by Thomas Gläßle :
--
stage: patch review -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.org/issue34624>
___
___
Pyth
New submission from Thomas Wouters :
test_pathlib contains, in PosixPathTest.test_expanduser, a check that
expanduser on a nonexistent user will raise RuntimeError. Leaving aside the
question why that's a RuntimeError (which is probably too late to fix anyway),
the test performs this
Change by Thomas Grainger :
--
nosy: +graingert
nosy_count: 3.0 -> 4.0
pull_requests: +28454
pull_request: https://github.com/python/cpython/pull/30233
___
Python tracker
<https://bugs.python.org/issu
Thomas Grainger added the comment:
actually it was already done in 13 months!
--
___
Python tracker
<https://bugs.python.org/issue38415>
___
___
Python-bug
New submission from Thomas Klausner :
The configure script uses the test(1) '==' operator, which is only supported by
bash. The standard comparison operator is '='.
--
components: Installation
messages: 410120
nosy: wiz
priority: normal
severity: normal
status: op
Change by Thomas Klausner :
--
keywords: +patch
pull_requests: +28693
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/30490
___
Python tracker
<https://bugs.python.org/issu
Change by Thomas Klausner :
--
nosy: +wiz
nosy_count: 8.0 -> 9.0
pull_requests: +28694
pull_request: https://github.com/python/cpython/pull/30490
___
Python tracker
<https://bugs.python.org/issu
Thomas Klausner added the comment:
ping - this patch needs a review
--
___
Python tracker
<https://bugs.python.org/issue46053>
___
___
Python-bugs-list mailin
Thomas Klausner added the comment:
ping - this patch needs a review
--
___
Python tracker
<https://bugs.python.org/issue46045>
___
___
Python-bugs-list mailin
New submission from Thomas Cellerier :
`IPv*Network` and `IPv*Interface` constructors accept a 2-tuple of (address
description, netmask) as the address parameter.
When the tuple-based address is used errors are not propagated correctly
through the `ipaddress.ip_*` helper because of the
Change by Thomas Cellerier :
--
keywords: +patch
pull_requests: +28845
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/30642
___
Python tracker
<https://bugs.python.org/issu
Change by Thomas Cellerier :
--
title: ipaddress.ip_{address,network,interface} raise TypeError instead of
ValueError if given a tuple as address ->
ipaddress.ip_{address,network,interface} raises TypeError instead of ValueError
if given a tuple as addr
Thomas Klausner added the comment:
Thanks for merging this, @serhiy.storchaka!
--
___
Python tracker
<https://bugs.python.org/issue46045>
___
___
Python-bug
New submission from Thomas Grainger :
>>> import types
>>> types.ModuleType("concurrent.futures").missing_attribute
Traceback (most recent call last):
File "", line 1, in
AttributeError: module 'concurrent.futures' has no attribute &
Thomas Grainger added the comment:
this also applies to io and _pyio
--
___
Python tracker
<https://bugs.python.org/issue46522>
___
___
Python-bugs-list mailin
Thomas Grainger added the comment:
there's a thread on typing-sig for this now:
https://mail.python.org/archives/list/typing-...@python.org/thread/I7P3ER2NH7SENVMIXK74U6L4Z5JDLQGZ/#I7P3ER2NH7SENVMIXK74U6L4Z5JDLQGZ
--
nosy: +graingert
___
P
Change by Thomas Grainger :
--
nosy: +graingert, vstinner
___
Python tracker
<https://bugs.python.org/issue42752>
___
___
Python-bugs-list mailing list
Unsub
New submission from Thomas Grainger :
now that the getaddrinfo lock has been removed on all platforms the numeric
only host resolve in asyncio could be moved back into BaseEventLoop.getaddrinfo
--
components: asyncio
messages: 413699
nosy: asvetlov, graingert, yselivanov
priority
Change by Thomas Grainger :
--
keywords: +patch
pull_requests: +29627
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/31497
___
Python tracker
<https://bugs.python.org/issu
Thomas Grainger added the comment:
hello, it's actually a bit of a round about context, but it was brought up on a
tornado issue where I was attempting to port the asyncio optimization to
tornado:
https://github.com/tornadoweb/tornado/issues/3113#issuecomment-1041019287
I think it wou
New submission from Thomas Grainger :
the following code:
import socket
import asyncio
async def amain():
with socket.socket(family=socket.AF_INET, proto=socket.IPPROTO_UDP,
type=socket.SOCK_DGRAM) as sock:
sock.setblocking(False)
await asyncio.get_running_loop
Change by Thomas Grainger :
--
keywords: +patch
pull_requests: +29629
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/31499
___
Python tracker
<https://bugs.python.org/issu
Thomas Grainger added the comment:
there could be multiple messages here
perhaps it could be:
```
finally:
# Must reacquire lock even if wait is cancelled
cancelled = []
while True:
try:
await self.acquire
Change by Thomas Wouters :
--
nosy: +twouters
___
Python tracker
<https://bugs.python.org/issue46885>
___
___
Python-bugs-list mailing list
Unsubscribe:
Thomas Grainger added the comment:
The main advantage for my usecase is support for heterogeneous unpacking
On Sat, Mar 5, 2022, 6:04 PM Alex Waygood wrote:
>
> Alex Waygood added the comment:
>
> I sense we'll have to agree to disagree on the usefulness of NamedTuple
New submission from Thomas Heller:
In a windows debug build, an assertion is triggered when os.execvpe is
called with an empty argument list:
self.assertRaises(OSError, os.execvpe, 'no such app-', [], None)
The same problem is present in the trunk version.
Attached is a patch that
New submission from Thomas Heller:
test test_builtin failed -- Traceback (most recent call last):
File "c:\svn\py3k\lib\test\test_builtin.py", line 1473, in test_round
self.assertEqual(round(1e20), 1e20)
AssertionError: 0 != 1e+020
--
components: Windows
messages:
New submission from Thomas Heller:
Unicode errors in various tests - not only in test_glob:
test_glob
test test_glob failed -- Traceback (most recent call last):
File "c:\svn\py3k\lib\test\test_glob.py", line 87, in
test_glob_directory_names
eq(self.glob('*',
Thomas Heller added the comment:
BTW, setting the environment variable TZ to, say, 'GMT' makes the
problem go away.
__
Tracker <[EMAIL PROTECTED]>
<http://bugs.p
New submission from Thomas Heller:
In my german version of winXP SP2, python3 cannot import the time module:
c:\svn\py3k\PCbuild>python_d
Python 3.0x (py3k:57600M, Aug 28 2007, 07:58:23) [MSC v.1310 32 bit
(Intel)] on win32
Type "help", "copyright", "credits"
New submission from Thomas Heller:
Running the PCBuild\rt.bat script fails when it compares the expected output
with the actual output. Some inspection shows that the comparison fails
because
there are '\n' linefeeds in the expected and '\n\r' linefeeds in the
actual ou
Thomas Wouters added the comment:
I'd like to check this into the trunk, without the non-step-1 support
for now, so that we can remove simple slicing from the py3k branch. We
can always add non-step-1 support later (all the sooner if someone who
isn't me volunteers to do the painful bi
Thomas Wouters added the comment:
I prefer the current method, as it's more obviously walking in two
strides across the same array. I also dislike hiding the final memmove()
of the tail bit inside the loop. As for which is more obvious, I would
submit neither is obvious, as it took me qu
Thomas Wouters added the comment:
Committed revision 57619.
--
assignee: -> twouters
resolution: -> fixed
status: open -> closed
_
Tracker <[EMAIL PROTECTED]>
<http://bugs.pytho
Thomas Wouters added the comment:
Committed revision 57619.
--
assignee: -> twouters
resolution: -> fixed
status: open -> closed
_
Tracker <[EMAIL PROTECTED]>
<http://bugs.pytho
Thomas Wouters added the comment:
Committed revision 57619.
--
assignee: -> twouters
resolution: -> fixed
status: open -> closed
_
Tracker <[EMAIL PROTECTED]>
<http://bugs.pytho
Thomas Wouters added the comment:
Committed revision 57619.
--
assignee: -> twouters
resolution: -> fixed
status: open -> closed
_
Tracker <[EMAIL PROTECTED]>
<http://bugs.pytho
Thomas Wouters added the comment:
Committed revision 57619.
--
assignee: -> twouters
resolution: -> fixed
status: open -> closed
_
Tracker <[EMAIL PROTECTED]>
<http://bugs.pytho
Thomas Wouters added the comment:
Committed revision 57619.
--
assignee: -> twouters
resolution: -> fixed
status: open -> closed
_
Tracker <[EMAIL PROTECTED]>
<http://bugs.pytho
New submission from Thomas Wouters:
test_cmd_line tests various things by spawning sys.executable.
Unfortunately it does so without passing the -E argument (which 'make
test' does do) so environment variables like PYTHONHOME and PYTHONPATH
can cause the test to fail.
-
Thomas Wouters added the comment:
Added tests (by duplicating any slicing operations in the test suite
with extended slice syntax, to force the use of slice-objects ;)
_
Tracker <[EMAIL PROTECTED]>
<http://bugs.python.org/iss
Changes by Thomas Wouters:
_
Tracker <[EMAIL PROTECTED]>
<http://bugs.python.org/issue1617699>
_
___
Python-bugs-list mailing list
Unsubscribe:
http://mail.python
Thomas Heller added the comment:
IMO the very best would be to avoid as many conversions as possible by
using the wide apis on Windows. Not for _tzname maybe, but for env
vars, sys.argv, sys.path, and so on. Not that I would have time to work
on that
Changes by Thomas Wouters:
_
Tracker <[EMAIL PROTECTED]>
<http://bugs.python.org/issue1617699>
_
___
Python-bugs-list mailing list
Unsubscribe:
http://mail.python
Thomas Heller added the comment:
Applied in rev. 57731.
--
resolution: accepted -> fixed
status: open -> closed
__
Tracker <[EMAIL PROTECTED]>
<http://bugs.pytho
Thomas Heller added the comment:
Set to accepted. As pointed out in private email, please apply it to
the trunk.
Your thoughts about the 'length' of pointers make sense, and are very
similar to what I had in mind when I implemented pointer indexing.
For indexing pointers, negative i
Changes by Thomas Heller:
--
assignee: theller -> twouters
_
Tracker <[EMAIL PROTECTED]>
<http://bugs.python.org/issue1617699>
_
___
Python-bugs-li
Thomas Wouters added the comment:
Well, that's not quite how I implemented the slicing, and it's also not
how the existing simple-slicing was implemented: A negative start index
is taken to mean 0, and a stop index below the start index is taken to
mean 'the start index'
Thomas Heller added the comment:
Yes.
But looking at your examples I think it would be better to forbid
missing indices completely instead of allowing them only where they
clearly mean 0.
Writing (and reading!) a 0 is faster than thinking about if a missing
index is allowed or what it means
Thomas Wouters added the comment:
Hmmm Well, that's fine by me, but it changes current behaviour, and
in a way that ctypes own testsuite was testing, even ;) (it does, e.g.,
'p[:4]' in a couple of places.) Requiring the start always would
possibly break a lot of code. We coul
1 - 100 of 1791 matches
Mail list logo