Change by h-vetinari :
--
nosy: +h-vetinari
___
Python tracker
<https://bugs.python.org/issue46657>
___
___
Python-bugs-list mailing list
Unsubscribe:
Andreas H. added the comment:
Inside the discussion an ExitPool class is sketched
(https://mail.python.org/archives/list/python-id...@python.org/message/66W55FRCYMYF73TVMDMWDLVIZK4ZDHPD/),
which provides this removal of context managers.
What I learned is that this would have different
Change by Andreas H. :
--
pull_requests: +29443
pull_request: https://github.com/python/cpython/pull/31283
___
Python tracker
<https://bugs.python.org/issue46
Andreas H. added the comment:
Allright. B) sounds good to me. I dont think I have time today, so please feel
to tackle the issue. If not I can look at it the next week.
--
___
Python tracker
<https://bugs.python.org/issue46
New submission from Andreas H. :
TypedDict does not resolve cross-module ForwardRefs when the ForwardRef is not
a direct one.
In other words the fix GH-27017 (issue 41249) for TypedDict seems incomplete.
The same issue seem to exist for NamedTuple.
Example:
#module.py
TD
New submission from Andreas H. :
(De)Serialization of in-memory data structures is an important application.
However there is a rather unpleasant issue with ForwardRefs.
One cannot export type aliases when they contain ForwardRefs (and expect
things to work).
Consider the example
New submission from Andreas H. :
Consider the following:
NewT = typing.NewType("NewT", typing.List[typing.Optional['Z']] )
class Z:
pass
Now get_type_hints() does not resolve the ForwardRef within NewType (but it
does so for TypedDict, dataclasses, Na
Andreas H. added the comment:
Ah, let me add one point: PEP563 (-> `from __future__ import annotations`) is
also not helping.
Even with PEP563 enabled, the JSON example
Json = Union[ List['Json'], Dict[str, 'Json'], int, float, bool, None ]
needs to be writte
Andreas H. added the comment:
Yeah, sure. The use-case is (de)serialization. Right now I use the library
cattr, but there are many others.
If you are interested there is related discussion in the cattr board [1].
The original problem is how to define the types for serialization.
1. If
Andreas H. added the comment:
I will give it a try.
--
___
Python tracker
<https://bugs.python.org/issue46333>
___
___
Python-bugs-list mailing list
Unsub
New submission from Andreas H. :
The __eq__ method of ForwardRef does not take into account the module
parameter.
However, ForwardRefs with dissimilar module parameters are referring to
different types even if they have different name. Thus also the ForwardRef's
with same nam
New submission from Matthew H. McKenzie :
A mailbox (folder) need not be for a recipient and need not be the private part
of an RFC2822 address.
Passing a value of "000 Bookings" to select() results in validation issues when
the tokens are parsed as arguments and there are too
Change by h-vetinari :
--
nosy: +h-vetinari
___
Python tracker
<https://bugs.python.org/issue44556>
___
___
Python-bugs-list mailing list
Unsubscribe:
Matthew H. McKenzie added the comment:
To answer your original questions : Linux Host and Client, amd MVS (EBCDIC
records) to Linux.
hacks to overcome (in libftp):
def print_line(line):
'''Default retrlines callback to print a line.'''
print(line, end
Matthew H. McKenzie added the comment:
On the face of it it is my mistake for using the write method for my file. But
read on.
your write_line() adds an EOL, OK, because it wraps print().
So the retrlines() function strips them in anticipation?
The error is arguably in my own code as I
New submission from Matthew H. McKenzie :
Lib/ftplib.py function retrlines
Inspired by documentation the following writes a file without line-endings:
from ftplib import FTP
ftp=FTP()
ftp.connect('hostname')
ftp.login('user','')
ftp.sendcmd('pasv
Jonas H. added the comment:
pat.match() has 110 nsec.
Feel free to close the issue and PR if you think this isn't worth changing.
--
___
Python tracker
<https://bugs.python.org/is
Jonas H. added the comment:
I agree with your statement in principle. Here are numbers for the slowdown
that's introduced:
Without the change:
./python.exe -m timeit -s 'import re'\n'[re.compile(f"fill_cache{i}") for i
in range(512)]'\n'pat
Change by Jonas H. :
--
keywords: +patch
pull_requests: +27224
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/28936
___
Python tracker
<https://bugs.python.org/issu
New submission from Jonas H. :
re.match(p, ...) with a pre-compiled pattern p = re.compile(...) can be much
slower than calling p.match(...). Probably mostly in cases with "easy" patterns
and/or short strings.
The culprit is that re.match -> re._compile can spend a lot of time
Andreas H. added the comment:
I see your point. But even with `pop` or `remove` it is still a stack or
stack-like. In the normal case the context managers are still released in
reverse order as they were added. Order cannot be changed arbitrarily.
There is just the additional function of
New submission from Andreas H. :
Currently it is not possible to remove context managers from an ExitStack (or
AsyncExitStack).
Workarounds are difficult and generally do accesses implementation details of
(Async)ExitStack.
See e.g. https://stackoverflow.com/a/37607405. It could be done as
New submission from Andreas H. :
The issue is that the main task (which was supplied to asyncio.run) has no
chance to clean up its "own" sub-tasks and handle
possible exceptions that occur during the sub-task clean up. It prevents a
graceful shutdown.
There is no way to prevent t
Change by h-vetinari :
--
nosy: +h-vetinari
___
Python tracker
<https://bugs.python.org/issue40522>
___
___
Python-bugs-list mailing list
Unsubscribe:
Change by h-vetinari :
--
nosy: +h-vetinari
___
Python tracker
<https://bugs.python.org/issue15751>
___
___
Python-bugs-list mailing list
Unsubscribe:
Change by h-vetinari :
--
nosy: +h-vetinari
___
Python tracker
<https://bugs.python.org/issue40601>
___
___
Python-bugs-list mailing list
Unsubscribe:
Change by h-vetinari :
--
nosy: +h-vetinari
___
Python tracker
<https://bugs.python.org/issue39511>
___
___
Python-bugs-list mailing list
Unsubscribe:
Change by h-vetinari :
--
nosy: +h-vetinari
___
Python tracker
<https://bugs.python.org/issue40077>
___
___
Python-bugs-list mailing list
Unsubscribe:
Change by h-vetinari :
--
nosy: +h-vetinari
___
Python tracker
<https://bugs.python.org/issue1635741>
___
___
Python-bugs-list mailing list
Unsubscribe:
Marten H. van Kerkwijk added the comment:
In astropy we are now working around the auto-closing of the underlying stream
in TextIOWrapper by subclassing and overriding `__del__` to detach [1]. It
would seem more elegant if `TestIOWrapper` (and really, `BufferedReader`) could
gain an
Change by Ian H :
--
keywords: +patch
pull_requests: +24282
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/25487
___
Python tracker
<https://bugs.python.org/issu
Ian H added the comment:
Proposed patch is in https://github.com/python/cpython/pull/25487.
--
___
Python tracker
<https://bugs.python.org/issue43895>
___
___
New submission from Ian H :
While working on another project I noticed that there's a cache of shared
object handles kept inside _PyImport_FindSharedFuncptr. See
https://github.com/python/cpython/blob/b2b6cd00c6329426fc3b34700f2e22155b44168c/Python/dynload_shlib.c#L51-L55.
It appears
New submission from Ian H :
Some of the import-related C API functions are documented as bypassing an
override to builtins.__import__. This appears to be the case, but the
documentation is incomplete in this regard. For example, PyImport_ImportModule
is implemented by calling PyImport_Import
New submission from Ian H :
Currently there's no easy way to get at the internal cache of module spec
objects for compiled extension modules. See
https://github.com/python/cpython/blob/20ac34772aa9805ccbf082e700f2b033291ff5d2/Python/import.c#L401-L415.
For example, these module spec ob
Change by h-vetinari :
--
nosy: +h-vetinari
___
Python tracker
<https://bugs.python.org/issue43112>
___
___
Python-bugs-list mailing list
Unsubscribe:
h-vetinari added the comment:
PPS. Also, the compiler implementation reference uses 19.x for MSVC:
https://en.cppreference.com/w/cpp/compiler_support, which was the link I was
trying to make, now that I'm looking at it.
--
___
Python tr
h-vetinari added the comment:
PS.
> Judging from the link you posted to version numbering
https://en.wikipedia.org/wiki/Microsoft_Visual_C%2B%2B#Internal_version_numbering
the first line should have 'MSVC 14.28' the middle column title should be 'MS
Visual Studio
h-vetinari added the comment:
Hey Terry
I had asked about this on discuss
(https://discuss.python.org/t/toolchain-upgrade-on-windows/6377/2), and Steve
provided some very valuable input.
In particular, building with the newer VS (that supports C11) should stay
ABI-compatible with
New submission from h-vetinari :
While Visual Studio 16.8 (<-> MSVC 19.28) has _just_ been released, I think it
would be worthwhile to consider upgrading the compiler toolchain that's used to
build the CPython windows binaries, particularly before the release of 3.10.
That
New submission from Tomek H :
With Python3.9 there is a great feature for merging `dict`s:
{1: 'a'} | {2: 'b'} => {1: 'a', 2: 'b'}
It would be very handy to filter out a dict with a similar fashion (for example
& operator with a list/tuple/froz
Natsumi H. added the comment:
If it won't be added do you reckon creating a library to solve this issue would
be appropriate?
--
___
Python tracker
<https://bugs.python.org/is
Natsumi H. added the comment:
Exactly that was the plan!
--
___
Python tracker
<https://bugs.python.org/issue41107>
___
___
Python-bugs-list mailing list
Unsub
New submission from Natsumi H. :
I suggest adding a function which behaves like map but without returning
anything to iterate over a generator.
This is useful in cases where you need to run a function on every element in a
list without unnecessarily creating a generator object like map would
Julien H added the comment:
Hello Ammar Askar,
I agree `_` avoids the "up arrow" problem I mentioned in the REPL.
I actually primarily use jupyter notebooks in my work.
Point 1. in my first message is the primary issue. Having to edit the line in
two places to perform one
Change by Julien H :
--
title: Provide toList() method on iterators (`list()` is a flow killer in REPL)
-> Provide toList() method on iterators/generators (`list()` is a flow killer
in REPL)
___
Python tracker
<https://bugs.python.org/issu
Change by Julien H :
--
components: +Library (Lib) -Demos and Tools
versions: -Python 3.9
___
Python tracker
<https://bugs.python.org/issue41030>
___
___
Pytho
Marten H. van Kerkwijk added the comment:
I should probably have added that the bus error happens on linux. On Windows,
the opening of the file for writing leads to an error, as the file is still
opened for reading inside the mmap.
--
___
Python
New submission from Marten H. van Kerkwijk :
While debugging a strange failure with tests and np.memmap, I realized that the
following direct use of mmap reliably leads to a bus error. Here, obviously
mmap'ing a file, closing it, opening the file for writing but not writing
anything
Michael H added the comment:
Many thanks!
--
___
Python tracker
<https://bugs.python.org/issue38779>
___
___
Python-bugs-list mailing list
Unsubscribe:
Michael H added the comment:
Sorry, its my bad, it is correct as it is, I hadn't read further on about the
print statement being needed. As I am working through the tutorial in pycharm,
I am had already used print statement.
T
New submission from Michael H :
https://docs.python.org/3/tutorial/introduction.html#strings
In the strings part of the basic tutorial, there is an output error regarding
the escaping of the single quote
>>> '"Isn\'t," they said.'
'"Isn\'t,&qu
Shmuel H. added the comment:
The only other solution I could think about was to change setattr's behaviour
dynamically so that it would be valid to call it from frozen instance's
`__init__`, but I think it is somehow even worst.
However, thanks for your help, I think we can clos
Shmuel H. added the comment:
I think it was designed to. However, it is not very usable in production for a
number of reasons:
1. It won't work with frozen instances (you'll have to call
`object.__setattr__` directly).
2. It gets very messy with more than one or two `InitVar`s whic
New submission from Shmuel H. :
Currently, `dataclasses.dataclass` will generate `__init__` only where the user
has not defined one.
However, sometimes, with frozen classes or dataclasses with a lot of members,
redefinition of this function is not trivial,
especially if the only purpose is
New submission from H-ZeX :
in the __init__ function, call getresp,
however, the getresp don't handle the 120 reply which indicate the request
should be delay or 421 reply
in the rfc 959 page 50, there are all reply that may return
Connection Establishment
120
220
22
Change by H-ZeX :
--
components: +Library (Lib) -XML
___
Python tracker
<https://bugs.python.org/issue34368>
___
___
Python-bugs-list mailing list
Unsubscribe:
Change by H-ZeX :
--
components: XML
nosy: H-ZeX
priority: normal
severity: normal
status: open
title: ftplib __init__ function can't handle 120 or 4xy reply when connect to
the server
type: behavior
versions: Python 3.5
___
Python tracker
&
Jonas H. added the comment:
The assertion in the patched code, yes. The segfault in the unpatched code, no.
--
___
Python tracker
<https://bugs.python.org/issue34
Jonas H. added the comment:
I don't think this can be tested with Python code, unless you can make sure the
target buffer _PyUnicode_TransformDecimalAndSpaceToASCII operates on is
initialised with garbage bytes.
--
___
Python tracker
&
Jonas H. added the comment:
Here's a Docker image that reproduces the bug.
FROM ubuntu:18.04
RUN apt update && apt install -y python3.7-dbg python3.7-venv python3-venv wget
RUN python3.7 -m venv venv
RUN venv/bin/pip install django
RUN wget https://bugs.python.org/file47688/testp
Jonas H. added the comment:
Sure.
Unpack archive, create new 3.7 venv with Django (latest version is fine),
./manage.py runserver, curl localhost:8000.
--
___
Python tracker
<https://bugs.python.org/issue34
Jonas H. added the comment:
Reduced it to something that seems unicode related?
No extension modules involved. Vanilla Django project with a single url +
template.
See testproj/urls.py and tmpl/index.html
--
Added file: https://bugs.python.org/file47688/testproj.tar.gz
Jonas H. added the comment:
I can reproduce this on Ubuntu 18.04.
INADA, I have a full gdb backtrace with Python 3.7 development build. I'd like
to share it with you privately as I'm concerned it may contain sensible
information. I know that's a bit unconventional; if
Jonas H. added the comment:
Btw my segfault is from Django too, but that may just be a coincidence
--
___
Python tracker
<https://bugs.python.org/issue34
Jonas H. added the comment:
I also have a segfault that goes away with malloc debugging. Not sure if it's
the same issue.
My extension modules are
venv/lib/python3.7/site-packages//_yaml.cpython-37m-darwin.so
venv/lib/python3.7/site-packages//netifaces.cpython-37m-darwin.so
ven
New submission from Leon H. :
Current BASIC_FORMAT:
BASIC_FORMAT = "%(levelname)s:%(name)s:%(message)s"
The first thing people do is set the format to
'%(asctime)s:%(levelname)s:%(name)s:%(message)s' or like after importing
logging module.
Could we put the '%(as
Jonas H. added the comment:
See also
https://stackoverflow.com/questions/19309514/getting-original-line-number-for-exception-in-concurrent-futures
for other people having the same problem
--
___
Python tracker
<https://bugs.python.org/issue32
New submission from Jonas H. :
Use case: Try to get a future's result using
concurrent.futures.Future.result(), and log the full exception if there was any.
Currently, only "excinst" (sys.exc_info()[1]) is provided with the
Future.exception() method.
Proposal: Add new
Jonas H. added the comment:
https://github.com/python/cpython/pull/4589
- Add 3.7 What's New entry
- Fix regression (thanks Tim for the report)
--
___
Python tracker
<https://bugs.python.org/is
Change by Jonas H. :
--
pull_requests: +4513
___
Python tracker
<https://bugs.python.org/issue32071>
___
___
Python-bugs-list mailing list
Unsubscribe:
Jonas H. added the comment:
Ah, the problem isn't that it's running getattr() on test methods, but that it
runs getattr() on all methods.
Former code: attrname.startswith(prefix) and \
callable(getattr(testCaseClass, attrname))
New code: testFunc = getattr(tes
Jonas H. added the comment:
Sure!
--
___
Python tracker
<https://bugs.python.org/issue32071>
___
___
Python-bugs-list mailing list
Unsubscribe:
https://mail.pyth
Jonas H. added the comment:
Interesting, Victor. I've had a look at the code you mentioned, but I'm afraid
it doesn't really make sense to re-use any of the code.
Here's a new patch, implemented in the loader as suggested by Antoine, and with
tests.
I'm happy t
Jonas H. added the comment:
> > 3) Is the approach of dynamically wrapping 'skip()' around to-be-skipped
> > test cases OK?
> I think this is the wrong approach. A test that isn't selected shouldn't be
> skipped, it should not appear in the output at al
Jonas H. added the comment:
Thanks Antoine. I will need some guidance as to what are the correct places to
make these changes. I'm not quite sure about the abstractions here (runner,
loader, suite, case, etc.)
My PoC (see GitHub link in first post) uses a TestSuite subclass. (The sub
Jonas H. added the comment:
Just to be clear, the current implementation is limited to substring matches.
It doesn't support py.test like "and/or" combinators. (Actually, py.test uses
'eval' to support arbitrary patterns.)
So say we have test case
SomeClass
te
New submission from Jonas H. :
I'd like to add test selection based on parts of the test class/method name to
unittest. Similar to py.test's "-k" option:
https://docs.pytest.org/en/latest/example/markers.html#using-k-expr-to-select-tests-based-on-their-name
Here&
Jonas H. added the comment:
This affects me too.
--
nosy: +jonash
___
Python tracker
<https://bugs.python.org/issue31526>
___
___
Python-bugs-list mailin
Christian H added the comment:
I was also bitten by this bug, and would like to see it merged. The patch
22536-subprocess-exception-filename-2.patch looks fine to me.
--
nosy: +Christian H
___
Python tracker
<http://bugs.python.org/issue22
Changes by Christian H :
--
nosy: +Christian H
___
Python tracker
<http://bugs.python.org/issue1615158>
___
___
Python-bugs-list mailing list
Unsubscribe:
Marcel H added the comment:
I want to see this fixed in python3.x as well, please :) the patch should be
the same
--
nosy: +Marcel H2
versions: +Python 3.6, Python 3.7
___
Python tracker
<http://bugs.python.org/issue14
Changes by Christian H :
--
nosy: +Christian H
___
Python tracker
<http://bugs.python.org/issue27744>
___
___
Python-bugs-list mailing list
Unsubscribe:
Changes by Christian H :
--
nosy: +Christian H
___
Python tracker
<http://bugs.python.org/issue22385>
___
___
Python-bugs-list mailing list
Unsubscribe:
Changes by Christian H :
--
nosy: +Christian H
___
Python tracker
<http://bugs.python.org/issue1222585>
___
___
Python-bugs-list mailing list
Unsubscribe:
Jonas H. added the comment:
I just hit this too. I'd say remove the fileno() method from wrapper objects
like GzipFile. I'm happy to submit a patch.
--
nosy: +jonash
___
Python tracker
<http://bugs.python.o
Changes by Christian H :
--
nosy: +Christian H
___
Python tracker
<http://bugs.python.org/issue21998>
___
___
Python-bugs-list mailing list
Unsubscribe:
Lars H added the comment:
+1 vote for fixing this problem. Matt Hickford said it very well... the error
message is very cryptic, not giving the user a clue as to what domain the
problem lies in.
--
nosy: +Lars.H
___
Python tracker
<h
David H. Gutteridge added the comment:
Updating to reflect the Python 3.4 documentation is now also relevant to this
discussion. Perhaps someone could commit a change something like my suggestion
in msg143295?
--
versions: +Python 3.4
___
Python
New submission from Jonas H.:
>From my personal experience, listing all real files and all subdirectories in
>a directory is a very common use case.
Here's a patch that adds the `iterfiles()` and `iterdirs()` methods as a
shortcut for `[f for f in p.iterdir() if f.
New submission from Jonas H.:
The Sphinx docs don't contain any explanation for `local_hostname`.
--
assignee: docs@python
components: Documentation
messages: 190898
nosy: docs@python, jonash
priority: normal
severity: normal
status: open
title: SMTP.local_hostname is undocum
Changes by H Xu :
--
nosy: +xuhdev
___
Python tracker
<http://bugs.python.org/issue18050>
___
___
Python-bugs-list mailing list
Unsubscribe:
http://mail.pyth
New submission from Jose Antonio Martin H:
Is it possible to consider the automatic type conversion from set to frozenset
whenever a set is declared inside a set, as the key of a Counter and as the key
of a Dict? Tha is, the case when a set is used but a hashable object is
requested.
Having
H Xu added the comment:
I think this has been fixed. Where did you see the incorrect link?
--
___
Python tracker
<http://bugs.python.org/issue14489>
___
___
Pytho
New submission from H Xu :
The `repr()` built-in function link in this page [
http://docs.python.org/library/functions.html ] should link to the built-in
version of `repr()`.
It should link to: http://docs.python.org/library/functions.html#repr
However, it links to here: http
Jonas H. added the comment:
Why does it have a 'seek' method then?
--
___
Python tracker
<http://bugs.python.org/issue12877>
___
___
Python-bugs-l
New submission from Jonas H. :
from subprocess import Popen, PIPE
p = Popen(['ls'], stdout=PIPE)
p.wait()
p.stdout.seek(0)
Traceback (most recent call last):
File "t.py", line 5, in
p.stdout.seek(0)
IOError: [Errno 29] Illegal seek
Python 2.7.2, Arch Linu
David H. Gutteridge added the comment:
Okay. I'd seen the earlier issue, but had submitted this separately because I
wasn't sure if it was a security-related bug, whereas the older issue didn't
mention anything of the sort. (In retrospect, I could'
David H. Gutteridge added the comment:
Ned: My proposed wording is: "Note that only one document can be parsed by a
given instance; it is not possible to reuse an instance to parse multiple
files." To provide more detail, one could also add something like: "The
isfinal argume
David H. Gutteridge added the comment:
Further details:
- The original test case I'd submitted crashed on the development branch of
NetBSD as well as Mac OS X Snow Leopard, but not the most recent stable branch
of NetBSD. I've found a separate test case that crashes on both b
1 - 100 of 177 matches
Mail list logo