[issue46029] "ValueError: Invalid isoformat string" from a valid string

2021-12-10 Thread Eric V. Smith


Eric V. Smith  added the comment:

fromisoformat() is only designed to parse the output of isformat().

See issue 35829 for further discussion. I'm going to close this issue as a 
duplicate.

--
nosy: +eric.smith
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> datetime: parse "Z" timezone suffix in fromisoformat()

___
Python tracker 
<https://bugs.python.org/issue46029>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46024] Different behaviour with zipfile

2021-12-10 Thread Eric V. Smith


Change by Eric V. Smith :


--
status: open -> pending

___
Python tracker 
<https://bugs.python.org/issue46024>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44674] dataclasses should allow frozendict default value

2021-12-11 Thread Eric V. Smith


Eric V. Smith  added the comment:


New changeset e029c53e1a408b89a4e3edf30a9b38b094f9c880 by Eric V. Smith in 
branch 'main':
bpo-44674: Use unhashability as a proxy for mutability for default dataclass 
__init__ arguments. (GH-29867)
https://github.com/python/cpython/commit/e029c53e1a408b89a4e3edf30a9b38b094f9c880


--

___
Python tracker 
<https://bugs.python.org/issue44674>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44674] dataclasses should allow frozendict default value

2021-12-11 Thread Eric V. Smith


Change by Eric V. Smith :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 
<https://bugs.python.org/issue44674>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46024] Different behaviour with zipfile

2021-12-11 Thread Eric V. Smith


Eric V. Smith  added the comment:

Actually, printing out:
print(repr(path), repr(ZipPath(path)))
would be more useful.

If I don't hear back in a few days, I'm going to close this issue.

--
status: pending -> open

___
Python tracker 
<https://bugs.python.org/issue46024>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45650] cgitb does not emit CGI headers when format='text'

2021-12-11 Thread Eric V. Smith


Eric V. Smith  added the comment:

Having not heard back about a use case for this, I'm going to close it. If you 
want to move this forward, I suggest proposing it on the python-ideas mailing 
list.

--
resolution:  -> rejected
stage:  -> resolved
status: pending -> closed

___
Python tracker 
<https://bugs.python.org/issue45650>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44053] Can't connect to a server also not showing any type of output

2021-12-11 Thread Eric V. Smith


Eric V. Smith  added the comment:

Closing due to lack of feedback.

--
resolution:  -> not a bug
stage:  -> resolved
status: pending -> closed
type:  -> behavior

___
Python tracker 
<https://bugs.python.org/issue44053>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue24372] Documentation for ssl.wrap_socket's ssl_version parameter is odd

2021-12-11 Thread Eric V. Smith


Change by Eric V. Smith :


--
resolution:  -> out of date
stage:  -> resolved
status: pending -> closed

___
Python tracker 
<https://bugs.python.org/issue24372>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44475] Dataclass Causes Infinite Recursion when using type of bytes

2021-12-11 Thread Eric V. Smith


Eric V. Smith  added the comment:

Closing due to lack of feedback.

--
resolution:  -> not a bug
stage:  -> resolved
status: pending -> closed

___
Python tracker 
<https://bugs.python.org/issue44475>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44674] dataclasses should allow frozendict default value

2021-12-12 Thread Eric V. Smith


Eric V. Smith  added the comment:

@gianni: can you verify that your use case works in 3.11?

--

___
Python tracker 
<https://bugs.python.org/issue44674>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46056] Cannot use virtual environment on Windows 10 in corporate security settings

2021-12-12 Thread Eric V. Smith


Change by Eric V. Smith :


--
components: +Windows
nosy: +paul.moore, steve.dower, tim.golden, zach.ware
title: Cannot use virtual environment on Windows 10 in cooperate security 
settings -> Cannot use virtual environment on Windows 10 in corporate security 
settings

___
Python tracker 
<https://bugs.python.org/issue46056>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46061] Journal execution gives fatal error in Python 3.10.1

2021-12-13 Thread Eric V. Smith

Eric V. Smith  added the comment:

Please show the code that causes this problem. There’s not enough information 
here to reproduce this failure.

--
nosy: +eric.smith

___
Python tracker 
<https://bugs.python.org/issue46061>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46061] Journal execution gives fatal error in Python 3.10.1

2021-12-13 Thread Eric V. Smith


Change by Eric V. Smith :


--
status: open -> pending

___
Python tracker 
<https://bugs.python.org/issue46061>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46071] Graphlib documentation

2021-12-14 Thread Eric V. Smith


Change by Eric V. Smith :


--
nosy: +eric.smith, rhettinger, tim.peters

___
Python tracker 
<https://bugs.python.org/issue46071>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46081] Document the msg argument for assertRaises

2021-12-15 Thread Eric V. Smith


Eric V. Smith  added the comment:

The documentation at https://docs.python.org/3/library/unittest.html says "All 
the assert methods accept a msg argument that, if specified, is used as the 
error message on failure (see also longMessage). Note that the msg keyword 
argument can be passed to assertRaises(), assertRaisesRegex(), assertWarns(), 
assertWarnsRegex() only when they are used as a context manager."

--
nosy: +eric.smith

___
Python tracker 
<https://bugs.python.org/issue46081>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46081] Document the msg argument for assertRaises

2021-12-15 Thread Eric V. Smith


Eric V. Smith  added the comment:

Suggestions to improve it are welcomed. I can't think of a way to do it without 
cluttering things up.

--

___
Python tracker 
<https://bugs.python.org/issue46081>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46087] Zip library documentation error

2021-12-15 Thread Eric V. Smith


Change by Eric V. Smith :


--
versions:  -Python 3.6, Python 3.7, Python 3.8

___
Python tracker 
<https://bugs.python.org/issue46087>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46087] Zip library documentation error

2021-12-15 Thread Eric V. Smith


Eric V. Smith  added the comment:

Good point, Serhiy. I also don't see how the proposed change is related to any 
zip documentation (which is in the title of this issue).

I suggest closing this.

--
nosy: +eric.smith

___
Python tracker 
<https://bugs.python.org/issue46087>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46093] 2D array issue

2021-12-15 Thread Eric V. Smith


Eric V. Smith  added the comment:

problem_ary[:] creates a copy of problem_ary, so it's equal to:

>>> problem_ary[:]
[['a', 'b', 'c'], ['d', 'e', 'f'], ['g', 'h', 'i']]

The [1] element of that is:

>>> problem_ary[:][1]
['d', 'e', 'f']

So this is working as expected.

I suggest you ask on StackOverflow or the python-list mailing list if you need 
more help in understanding how lists work in Python.

--
nosy: +eric.smith
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

___
Python tracker 
<https://bugs.python.org/issue46093>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46081] Document the msg argument for assertRaises

2021-12-15 Thread Eric V. Smith


Change by Eric V. Smith :


--
resolution:  -> wont fix

___
Python tracker 
<https://bugs.python.org/issue46081>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46108] Enum repr() incorrect when mixed with dataclasses

2021-12-16 Thread Eric V. Smith


Eric V. Smith  added the comment:

I know you know this, but here's a version without dataclasses, in case you 
want to add a test for this, too.

from enum import Enum

class Foo:
def __init__(self, a):
self.a = a
def __repr__(self):
return f'Foo(a={self.a!r})'

class Entries(Foo, Enum):
ENTRY1 = Foo(1)

repr(Entries.ENTRY1) != ''

--
nosy: +eric.smith

___
Python tracker 
<https://bugs.python.org/issue46108>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46110] `eval("-"*3000000 + "4")` in cmd causes hard crash

2021-12-17 Thread Eric V. Smith


Eric V. Smith  added the comment:

In case it helps track this down. On my system I've tested these two setups:

On Windows, on the main branch, python just exists with no message when I run 
this from the REPL.

Also on Windows, with the Cygwin 3.8.12 version, I get MemoryError:

Python 3.8.12 (default, Nov 23 2021, 20:18:25)
[GCC 11.2.0] on cygwin
Type "help", "copyright", "credits" or "license" for more information.
>>> eval("-"*300 + "4")
s_push: parser stack overflow
Traceback (most recent call last):
  File "", line 1, in 
MemoryError

Those are the only two systems I have available to test with.

--
nosy: +eric.smith

___
Python tracker 
<https://bugs.python.org/issue46110>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46134] Confusing error message for AttributeError with dataclasses

2021-12-19 Thread Eric V. Smith


Eric V. Smith  added the comment:

Please show the error you're getting, including the traceback.

--
status: pending -> open

___
Python tracker 
<https://bugs.python.org/issue46134>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46137] Update/change built-in keyword type used in RE example

2021-12-20 Thread Eric V. Smith


Eric V. Smith  added the comment:

"type" is a natural name to use in this example, and isn't causing any 
problems. I suggest not changing anything.

--
nosy: +eric.smith

___
Python tracker 
<https://bugs.python.org/issue46137>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46138] Strange behavior with lists

2021-12-20 Thread Eric V. Smith


Eric V. Smith  added the comment:

You're using a set (with {}), not a list (with []).

I'd give you a working example, but since you posted a picture I can't copy, 
paste, and edit your example. In the future, please post text, not pictures.

--
nosy: +eric.smith
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

___
Python tracker 
<https://bugs.python.org/issue46138>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46024] Different behaviour with zipfile

2021-12-20 Thread Eric V. Smith


Eric V. Smith  added the comment:

It looks like this was changed in https://bugs.python.org/issue42043

@jaraco might have some insights.

--
nosy: +jaraco

___
Python tracker 
<https://bugs.python.org/issue46024>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46164] New `both()` operator for matching multiple variables to one

2021-12-23 Thread Eric V. Smith


Eric V. Smith  added the comment:

I think this is a rarely needed operation. I looked through a few tens of 
thousand lines of my code and couldn't find anywhere it would be used.

Plus, you could write it yourself, so I don't see the advantage of it being 
part of the language or standard library.

--
nosy: +eric.smith

___
Python tracker 
<https://bugs.python.org/issue46164>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue9334] argparse does not accept options taking arguments beginning with dash (regression from optparse)

2021-12-23 Thread Eric V. Smith


Eric V. Smith  added the comment:

@karzes: If you read all of the messages above, you'll find that the behavior 
is deeply baked in to argparse. So, no, there is no fix for this issue.

I'm not sure about others, but I believe that the behavior is so deeply 
ingrained in how argparse works that it can't be changed. I have the same 
desire as you: to use a command line parser that works like all other Unix 
commands. I've switched my personal code to click. There's also Appeal, typer, 
and others.

Unlike when argparse was added to the stdlib, at this point installing modules 
from PyPI is sufficiently easy that I'm not sure it makes sense to advocate for 
another command line parser in the stdlib.

--

___
Python tracker 
<https://bugs.python.org/issue9334>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46173] Clarify conditions under which float(x) with large x raises OverflowError

2021-12-26 Thread Eric V. Smith


Eric V. Smith  added the comment:

I think the documentation reads better as it currently is. Does this really 
cause any practical confusion?

As Mark notes, we can't specify things exactly here: that would obfuscate all 
of the things we're actually trying to say.

--
nosy: +eric.smith

___
Python tracker 
<https://bugs.python.org/issue46173>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46199] Calculation influenced by print

2021-12-29 Thread Eric V. Smith


Eric V. Smith  added the comment:

This is likely not a bug in python. You might have better luck asking on a 
numpy support list.

That said, what results do you get, and what do you expect to get? We don't 
know what error you're seeing.

You might replace:
print("LB: ", LB)

with:
str(LB)

and see what happens. That's the only operation that's called on LB when you're 
printing.

--
nosy: +eric.smith

___
Python tracker 
<https://bugs.python.org/issue46199>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46200] Discourage logging f-strings due to security considerations

2021-12-30 Thread Eric V. Smith


Change by Eric V. Smith :


--
nosy: +eric.smith

___
Python tracker 
<https://bugs.python.org/issue46200>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46200] Discourage logging f-strings due to security considerations

2022-01-02 Thread Eric V. Smith


Eric V. Smith  added the comment:

I think there's definitely room for improvement here, and at face value I like 
the debugf() functions. __format__ style formatting solves a big problem for 
me: being able to provide format strings for timestamps.

One thing: I'd be careful about saying that delayed formatting is always a 
performance win. f-strings are so much faster, that if I'm reasonable sure a 
message is always going to get logged, I'll use an f-string. In my case, I 
never log any user-supplied data, although it's obviously a risk that should be 
warned against.

--

___
Python tracker 
<https://bugs.python.org/issue46200>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46251] logger.config.configure_formatter executes arbitrary code

2022-01-03 Thread Eric V. Smith


Eric V. Smith  added the comment:

What are the contents of calculator.py?

--
nosy: +eric.smith

___
Python tracker 
<https://bugs.python.org/issue46251>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46251] logger.config.configure_formatter executes arbitrary code

2022-01-03 Thread Eric V. Smith


Eric V. Smith  added the comment:

Thanks.

Here's a somewhat smaller, one-file version, that writes to the current 
directory (I'm on Windows, no /tmp):

-
import logging
import logging.config
import json

log_config_txt = '''{
"version":1,
"formatters":{
"EXPLOIT":{
"class": "os.popen",
"format": "touch itworked",
"datefmt": "r",
"style": 1

}
}
}
'''

log_config = json.loads(log_config_txt)
logging.config.dictConfig(log_config)
logger = logging.getLogger("calculator")
-

--

___
Python tracker 
<https://bugs.python.org/issue46251>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46251] logger.config.configure_formatter executes arbitrary code

2022-01-03 Thread Eric V. Smith


Eric V. Smith  added the comment:

Actually, the last line isn't necessary.


import logging.config
import json

log_config_txt = '''{
"version":1,
"formatters":{
"EXPLOIT":{
"class": "os.popen",
"format": "touch itworked",
"datefmt": "r",
"style": 1
}
}
}
'''

log_config = json.loads(log_config_txt)
logging.config.dictConfig(log_config)


I suspect the answer to this will be: "don't load untrusted configuration 
files". But I'll see what others have to say. There should probably be a 
warning about it somewhere. I didn't see anything.

--

___
Python tracker 
<https://bugs.python.org/issue46251>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46260] Misleading SyntaxError on f-string

2022-01-04 Thread Eric V. Smith


Eric V. Smith  added the comment:

Simpler reproducer:

>>> f"{foo)"
  File "", line 1
f"{foo)"
^
SyntaxError: f-string: unmatched ')'

I assume this is the same error as:

>>> foo)
  File "", line 1
foo)
   ^
SyntaxError: unmatched ')'

But I don't yet understand why it's choosing to parse that expression fragment. 
I'm working on it.

--

___
Python tracker 
<https://bugs.python.org/issue46260>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46260] Misleading SyntaxError on f-string

2022-01-05 Thread Eric V. Smith


Eric V. Smith  added the comment:

In fstring_find_expr, the code[0] that's checking for parens, braces, and 
brackets detects the closing paren without a matching open paren.

The error message isn't incorrect: if you added a matching open paren the code 
would compile:
>>> foo=lambda:0
>>> f'{foo()}'
'0'

So while the error might not be intuitive, it's not wrong.

0: 
https://github.com/python/cpython/blob/cae55542d23e606dde9819d5dadd7430085fcc77/Parser/string_parser.c#L664d

--

___
Python tracker 
<https://bugs.python.org/issue46260>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46260] Misleading SyntaxError on f-string

2022-01-05 Thread Eric V. Smith


Eric V. Smith  added the comment:

No trouble. I'm glad to know it wasn't actually the same error as plain "foo)" 
(although the error message is the same). That would have concerned me.

Changing the code so that it doesn't error out on the first problem it sees, 
but keeps looking for a different type of error and then maybe backtracks or 
re-parses would be a lot of work, and I think we'd just end up with a different 
class of errors.

I'm going to close this. Maybe when/if we move f-strings to the real parser we 
can look at this issue again.

--
resolution:  -> later
stage:  -> resolved
status: open -> closed

___
Python tracker 
<https://bugs.python.org/issue46260>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46276] ImportError: DLL load failed while importing

2022-01-06 Thread Eric V. Smith


Eric V. Smith  added the comment:

I see this has been reported in frida's tracker. It looks like a problem with 
that package.

--
nosy: +eric.smith
type: crash -> behavior

___
Python tracker 
<https://bugs.python.org/issue46276>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46280] About vulnerabilities in Cpython native code

2022-01-06 Thread Eric V. Smith


Eric V. Smith  added the comment:

Thank you for posting this.

Some of these look like false positives.

For example:
#263
Parser/string_parser.c:670: error: Uninitialized Value
  The value read from parenstack[_] was never initialized.
  668. }
  669. nested_depth--;
  670. int opening = (unsigned char)parenstack[nested_depth];
   ^
  671. if (!((opening == '(' && ch == ')') ||
  672.   (opening == '[' && ch == ']') ||

I don't see how this could be an uninitialized read, although I'm willing to be 
wrong.

If your tool can produce patches to fix reported problems, I suggest that you 
create PRs for specific issues, so they can be reviewed individually. There's 
no way we'd review a single patch for all 673 issues that were identified.

Also, looking at the first one:
#0
Objects/clinic/bytearrayobject.c.h:50: error: Dead Store
  The value written to &noptargs (type long) is never used.
  48. goto exit;
  49. }
  50. if (!--noptargs) {
   ^
  51. goto skip_optional_pos;
  52. }

We've discussed this before. The consensus last time was to leave code like 
this in place, in case other code was added after this that refers to the same 
pointer. Our assumption is that compilers will remove the unneeded store. Is it 
possible to remove Dead Stores from the output, and/or produce a separate 
output with just Dead Stores? I don't see how a Dead Store can be a 
vulnerability.

--
nosy: +eric.smith -414039482

___
Python tracker 
<https://bugs.python.org/issue46280>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46280] About vulnerabilities in Cpython native code

2022-01-06 Thread Eric V. Smith


Eric V. Smith  added the comment:

I don't want to belabor this, but hey, it's in f-strings! And if it's an actual 
problem I'd like to fix it.

> It can be uninitialized if the parenstack[nested_depth] value is itself 
> initialized, which can happen if the memory block pointed by parenstack has 
> not been initialized to some value after malloc'ed and 
> parenstack[nested_depth] never got a value.

parenstack is allocated on the stack, not that that changes the discussion much.

It looks like everywhere that parenstack[nested_depth] is read, it's already 
been written to.

Anyway, (if I'm right,) this makes my points that a) there are false positives, 
and b) we should have separate issues for each actual problem.

--

___
Python tracker 
<https://bugs.python.org/issue46280>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46288] Migrating python 2.7 to 3.6 using 2to3 tool

2022-01-07 Thread Eric V. Smith


Eric V. Smith  added the comment:

Porting questions don't belong on the bug tracker. And we don't support 2.7 any 
more, in any event.

You'll need to find python 3 versions of all of your packages. Unfortunately we 
can't help you with that.

There used to be a python-porting mailing list, but it's been deleted. Maybe 
someone on the the python-list mailing list could point you in the right 
direction.

--
nosy: +eric.smith
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed
type: compile error -> behavior

___
Python tracker 
<https://bugs.python.org/issue46288>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46290] Parameter names are inaccurate in dataclasses docs

2022-01-07 Thread Eric V. Smith


Change by Eric V. Smith :


--
assignee: docs@python -> eric.smith

___
Python tracker 
<https://bugs.python.org/issue46290>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46237] Incorrect line reported in syntax error

2022-01-07 Thread Eric V. Smith


Change by Eric V. Smith :


--
nosy: +eric.smith

___
Python tracker 
<https://bugs.python.org/issue46237>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46304] Unable to iterate over lines in a file without a block of code

2022-01-07 Thread Eric V. Smith


Eric V. Smith  added the comment:

Hi, Jason.

How about:

>>> from pathlib import Path
>>> Path("foo.txt").read_text().splitlines()
['how', 'now', 'brown', 'cow']

Not the most elegant thing, I'll admit.

--
nosy: +eric.smith

___
Python tracker 
<https://bugs.python.org/issue46304>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46290] Parameter names are inaccurate in dataclasses docs

2022-01-08 Thread Eric V. Smith


Eric V. Smith  added the comment:

Thanks for committing this, @taleinat. But next time, if it's assigned to me, 
I'd like to review it first. Thanks!

--

___
Python tracker 
<https://bugs.python.org/issue46290>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46305] SyntaxError when using dict key in fstring

2022-01-08 Thread Eric V. Smith


Eric V. Smith  added the comment:

Yes, the behavior is intentional. It might be relaxed in the future.

--
nosy: +eric.smith

___
Python tracker 
<https://bugs.python.org/issue46305>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46306] Suspicious operation in `doctest.py`: `None - 1`

2022-01-08 Thread Eric V. Smith


Eric V. Smith  added the comment:


New changeset 0fc58c1e051026baff4919d8519ce2aabe3b2ba1 by Nikita Sobolev in 
branch 'main':
bpo-46306: simplify `CodeType` attribute access in `doctest.py` (GH-30481)
https://github.com/python/cpython/commit/0fc58c1e051026baff4919d8519ce2aabe3b2ba1


--
nosy: +eric.smith

___
Python tracker 
<https://bugs.python.org/issue46306>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46306] Suspicious operation in `doctest.py`: `None - 1`

2022-01-08 Thread Eric V. Smith


Change by Eric V. Smith :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 
<https://bugs.python.org/issue46306>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46304] Unable to iterate over lines in a file without a block of code

2022-01-08 Thread Eric V. Smith


Eric V. Smith  added the comment:

I can't believe I missed that, Jason. I even read it twice!

I think this could go in pathlib, along with read_text. Maybe read_lines, or 
iter_lines, or something. Of course PEP 533 is needed, too.

--

___
Python tracker 
<https://bugs.python.org/issue46304>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46352] Spam

2022-01-12 Thread Eric V. Smith


Change by Eric V. Smith :


Removed file: https://bugs.python.org/file50558/Arlo camera setup.jpg

___
Python tracker 
<https://bugs.python.org/issue46352>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46362] os.path.abspath() needs more normalization on Windows

2022-01-13 Thread Eric V. Smith

Eric V. Smith  added the comment:

Can you show various paths, before and after your change? It’s not clear to me 
what you’re proposing to change.

--
nosy: +eric.smith

___
Python tracker 
<https://bugs.python.org/issue46362>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46382] dataclass(slots=True) does not account for slots in base classes

2022-01-14 Thread Eric V. Smith


Eric V. Smith  added the comment:

I'll have to do some more research. But your analysis looks correct to me, so 
far.

--
assignee:  -> eric.smith
nosy: +eric.smith

___
Python tracker 
<https://bugs.python.org/issue46382>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46392] MessageIDHeader is too strict for message-id

2022-01-16 Thread Eric V. Smith


Eric V. Smith  added the comment:

In what way is it too strict? What "obsolete rules" are you referring to? What 
are some example Message-Ids should be considered valid that instead get 
truncated? What changes are you proposing?

--
nosy: +eric.smith

___
Python tracker 
<https://bugs.python.org/issue46392>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46403] Unhelpful SyntaxError

2022-01-16 Thread Eric V. Smith


Eric V. Smith  added the comment:

This is not the appropriate place to ask for help in debugging your code. I 
suggest you ask on the python-list mailing list.

The error is that you're missing a bunch of right parenthesis in the isWinner() 
function.

I do think "Syntax Error" isn't the best error message, though.

Here's a simplified reproducer:
---
def f():
 return ((1==2)
x
---

Note that in 3.11 (the only other version I have handy), the error is:

  File "foo.py", line 2
return ((1==2)
   ^
SyntaxError: '(' was never closed

I suspect that we won't fix this in old versions of python.

--
components: +Parser -IDLE
nosy: +eric.smith, lys.nikolaou, pablogsal -1071754
title: SyntaxError for no reason -> Unhelpful SyntaxError

___
Python tracker 
<https://bugs.python.org/issue46403>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46403] Unhelpful SyntaxError

2022-01-16 Thread Eric V. Smith


Eric V. Smith  added the comment:

[Numeric id's automatically get dropped from the nosy list: trying to add it 
back]

--

___
Python tracker 
<https://bugs.python.org/issue46403>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46403] Unhelpful SyntaxError

2022-01-16 Thread Eric V. Smith


Eric V. Smith  added the comment:

[And I was unable to add the numeric id as nosy. Apologies to the OP, who 
probably will never see this! It's a bug in the bpo software.]

--

___
Python tracker 
<https://bugs.python.org/issue46403>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46402] Enhance sqlite3 to avoid implicit creation?

2022-01-16 Thread Eric V. Smith


Eric V. Smith  added the comment:

I agree that would be a useful option.

--
nosy: +eric.smith

___
Python tracker 
<https://bugs.python.org/issue46402>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46404] 3.11a4: a small attrs regression

2022-01-16 Thread Eric V. Smith


Change by Eric V. Smith :


--
nosy: +eric.smith

___
Python tracker 
<https://bugs.python.org/issue46404>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46382] dataclass(slots=True) does not account for slots in base classes

2022-01-17 Thread Eric V. Smith


Eric V. Smith  added the comment:

It would also be interesting to see what attrs does in this case.

--

___
Python tracker 
<https://bugs.python.org/issue46382>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46402] Enhance sqlite3 to avoid implicit creation?

2022-01-18 Thread Eric V. Smith


Eric V. Smith  added the comment:


New changeset bdf2ab1887a2edfb089a3c2a1590cf1e84ea0048 by Erlend Egeberg 
Aasland in branch 'main':
bpo-46402: Promote SQLite URI tricks in `sqlite3` docs (GH-30660)
https://github.com/python/cpython/commit/bdf2ab1887a2edfb089a3c2a1590cf1e84ea0048


--

___
Python tracker 
<https://bugs.python.org/issue46402>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46402] Enhance sqlite3 to avoid implicit creation?

2022-01-18 Thread Eric V. Smith


Eric V. Smith  added the comment:


New changeset 01e6cbefd3d0f60c942ed711131f5d638dde1227 by Erlend Egeberg 
Aasland in branch '3.10':
[3.10] bpo-46402: Promote SQLite URI tricks in sqlite3 docs (GH-30660) 
(GH-30671)
https://github.com/python/cpython/commit/01e6cbefd3d0f60c942ed711131f5d638dde1227


--

___
Python tracker 
<https://bugs.python.org/issue46402>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46402] Enhance sqlite3 to avoid implicit creation?

2022-01-18 Thread Eric V. Smith


Eric V. Smith  added the comment:


New changeset 0ae22577606f1b52e3b6c2de6c5b307518044605 by Erlend Egeberg 
Aasland in branch '3.9':
[3.9] bpo-46402: Promote SQLite URI tricks in sqlite3 docs (GH-30660) (#30672)
https://github.com/python/cpython/commit/0ae22577606f1b52e3b6c2de6c5b307518044605


--

___
Python tracker 
<https://bugs.python.org/issue46402>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46442] testExceptionCleanupNames doesn't test anything?

2022-01-20 Thread Eric V. Smith


Eric V. Smith  added the comment:

I don't know for sure, but maybe it's trying to test "del" interacting with the 
fact that the "as e" part doesn't escape the "except" clause, unlike normal 
assignments:

>>> try:
... raise Exception
... except Exception as e:
... print('exception raised')
... foo = 1
...
exception raised
>>> foo
1
>>> e
Traceback (most recent call last):
  File "", line 1, in 
NameError: name 'e' is not defined

--
nosy: +eric.smith

___
Python tracker 
<https://bugs.python.org/issue46442>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46450] namedtuple leaks data between instances when field's default value is empty list

2022-01-21 Thread Eric V. Smith


Eric V. Smith  added the comment:

Also see 
https://docs.python.org/3/faq/programming.html#why-are-default-values-shared-between-objects

--
nosy: +eric.smith
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

___
Python tracker 
<https://bugs.python.org/issue46450>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46461] Kodi crashing

2022-01-21 Thread Eric V. Smith


Eric V. Smith  added the comment:

Without a way to reproduce this, we won't be able to help you.

Ideally you would provide a python script, which we could run, which shows the 
problem. It would be best if there were no third party packages involved, but 
if there are, you should provide instructions on how to set up a virtual 
environment that includes whatever software you need.

--
nosy: +eric.smith

___
Python tracker 
<https://bugs.python.org/issue46461>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46442] testExceptionCleanupNames doesn't test anything?

2022-01-21 Thread Eric V. Smith


Eric V. Smith  added the comment:


New changeset 82c53229e18f5853c82cb8ab6b9af1925a0e9e58 by Yellow Dusk in branch 
'main':
bpo-46442: improve and rename testExceptionCleanupNames (GH-30758)
https://github.com/python/cpython/commit/82c53229e18f5853c82cb8ab6b9af1925a0e9e58


--

___
Python tracker 
<https://bugs.python.org/issue46442>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46442] testExceptionCleanupNames doesn't test anything?

2022-01-22 Thread Eric V. Smith


Eric V. Smith  added the comment:

Thanks, @yellowdusk1590!

--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 
<https://bugs.python.org/issue46442>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46461] Kodi crashing

2022-01-22 Thread Eric V. Smith


Change by Eric V. Smith :


--
status: open -> pending

___
Python tracker 
<https://bugs.python.org/issue46461>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46472] A option that choose between single quote and double quote in shlex.quote

2022-01-22 Thread Eric V. Smith


Change by Eric V. Smith :


--
nosy: +eric.smith

___
Python tracker 
<https://bugs.python.org/issue46472>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45995] string formatting: normalize negative zero

2022-01-22 Thread Eric V. Smith


Eric V. Smith  added the comment:

Wow, thanks, Mark!

I'm generally in favor. The selling points to me are that it needs to happen 
post-rounding, and the C++ discussion. It would be better if this were already 
accepted in C++. I'll note that the paper is proposing a 'z' modifier to the 
sign, so I guess for us that would translate to: [sign[optional-z]] instead of 
just sign. I'd have to noodle through the differences between that the proposed 
[sign][~]. I guess this would all be worked out in a PEP.

My only reservation is Mark's comment:  """For Decimal, we'd need to "own" the 
string formatting, taking that responsibility away from mpdecimal, but there 
are already other reasons to do that."""

If Mark is okay with that (right back at you, Mark!), then I think a PEP is the 
next step. It doesn't need to be huge, sort of like PEP 378.

--

___
Python tracker 
<https://bugs.python.org/issue45995>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46499] circular impoty

2022-01-24 Thread Eric V. Smith


Change by Eric V. Smith :


--
type: crash -> behavior

___
Python tracker 
<https://bugs.python.org/issue46499>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46503] assertion failure in Parser/string_parser.c

2022-01-24 Thread Eric V. Smith


Change by Eric V. Smith :


--
assignee: pablogsal -> eric.smith

___
Python tracker 
<https://bugs.python.org/issue46503>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46503] assertion failure in Parser/string_parser.c

2022-01-24 Thread Eric V. Smith


Eric V. Smith  added the comment:

I'll take a look.

--

___
Python tracker 
<https://bugs.python.org/issue46503>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46503] assertion failure in Parser/string_parser.c

2022-01-24 Thread Eric V. Smith


Eric V. Smith  added the comment:

This triggers the same problem:
f'\N  '
ast.literal_eval() isn't needed.

I think it's just the assert that's wrong, but I'm still checking.

--

___
Python tracker 
<https://bugs.python.org/issue46503>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46503] assertion failure in Parser/string_parser.c

2022-01-24 Thread Eric V. Smith


Change by Eric V. Smith :


--
keywords: +patch
pull_requests: +29046
stage: needs patch -> patch review
pull_request: https://github.com/python/cpython/pull/30865

___
Python tracker 
<https://bugs.python.org/issue46503>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46503] assertion failure in Parser/string_parser.c

2022-01-24 Thread Eric V. Smith


Eric V. Smith  added the comment:

Note that f'\N ' (with a single space) isn't enough to trigger this behavior. 
It requires at least two characters after the '\N'. The first is when the 
invalid string is recognized, and it's the presence of the second character 
that triggers the failed assert.

--

___
Python tracker 
<https://bugs.python.org/issue46503>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46503] assertion failure in Parser/string_parser.c

2022-01-24 Thread Eric V. Smith


Eric V. Smith  added the comment:


New changeset 0daf72194bd4e31de7f12020685bb39a14d6f45e by Eric V. Smith in 
branch 'main':
bpo-46503: Prevent an assert from firing when parsing some invalid \N sequences 
in f-strings. (GH-30865)
https://github.com/python/cpython/commit/0daf72194bd4e31de7f12020685bb39a14d6f45e


--

___
Python tracker 
<https://bugs.python.org/issue46503>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46503] assertion failure in Parser/string_parser.c

2022-01-24 Thread Eric V. Smith


Eric V. Smith  added the comment:


New changeset c314e3e829943b186e1c894071f00c613433cfe5 by Miss Islington (bot) 
in branch '3.9':
bpo-46503: Prevent an assert from firing when parsing some invalid \N sequences 
in f-strings. (GH-30865) (30867)
https://github.com/python/cpython/commit/c314e3e829943b186e1c894071f00c613433cfe5


--

___
Python tracker 
<https://bugs.python.org/issue46503>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46503] assertion failure in Parser/string_parser.c

2022-01-24 Thread Eric V. Smith


Eric V. Smith  added the comment:


New changeset 894e8c13484822458d53cc77c9265b7a88450a4b by Miss Islington (bot) 
in branch '3.10':
bpo-46503: Prevent an assert from firing when parsing some invalid \N sequences 
in f-strings. (GH-30865) (GH-30866)
https://github.com/python/cpython/commit/894e8c13484822458d53cc77c9265b7a88450a4b


--

___
Python tracker 
<https://bugs.python.org/issue46503>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46503] assertion failure in Parser/string_parser.c

2022-01-24 Thread Eric V. Smith


Change by Eric V. Smith :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 
<https://bugs.python.org/issue46503>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46503] assertion failure in Parser/string_parser.c

2022-01-25 Thread Eric V. Smith


Change by Eric V. Smith :


--
pull_requests: +29064
pull_request: https://github.com/python/cpython/pull/30883

___
Python tracker 
<https://bugs.python.org/issue46503>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46515] Benefits Of Phool Makhana

2022-01-25 Thread Eric V. Smith


Change by Eric V. Smith :


--
Removed message: https://bugs.python.org/msg411578

___
Python tracker 
<https://bugs.python.org/issue46515>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46515] SPAM

2022-01-25 Thread Eric V. Smith


Change by Eric V. Smith :


--
nosy:  -faizanjaved2021
title: Benefits Of Phool Makhana -> SPAM

___
Python tracker 
<https://bugs.python.org/issue46515>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46511] dataclasses: Allow typing.Annotated to wrap dataclasses-specific annotations

2022-01-25 Thread Eric V. Smith


Eric V. Smith  added the comment:

My thoughts are that I'd like PEP 563 to go away, and PEP 649 to be accepted, 
and also never allow string literal annotations like the string 
"Annotated[ClassVar[int]]". But since we'll no doubt have to support 
string-ized annotations even if PEP 649 is accepted, that's a pipe dream.

I think your suggestion for #1 seems reasonable.

For #2, in the case where typing has been imported and the annotation isn't a 
string, I assume it's simple enough to look inside the Annotated object and 
extract the InitVar (or ClassVar) object. I haven't delved in to Annotated 
object yet.

For #2, with a string annotation, it does look like it will get ugly. I'll have 
to spend some time looking at _MODULE_IDENTIFIER_RE. I'm guessing we'll need 
another re that looks for the same basic thing with "Annotated[" or 
"module.Annotated[" prepended and then look inside that. Or maybe one re to do 
both. I don't think we should support cases like:

from __future__ import annotations
myAnnotated = typing.Annotated

@dataclass
class Foo:
a: myAnnotated[ClassVar[int]]

(That is, we won't recognize the string "myAnnotated[ClassVar[int]]" as an 
Annotated ClassVar.

Maybe we should also restrict it to "Annotated" or "typing.Annotated", but that 
would prevent someone from using "import typing as _typing", for example. This 
is why the current code accepts any module name, not strictly "typing". At 
least that's my recollection, more study is needed.

Or maybe it's time to give up and use typing.get_type_hints() or 
inspect.get_annotations(), but I suspect there are enough corner cases that 
will fail that we'll never get that to work right. Nested classes, anyone?

The whole runtime inspection of string-ized annotations is a mess.

On the "performance is important" comment: I'm not sure this is really an issue 
any more. There was some PEP that was supposed to speed up importing typing, 
and I never looked at the performance once it was merged. But then again, I'm 
not sure we want to always have dataclasses import typing, either. If a program 
doesn't use dataclasses that using the typing module, there's no sense 
importing it and enlarging the working set of modules.

I welcome any insights on any of these issues. I'm not a typing expert.

--

___
Python tracker 
<https://bugs.python.org/issue46511>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46536] Better for loop

2022-01-26 Thread Eric V. Smith


Eric V. Smith  added the comment:

Thank you for the suggestion.

This is unlikely to gain acceptance. zip is usable in places outside of for 
loops, whereas your suggestion appears to be only useful in for loops. In 
addition, I don't see a way to specify the "strict" option using your syntax. 
Your syntax also doesn't seem to add any new functionality or expressiveness to 
python, which is one of the usual criteria for adding new syntax.

I'm going to close this, but if you'd like to pursue it, I suggest opening a 
discussion on the python-ideas mailing list.

--
nosy: +eric.smith
resolution: not a bug -> rejected
stage:  -> resolved
status: open -> closed

___
Python tracker 
<https://bugs.python.org/issue46536>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46552] typing: get_type_hints can't handle stringified annotations with leading spaces

2022-01-27 Thread Eric V. Smith


Eric V. Smith  added the comment:

The dataclasses tests were in fact just added for completeness. I'd be okay 
with changing dataclasses to reject leading spaces.

--

___
Python tracker 
<https://bugs.python.org/issue46552>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46553] typing: get_type_hints on stringified lone ClassVar raises TypeError

2022-01-27 Thread Eric V. Smith


Eric V. Smith  added the comment:

dataclasses is no doubt too lenient. But it's just trying to accept valid 
strings that look like ClassVar. Way back when this was initially implemented, 
we decided that calling get_type_hints would be too expensive for every 
dataclass, and would also neccesitate importing typing, which we didn't want to 
require.

I think someone needs to do an analysis of how expensive it would be for 
dataclasses to import typing and to call get_type_hints. Perhaps we'd make a 
different decision today.

--

___
Python tracker 
<https://bugs.python.org/issue46553>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46511] dataclasses: Allow typing.Annotated to wrap dataclasses-specific annotations

2022-01-27 Thread Eric V. Smith


Eric V. Smith  added the comment:

I was hoping to wait until the PEP 649 / PEP 563 thing was decided. But I 
realize that no matter how that turns out, there will be a need to deal with 
string annotations.

So I think I'm okay with the regex changes. Personally, I think we should 
remove support for leading spaces and should remove the tests, too. I guess 
there's some argument that there should be a deprecation period, I think it's 
just invalid syntax and shouldn't be supported.

Go ahead and put together a PR.

--

___
Python tracker 
<https://bugs.python.org/issue46511>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46557] Logging captured warnings with a format string unnecessarily groups warnings together

2022-01-27 Thread Eric V. Smith


Eric V. Smith  added the comment:

Could you give an example of the problem?

--
nosy: +eric.smith

___
Python tracker 
<https://bugs.python.org/issue46557>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46503] assertion failure in Parser/string_parser.c

2022-01-28 Thread Eric V. Smith


Eric V. Smith  added the comment:

In case anyone cares: in a non-debug build, this error had no real effect. It 
just caused the "find the literal part of an fstring" routine to terminate 
early, but since the part that it had already identified was still in error, a 
syntax error was still raised.

For "\Nxy" it would terminate at "\Nx", instead of consuming the whole string. 
But since "\Nx" isn't a valid string (bad unicode name escape), it would raise 
the same syntax error as "\Nxy".

--

___
Python tracker 
<https://bugs.python.org/issue46503>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue26276] Inconsistent behaviour of PEP 3101 formatting between versions

2022-01-31 Thread Eric V. Smith


Eric V. Smith  added the comment:

I'm going to close this issue. The behavior might be inconsistent with 2.7, but 
I don't think that matters any more.

--
resolution:  -> wont fix
stage:  -> resolved
status: open -> closed

___
Python tracker 
<https://bugs.python.org/issue26276>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46610] assertCountEqual doesn't work as expected for dictionary elements

2022-02-02 Thread Eric V. Smith


Eric V. Smith  added the comment:

The PR changes the meaning of assertCountEqual. 
https://docs.python.org/3/library/unittest.html#unittest.TestCase.assertCountEqual
 says: Equivalent to: assertEqual(Counter(list(first)), Counter(list(second))) 
...

At the very least, the documentation would need to be updated. But since this 
could be a breaking change, I don't think it will be accepted.

--
nosy: +eric.smith

___
Python tracker 
<https://bugs.python.org/issue46610>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46612] Unclear behavior of += operator

2022-02-02 Thread Eric V. Smith


Eric V. Smith  added the comment:

The "evaluate the target" part causes the UnboundLocalError, just as in:

>>> x=1
>>> def f():
...   x
...   x = x + 1
... 
>>> f()
Traceback (most recent call last):
  File "", line 1, in 
  File "", line 2, in f
UnboundLocalError: local variable 'x' referenced before assignment

--
nosy: +eric.smith

___
Python tracker 
<https://bugs.python.org/issue46612>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46612] Unclear behavior of += operator

2022-02-02 Thread Eric V. Smith


Change by Eric V. Smith :


--
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

___
Python tracker 
<https://bugs.python.org/issue46612>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46617] CSV Creation occasional off by one error

2022-02-02 Thread Eric V. Smith


Eric V. Smith  added the comment:

There's too much for us to look at here. Can you create a small example which 
demonstrates the problem?

It should include the input, the code, the actual output, and the expected 
output.

--
nosy: +eric.smith

___
Python tracker 
<https://bugs.python.org/issue46617>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46617] CSV Creation occasional off by one error

2022-02-02 Thread Eric V. Smith


Change by Eric V. Smith :


--
resolution:  -> not a bug

___
Python tracker 
<https://bugs.python.org/issue46617>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46628] Can't install YARL

2022-02-03 Thread Eric V. Smith


Eric V. Smith  added the comment:

It looks like you're missing dependencies required to compile yarl. Since this 
isn't a bug with Python, I'm going to close this.

I suggest you ask the yarl community for help. Their home page is 
https://github.com/aio-libs/yarl/

Good luck!

--
nosy: +eric.smith
resolution:  -> third party
stage:  -> resolved
status: open -> closed

___
Python tracker 
<https://bugs.python.org/issue46628>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46628] Can't install YARL

2022-02-03 Thread Eric V. Smith


Eric V. Smith  added the comment:

Ah. longintrepr.h is an internal Python file, not meant for external 
consumption. This file moved in Python 3.11. So this is still a yarl issue: 
they'll need to adjust how they read that file. But my recommendation is that 
they find another way to do what they want without including it.

See https://github.com/python/cpython/blob/main/Include/README.rst. Files in 
the cpython directory (which longintrepr.h is) are a CPython implementation 
detail, and can change or move at any time.

--

___
Python tracker 
<https://bugs.python.org/issue46628>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46636] Bugs of 2to3 on built-in function or types(classes)

2022-02-04 Thread Eric V. Smith


Eric V. Smith  added the comment:

I'm not sure what you're trying to accomplish here, but long and unichr are not 
available in python 3.

2to3 has been deprecated and is no longer supported.

--
nosy: +eric.smith

___
Python tracker 
<https://bugs.python.org/issue46636>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



  1   2   3   4   5   6   7   8   9   10   >