[issue34364] problem with traceback for syntax error in f-string
Eric V. Smith added the comment: I worked on this at the core sprint, and I have a patch almost ready. -- ___ Python tracker <https://bugs.python.org/issue34364> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue34776] Postponed annotations break inspection of dataclasses
Eric V. Smith added the comment: Ned: I'm marking this as a release blocker because I'd like to get it in 3.7.1. If I can't do that in the next 5 hours or so, I'll remove the release blocker tag. -- assignee: -> eric.smith nosy: +ned.deily priority: normal -> release blocker ___ Python tracker <https://bugs.python.org/issue34776> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue34364] problem with traceback for syntax error in f-string
Eric V. Smith added the comment: It's more elaborate than I'd like, but I think it's the right way to solve it: I'm passing in the starting line and column number to the parser machinery. -- ___ Python tracker <https://bugs.python.org/issue34364> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue34776] Postponed annotations break inspection of dataclasses
Eric V. Smith added the comment: Unfortunately, I'm not going to be able to give this the attention it deserves before the 3.7.1 cutoff. The changes are sufficiently tricky that I want to make sure I think through the issue in the appropriate detail. Ned: I've made it not a release blocker. Please remove yourself as nosy if you don't care about this issue. I don't plan on making it a release blocker again, I just did that because it was so near the deadline. Yury: Sorry for not being able to get delve in to it sufficiently. Thanks for your work on it. I should be able to review this in the next few days, so we can get this in to 3.7.2. -- priority: release blocker -> ___ Python tracker <https://bugs.python.org/issue34776> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue34776] Postponed annotations break inspection of dataclasses
Eric V. Smith added the comment: [Adding to nosy people who were on the original email] Copying (part of) my response from the email thread: These work: print(get_type_hints(Bar.__init__, globals())) print(get_type_hints(Bar.__init__, Bar.__module__)) But I agree that maybe doing something with dataclasses to address this would be good. Especially as the first one requires being in the same module as Foo. See this for Yury's self-described "hack-ish fix we can use" until we do something better: https://gist.github.com/1st1/37fdd3cc84cd65b9af3471b935b722df -- nosy: +eric.smith, gvanrossum, ivan, lukasz.langa, yselivanov ___ Python tracker <https://bugs.python.org/issue34776> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue35271] venv creates pyvenv.cfg with wrong home
Eric V. Smith added the comment: You're going to have to provide some information, we can't guess at what's going on. At the very least: What OS? What shell? Which exact version of Python? How was it installed? Where is the file pyvenv.cfg that shows the problem? What are its entire contents? What are all of your environment variable? -- nosy: +eric.smith ___ Python tracker <https://bugs.python.org/issue35271> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue35626] Python dictreader KeyError issue
Eric V. Smith added the comment: Steven is correct: your problem is that in the first example you're reading the header row before you pass the file to DictReader, so the DictReader cannot know what your columns are named. (Actually, your code uses the second row of your file as the column names: you should have been able to determine this by looking at the value of "row" that was printed). I'm going to close this issue. Please do some more investigation. If you can produce a short example that we can execute ourselves, including any needed data files, and you think it still shows an error, please feel free to reopen this issue. -- nosy: +eric.smith resolution: -> not a bug stage: -> resolved status: open -> closed ___ Python tracker <https://bugs.python.org/issue35626> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue8538] Add FlagAction to argparse
Eric V. Smith added the comment: Yes, this is the correct bug tracker. And note that this code isn't mine, I just posted it here so it wouldn't be lost. It looks like the original message was from https://mail.python.org/pipermail/python-dev/2010-April/099704.html -- ___ Python tracker <https://bugs.python.org/issue8538> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue35617] unittest discover does not work with implicit namespaces
Change by Eric V. Smith : -- nosy: +eric.smith ___ Python tracker <https://bugs.python.org/issue35617> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue35638] Introduce fixed point locale aware format type for floating point numbers
Eric V. Smith added the comment: I haven't looked at this closely yet, but you'll need to at least: - add tests that the locale-aware formatting is happening - support decimal - make sure it works with complex (which it probably does, but needs a test) And, I think we'll need to run this through python-ideas first. One thing I expect to come up there: why f and not g? Again, I haven't looked through the code yet, or really even given any thought to determining if this is a sound idea. -- title: Introduce fixed point locale awear format type for floating point numbers -> Introduce fixed point locale aware format type for floating point numbers ___ Python tracker <https://bugs.python.org/issue35638> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue35646] python -v writes to stderr
Eric V. Smith added the comment: That's just the way it is with 2.7. -- ___ Python tracker <https://bugs.python.org/issue35646> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue35646] python -v writes to stderr
Eric V. Smith added the comment: -v writes to stderr, so this is the expected behavior. Although maybe this could be better documented. See issue 18338, where this was briefly discussed and a change was rejected. Maybe you're looking for -V (uppercase) or --version, which do write to stdout, at least in 3.x. I'm not sure where they write in 2.7, but it's much too late to change 2.7's behavior. I'm going to close this. If you find some of our documentation that says -v writes to stdout, then we can reopen this. This is not a Windows specific error, so I'm modifying the nosy list. -- components: +Interpreter Core -Windows, ctypes nosy: +eric.smith -paul.moore, steve.dower, tim.golden, zach.ware resolution: -> not a bug stage: -> resolved status: open -> closed title: Subprocess.Popen('python -v',stdout=PIPE,stderr=PIPE,Shell=True) gives output in stderr -> python -v writes to stderr ___ Python tracker <https://bugs.python.org/issue35646> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue35750] process finished with exit code -1073740940 (0xc0000374)
Eric V. Smith added the comment: I assume this is on Windows? 0xc374 is a heap corruption error on Windows. I agree that without a way to reproduce this it will be impossible to track down any error. -- nosy: +eric.smith ___ Python tracker <https://bugs.python.org/issue35750> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue35761] Allow dataclasses to be updated in place
Eric V. Smith added the comment: What would the interaction be between other_instance and changes? Why is this API different from .replace()? -- assignee: -> eric.smith nosy: +eric.smith ___ Python tracker <https://bugs.python.org/issue35761> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue17005] Add a topological sort algorithm
Eric V. Smith added the comment: This is why I prefer the API exposed by https://pypi.org/project/toposort/ list(toposort({2: {11}, 9: {11, 8, 10}, 10: {11, 3}, 11: {7, 5}, 8: {7, 3}, })) returns [{3, 5, 7}, {8, 11}, {2, 10}, {9}] For an node with no edges, use an empty set: list(toposort({100: set(), 2: {11}, 9: {11, 8, 10}, 10: {11, 3}, 11: {7, 5}, 8: {7, 3}, })) [{3, 100, 5, 7}, {8, 11}, {2, 10}, {9}] I also don't think we should provide multiple APIs. Let's just provide one, and recipes for any helpers, if needed. For example, to flatten the result into a list. Or to take a list of edges as the input. -- ___ Python tracker <https://bugs.python.org/issue17005> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue35787] shlex.split inserts extra item on backslash space space
Eric V. Smith added the comment: I agree that the current behavior makes sense. I think "preserve the literal value of the next character" means the space won't be interpreted as a separator. In the first example (I think better written as shlex.split(r'a \ b')), the first space is a separator. The second space is not a separator because of the backslash, so it's part of the second token ' b'. In the second example (shlex.split(r'a \ b')), the first space is a separator, the second space is not a separator because of the backslash, and the third space is a separator. This explains why there's no space before the 'b'. I assume peter.otten's example is bash. I can confirm with zsh: [~]$ python3 -c 'import sys; print(sys.argv)' a b ['-c', 'a', 'b'] [~]$ python3 -c 'import sys; print(sys.argv)' a \ b ['-c', 'a', ' b'] [~]$ python3 -c 'import sys; print(sys.argv)' a \ b ['-c', 'a', ' ', 'b'] I'm going to close this. But anyone wants to suggest a documentation patch, feel free to reopen this. Also, changing this would no doubt break some code, so I'd recommend against changing it even if I didn't think it was doing the right thing. -- nosy: +eric.smith resolution: -> not a bug stage: -> resolved status: open -> closed type: -> behavior ___ Python tracker <https://bugs.python.org/issue35787> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue35761] Allow dataclasses to be updated in place
Eric V. Smith added the comment: I agree that I don't see the point, unless there's something I'm missing with other_instance. Or maybe the proposal is for it to also work with frozen dataclasses? I'm definitely -1 on that. So unless there's something I'm missing where normal attribute assignment wouldn't work, I'm leaning toward rejecting this. What is it about dataclasses that would need this feature, where regular classes don't? Just do what you'd do with regular classes. -- ___ Python tracker <https://bugs.python.org/issue35761> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue9334] argparse: add a full fledged parser as a subparser
Eric V. Smith added the comment: Why the title change? The original problem still exists, and I don't see how it's related to subparsers. -- ___ 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
[issue35546] String formatting produces incorrect result with left-aligned zero-padded format
Eric V. Smith added the comment: I think this falls in to the consenting adults category. You can also do things like: >>> format(42, '->3') '-42' But why bother preventing this? It is unfortunate that %-formatting and .__format__() are different in this regard, but at this point I wouldn't recommend making any changes. -- ___ Python tracker <https://bugs.python.org/issue35546> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue35494] Inaccurate error message for f-string
Change by Eric V. Smith : -- assignee: -> eric.smith nosy: +eric.smith ___ Python tracker <https://bugs.python.org/issue35494> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue35494] Inaccurate error message for f-string
Eric V. Smith added the comment: Go ahead, Serhiy. Thanks! -- assignee: eric.smith -> serhiy.storchaka ___ Python tracker <https://bugs.python.org/issue35494> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue35540] dataclasses.asdict breaks with defaultdict fields
Change by Eric V. Smith : -- assignee: -> eric.smith nosy: +eric.smith ___ Python tracker <https://bugs.python.org/issue35540> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue35358] avoid '-' in importlib.import_module and builtins.__import__
Eric V. Smith added the comment: I dynamically load a lot of modules whose names contain hyphens, or are otherwise non-identifiers (like 3rdparty.py). The suggested change would break a lot of working code. The only thing I can see being possible is to add a warning that no one would likely ever see. So I think we should take no action here. -- nosy: +eric.smith type: -> enhancement versions: -Python 3.5, Python 3.6, Python 3.7 ___ Python tracker <https://bugs.python.org/issue35358> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue35421] Expected result is not clear in case of list.append(list)
Eric V. Smith added the comment: The ... denotes a recursive data structure, which is what you've created here by "a" including itself as an element. I'm not clear what you expected to see, but I'm going to close this because I don't see an actual problem here. If you think there's a bug in Python, please describe it here. Also make sure to include what you expect to see in addition to what you do see. -- nosy: +eric.smith resolution: -> not a bug stage: -> resolved status: open -> closed ___ Python tracker <https://bugs.python.org/issue35421> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue35393] Typo in documentation
Eric V. Smith added the comment: Can you be more specific? There's not enough information here to take any action. -- nosy: +eric.smith ___ Python tracker <https://bugs.python.org/issue35393> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue35432] str.format and string.Formatter bug with French (and other) locale
Eric V. Smith added the comment: Possibly related to issue 33954? -- nosy: +eric.smith ___ Python tracker <https://bugs.python.org/issue35432> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue35271] venv creates pyvenv.cfg with wrong home
Change by Eric V. Smith : -- status: open -> pending ___ Python tracker <https://bugs.python.org/issue35271> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue35710] Make dataclasses.field() accept another name for __init__ field's name
Change by Eric V. Smith : -- assignee: -> eric.smith nosy: +eric.smith type: -> enhancement ___ Python tracker <https://bugs.python.org/issue35710> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue35673] Loader for namespace packages
Eric V. Smith added the comment: I think exposing _NamespaceLoader as NamespaceLoader and registering the ABC make sense. That would make this in to a feature request for 3.8. -- ___ Python tracker <https://bugs.python.org/issue35673> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue35673] Loader for namespace packages
Eric V. Smith added the comment: Namespace packages (PEP 420) predate ModuleSpec (PEP 451). So, I think this probably happened when 451 was implemented. Maybe Eric Snow recalls? I say this without having looked at it very deeply. As to why the namespace package loader is a private class: it never occurred to me someone would care about inspecting it. -- nosy: +eric.snow ___ Python tracker <https://bugs.python.org/issue35673> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue35594] Python script generating Segmentation Fault
Eric V. Smith added the comment: Thanks for the report, but that example is so large and complicated that it's difficult for someone not familiar with it to understand what's going on. If you could simplify it down to the smallest example that duplicates the problem, then perhaps we could make more progress. Short of that, one thing you should look at is Victor's faulthander work: https://docs.python.org/3/library/faulthandler.html . It might give enough information to diagnose the problem. -- nosy: +eric.smith ___ Python tracker <https://bugs.python.org/issue35594> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue35638] Introduce fixed point locale awear format type for floating point numbers
Eric V. Smith added the comment: Of course, feel free to create a PR. But the correct place to discuss any new behavior is on the issue tracker, or maybe on python-ideas, not in a PR. -- ___ Python tracker <https://bugs.python.org/issue35638> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue35638] Introduce fixed point locale awear format type for floating point numbers
Eric V. Smith added the comment: Since this is a new feature, it can only be added to 3.8. Adjusting versions accordingly. I suggest that if we add this at all, it only be added to __format__, not to %-formatting. Any suggestions on a specification for this? -- components: +Interpreter Core -Library (Lib) nosy: +eric.smith versions: -Python 2.7, Python 3.4, Python 3.5, Python 3.6, Python 3.7 ___ Python tracker <https://bugs.python.org/issue35638> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue35638] Introduce fixed point locale awear format type for floating point numbers
Eric V. Smith added the comment: Before a patch is created, we should discuss the behavior that will be implemented and agree on it. What is your suggestion? -- ___ Python tracker <https://bugs.python.org/issue35638> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue34409] Add a way to customize iteration over fields in asdict() for the nested dataclasses
Eric V. Smith added the comment: Thanks, Raymond. I agree that this request is too specialized to add to dataclasses. Any proposal here or that I've been able to think of complicate the API for the much more common use case of not needing asdict() specialization. To the original poster: I suggest you just implement the functionality you need in a custom version of asdict() yourself. As noted, all of the information needed for a custom asdict() are publicly available. -- resolution: -> rejected stage: -> resolved status: open -> closed ___ Python tracker <https://bugs.python.org/issue34409> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue34653] PyParser_SimpleParseStringFilename should be deleted
New submission from Eric V. Smith : There are 6 PyParser_SimpleParse* functions in pythonrun.c. 5 of them are documented in c-api/veryhigh.rst and appear in pythonrun.h. But PyParser_SimpleParseStringFilename is not documented and is not in any .h file. I propose we delete PyParser_SimpleParseStringFilename. It's not documented, it's not in a .h file, and it's not called from within Python's source. It's also trivial to implement in terms of PyParser_SimpleParseStringFlagsFilename. -- assignee: eric.smith components: Interpreter Core messages: 325189 nosy: eric.smith priority: normal severity: normal status: open title: PyParser_SimpleParseStringFilename should be deleted type: enhancement versions: Python 3.7, Python 3.8 ___ Python tracker <https://bugs.python.org/issue34653> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue34363] dataclasses.asdict() mishandles dataclass instance attributes that are instances of subclassed typing.NamedTuple
Eric V. Smith added the comment: New changeset 9b9d97dd139a799d28ff8bc90d118b1cac190b03 by Eric V. Smith in branch 'master': bpo-34363: dataclasses.asdict() and .astuple() now handle fields which are namedtuples. (GH-9151) https://github.com/python/cpython/commit/9b9d97dd139a799d28ff8bc90d118b1cac190b03 -- ___ Python tracker <https://bugs.python.org/issue34363> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue34653] PyParser_SimpleParseStringFilename should be deleted
Eric V. Smith added the comment: I'm not going to backport this to 3.7, just in case. -- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: -Python 3.7 ___ Python tracker <https://bugs.python.org/issue34653> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue34683] Caret positioned wrong for SyntaxError reported by ast.c
Eric V. Smith added the comment: I think Benjamin's diagnosis is correct. In which case, my f-string error reporting changes (see #34364) won't intersect with a fix to this issue. -- ___ Python tracker <https://bugs.python.org/issue34683> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue34682] Typo reports on docs@
Eric V. Smith added the comment: Agreed with @geoffreyspear: "means" is okay, the rest of the changes look good. -- nosy: +eric.smith ___ Python tracker <https://bugs.python.org/issue34682> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue34683] Caret positioned wrong for SyntaxError reported by ast.c
Eric V. Smith added the comment: I'm doing some fairly major surgery on line and column numbers for fixing f-string errors. I'll see if I can include this case, too. -- nosy: +eric.smith ___ Python tracker <https://bugs.python.org/issue34683> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue34363] dataclasses.asdict() mishandles dataclass instance attributes that are instances of subclassed typing.NamedTuple
Eric V. Smith added the comment: New changeset 78aa3d8f5204bc856d7b2eb67288cf90c6a30660 by Eric V. Smith (Miss Islington (bot)) in branch '3.7': bpo-34363: dataclasses.asdict() and .astuple() now handle fields which are namedtuples. (GH-9151) (GH-9304) https://github.com/python/cpython/commit/78aa3d8f5204bc856d7b2eb67288cf90c6a30660 -- ___ Python tracker <https://bugs.python.org/issue34363> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue34363] dataclasses.asdict() mishandles dataclass instance attributes that are instances of subclassed typing.NamedTuple
Change by Eric V. Smith : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.org/issue34363> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue34690] Store startup modules as C structures for 20%+ startup speed improvement
Change by Eric V. Smith : -- nosy: +eric.smith ___ Python tracker <https://bugs.python.org/issue34690> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue34363] dataclasses.asdict() mishandles dataclass instance attributes that are instances of subclassed typing.NamedTuple
Eric V. Smith added the comment: The question here is: what should asdict() return if the dataclass contains a namedtuple? What the code is trying to do (but currently failing!) is to return another namedtuple, but with the values returned by recursively calling in to asdict() (or rather, its helper function) for each field in the namedtuple. I think this is the correct behavior. Specifically, I do not want to call the namedtuple's _asdict() method. There are two problems with _asdict(): 1. It doesn't recurse in to the fields, like asdict() normally does with a dict, list, or tuple. 2. It returns a dict! This is a problem because if a dataclass field contains a dict which has a key which is a namedtuple, then asdict() would fail. Here's an example of #2 above, if asdict() on a namedtuple field returns a dict: @dataclass class C: f: 'Any' T = namedtuple('T', 'a') c = C({T('an a'): 0}) print('c:', c) print(asdict(c)) # <- error here prints: c: C(f={T(a='an a'): 0}) Traceback (most recent call last): ... File "/home/eric/python/lib/dataclasses.py", line 1019, in asdict return _asdict_inner(obj, dict_factory) File "/home/eric/python/lib/dataclasses.py", line 1026, in _asdict_inner value = _asdict_inner(getattr(obj, f.name), dict_factory) File "/home/eric/python/lib/dataclasses.py", line 1059, in _asdict_inner for k, v in obj.items()) TypeError: unhashable type: 'collections.OrderedDict' So, although it's unfortunate, I think the only reasonable thing to do in this case is to have asdict() on a namedtuple return another namedtuple. Here's how that looks using the above code: c: C(f={T(a='an a'): 0}) {'f': {T(a='an a'): 0}} Admittedly, this can't be used with json.dumps() (you get "TypeError: keys must be str, int, float, bool or None, not T"), but I think it's the best we can do. It's consistent with any other class derived from tuple or list: asdict() will convert it to a copy of the class, recursing into each item that's in the tuple or list. -- ___ Python tracker <https://bugs.python.org/issue34363> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue34409] Add a way to customize iteration over fields in asdict() for the nested dataclasses
Eric V. Smith added the comment: I've been thinking about this, but I don't have a suggestion on how to improve the API. Maybe some sort of visitor pattern? I'm open to concrete ideas. -- ___ Python tracker <https://bugs.python.org/issue34409> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue34707] Python not reentrant
Eric V. Smith added the comment: I think this is along the lines of a recent discussion on the c-api mailing list about passing a context value (your handle) to every C call. See this message for some discussion: https://mail.python.org/mm3/archives/list/capi-...@python.org/message/ZN6BJVUGIOGWKHY47PKPX5Z3SGCYUAX5/ -- nosy: +eric.smith ___ Python tracker <https://bugs.python.org/issue34707> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue34653] PyParser_SimpleParseStringFilename should be deleted
Change by Eric V. Smith : -- keywords: +patch pull_requests: +8691 stage: -> patch review ___ Python tracker <https://bugs.python.org/issue34653> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue35820] Inconsistent behavior when parsing IP address
Eric V. Smith added the comment: >From the documentation of IPv4Address: The following constitutes a valid IPv4 address: 1. A string in decimal-dot notation, consisting of four decimal integers in the inclusive range 0–255, separated by dots (e.g. 192.168.0.1). Each integer represents an octet (byte) in the address. Leading zeroes are tolerated only for values less than 8 (as there is no ambiguity between the decimal and octal interpretations of such strings). 21 is not less than 8, so you get this error. I think this is working as it's documented. -- nosy: +eric.smith ___ Python tracker <https://bugs.python.org/issue35820> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue35834] get_type_hints exposes an instance of ForwardRef (internal class) in its result, with `from __future__ import annotations` enabled
Change by Eric V. Smith : -- nosy: +eric.smith, lukasz.langa ___ Python tracker <https://bugs.python.org/issue35834> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue36524] identity operator
Eric V. Smith added the comment: I'm not sure what you're asking here. You're comparing the result of the print function to a value. Print returns None, so it doesn't compare equal to any of the values you're comparing it to. To see what's happening, try: >>> print(None) == None None True But really, your problem is probably a misunderstanding of the return value of the print function. -- nosy: +eric.smith ___ Python tracker <https://bugs.python.org/issue36524> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue36524] identity operator
Change by Eric V. Smith : -- nosy: +eric.smith ___ Python tracker <https://bugs.python.org/issue36524> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue36480] .strip() unexpected output on Windows
Eric V. Smith added the comment: Please provide the exact code to duplicate the problem. I suspect this is a problem with your code, not with str.strip and not with Windows. -- nosy: +eric.smith status: open -> pending ___ Python tracker <https://bugs.python.org/issue36480> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue36384] ipaddress Should not reject IPv4 addresses with leading zeroes as ambiguously octal
Eric V. Smith added the comment: I think it should be 3.8 only, and the docs should be updated. Apologies for not catching that earlier: I searched via Google, which was a mistake. -- ___ Python tracker <https://bugs.python.org/issue36384> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue36480] .strip() unexpected output on Windows
Eric V. Smith added the comment: I cannot run that example on my computer. Please reduce this to a single line of code, with no imports, that calls .strip() and shows your problem. Ideally you will just use constants, and not computed strings. Something like: >>> 'magenta.zip'.strip('pizamn') 'genta.' And also, show that exact same line of code executed on both platforms. That said, the problem is likely in your usage of .strip(). Please re-read the documentation: it does not remove substrings from a given string, it removes any of the given characters from the beginning and end of the string. So, this is correct: >>> 'magenta.zip'.strip('pm') 'agenta.zi' You're probably seeing some difference due to upper or lower case filenames on the two platforms. -- ___ Python tracker <https://bugs.python.org/issue36480> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue36480] .strip() unexpected output on Windows
Change by Eric V. Smith : -- resolution: -> not a bug stage: -> resolved status: open -> closed ___ Python tracker <https://bugs.python.org/issue36480> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11644] Cross-link 2to3 documentation, what’s new and pyporting howto
Eric V. Smith added the comment: I agree we should close this. -- ___ Python tracker <https://bugs.python.org/issue11644> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue36384] ipaddress Should not reject IPv4 addresses with leading zeroes as ambiguously octal
Eric V. Smith added the comment: I agree that this is not a useful check. -- nosy: +eric.smith ___ Python tracker <https://bugs.python.org/issue36384> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue36424] Pickle fails on frozen dataclass that has slots
Change by Eric V. Smith : -- assignee: -> eric.smith ___ Python tracker <https://bugs.python.org/issue36424> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue36077] Inheritance dataclasses fields and default init statement
Change by Eric V. Smith : -- assignee: -> eric.smith ___ Python tracker <https://bugs.python.org/issue36077> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue36077] Inheritance dataclasses fields and default init statement
Eric V. Smith added the comment: I'm not keen on re-ordering parameters. Maybe it could be done if specified with a parameter to @dataclass. -- ___ Python tracker <https://bugs.python.org/issue36077> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue34776] Postponed annotations break inspection of dataclasses
Eric V. Smith added the comment: I'm finally getting time to look at this. I'll see what I can do. -- ___ Python tracker <https://bugs.python.org/issue34776> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue36117] Allow rich comparisons for real-valued complex objects.
Eric V. Smith added the comment: -1. We don't want to have objects that are orderable depending on their values. I can't think of anywhere else we do this. It would be very easy to have a complex == 42+0.001j, after some calculation. This near-zero imaginary part would prevent it from being orderable, while if a similar calculation produced exactly 42+0j, then that instance would be orderable. An application relying on this would be a nightmare to write comprehensive tests for. Whether something is orderable or not should depend solely on its type, not its value. -- nosy: +eric.smith ___ Python tracker <https://bugs.python.org/issue36117> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue36070] Enclosing scope not visible from within list comprehension
Eric V. Smith added the comment: I suspect Nathan is seeing this problem at class scope. This is a well known issue: >>> class C: ... from random import random ... out = [random() for ind in range(3)] ... Traceback (most recent call last): File "", line 1, in File "", line 3, in C File "", line 3, in NameError: name 'random' is not defined >>> It is not related to the list comprehension, but to the class scope. See the last paragraph of https://docs.python.org/3/reference/executionmodel.html#resolution-of-names But I agree with Zach about needing an example that fails. -- nosy: +eric.smith ___ Python tracker <https://bugs.python.org/issue36070> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue33944] Deprecate and remove pth files
Eric V. Smith added the comment: >> I should have to start that package somehow. > > `pip install` is a pretty good opt-in already imo I think that’s where we disagree. Like others, I don’t want this to affect every python script in a given installation. >> Instead of just shipping "my_module.foo", you ship "my_module.py" and >> "_my_module.foo", where "my_module.py" looks like: > > but that's exactly my point, now you have to ship extra junk python files > when it's a way better experience to have the hooks _just work_ You mean extra junk like .pth files? I don’t see the difference between a .py file and a .pth file, except I can’t opt out of .pth files. We’re just looking for some way to control the behavior, without giving the .pth file unlimited capabilities before the user script starts. If it’s “just” some extra .py files, then maybe that’s great. If we need some other new mechanism, then I’d be okay with that, too. -- ___ Python tracker <https://bugs.python.org/issue33944> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue36400] Add activate script to venv root folder
Eric V. Smith added the comment: While I think this might have been a reasonable choice when this was first added, I think it's too late to change. We'd have to keep the files in bin (or Scripts) indefinitely because there are a zillion tutorials that talk about them. And having them in both places just leads to confusion. -- nosy: +eric.smith versions: -Python 3.5, Python 3.6, Python 3.7, Python 3.9 ___ Python tracker <https://bugs.python.org/issue36400> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue35960] dataclasses.field does not preserve empty metadata object
Eric V. Smith added the comment: New changeset b01786c8812c4cc24dd561b5941025bdd6f444c0 by Eric V. Smith (Christopher Hunt) in branch 'master': bpo-35960: Fix dataclasses.field throwing away empty metadata. (GH-11815) https://github.com/python/cpython/commit/b01786c8812c4cc24dd561b5941025bdd6f444c0 -- ___ Python tracker <https://bugs.python.org/issue35960> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue35960] dataclasses.field does not preserve empty metadata object
Eric V. Smith added the comment: New changeset 0a834c18cdafa5447d4436878e64aa7a4e4dc817 by Eric V. Smith (Miss Islington (bot)) in branch '3.7': bpo-35960: Fix dataclasses.field throwing away empty metadata. (GH-11815) (GH-11826) https://github.com/python/cpython/commit/0a834c18cdafa5447d4436878e64aa7a4e4dc817 -- ___ Python tracker <https://bugs.python.org/issue35960> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue35960] dataclasses.field does not preserve empty metadata object
Eric V. Smith added the comment: Thanks for the patch! -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.org/issue35960> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue35960] dataclasses.field does not preserve empty metadata object
Change by Eric V. Smith : -- assignee: -> eric.smith ___ Python tracker <https://bugs.python.org/issue35960> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue36592] is behave different for integers in 3.6 and 3.7
Eric V. Smith added the comment: Python makes no guarantee as to whether an identity test on integers would return True or False. You should not depend on the behavior in any particular version. -- nosy: +eric.smith resolution: -> not a bug stage: -> resolved status: open -> closed type: -> behavior ___ Python tracker <https://bugs.python.org/issue36592> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue36580] unittest.mock does not understand dataclasses
Eric V. Smith added the comment: I'm not sure why dataclasses would be different here: >>> import dataclasses >>> import unittest.mock >>> @dataclasses.dataclass ... class Foo: ... name: str ... baz: float ... bar: int = 12 ... >>> import inspect >>> inspect.signature(Foo) None> >>> Foo is just a normal class with a normal __init__. This is no different than if you don't use dataclasses: >>> class Bar: ... def __init__(self, name: str, baz: float, bar: int = 12) -> None: ... pass ... >>> Bar() Traceback (most recent call last): File "", line 1, in TypeError: __init__() missing 2 required positional arguments: 'name' and 'baz' >>> inspect.signature(Bar) None> >>> BarMock = unittest.mock.Mock(Bar) >>> barMock = BarMock() -- nosy: +eric.smith ___ Python tracker <https://bugs.python.org/issue36580> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue36608] Replace bundled pip and setuptools with a downloader in the ensurepip module
Eric V. Smith added the comment: And I don't mean to sound like a total downer. I just think it's important that we recognize all of the use cases. Thanks for your work on this. -- ___ Python tracker <https://bugs.python.org/issue36608> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue36608] Replace bundled pip and setuptools with a downloader in the ensurepip module
Eric V. Smith added the comment: ensurepip does not access the network, by design. We do not want it to start access the network without a lot of discussion. And if it does access the network, it will need to be able to use alternate URLs. For example: where I deploy Python, it would not have access to the URLs in your PR, but instead would need to specify a different (internal) location. This is the same reason that pip install has --find-links, --no-index, --extra-index-url, etc. I think this would need a lot of discussion (probably on distutils-sig), and probably a PEP. -- nosy: +eric.smith ___ Python tracker <https://bugs.python.org/issue36608> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue36655] Division Precision Problem
Eric V. Smith added the comment: Also see https://docs.python.org/3/tutorial/floatingpoint.html for some Python-specific details. -- nosy: +eric.smith ___ Python tracker <https://bugs.python.org/issue36655> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue36622] Inconsistent exponent notation formatting
Change by Eric V. Smith : -- nosy: +eric.smith, mark.dickinson, skrah ___ Python tracker <https://bugs.python.org/issue36622> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue37065] File and lineno is not reported for syntax error in f-string
Eric V. Smith added the comment: I'm pretty sure there's already an issue for this, but I don't have time to search for it now. This is not an easy problem to solve. I've been working on it on and off for almost a year. I'll eventually get to it, but the changes are pretty invasive. -- assignee: -> eric.smith ___ Python tracker <https://bugs.python.org/issue37065> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue37070] Clean up f-string debug handling, including potential memory leaks
New submission from Eric V. Smith : This addresses a few issues Serhiy found in the review for issue 37050 at https://github.com/python/cpython/pull/13597. Patch to follow. -- assignee: eric.smith components: Interpreter Core messages: 343722 nosy: eric.smith, serhiy.storchaka priority: normal severity: normal status: open title: Clean up f-string debug handling, including potential memory leaks type: behavior versions: Python 3.8 ___ Python tracker <https://bugs.python.org/issue37070> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue37050] Remove expr_text from ast node FormattedValue
Change by Eric V. Smith : -- keywords: +patch pull_requests: +13504 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/13597 ___ Python tracker <https://bugs.python.org/issue37050> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue37068] Emit SyntaxWarning for f-strings without expressions ?
Eric V. Smith added the comment: I think this would be better suited for a linter. -- nosy: +eric.smith ___ Python tracker <https://bugs.python.org/issue37068> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue37050] Remove expr_text from ast node FormattedValue
Eric V. Smith added the comment: New changeset 6f6ff8a56518a80da406aad6ac8364c046cc7f18 by Eric V. Smith in branch 'master': bpo-37050: Remove expr_text from FormattedValue ast node, use Constant node instead (GH-13597) https://github.com/python/cpython/commit/6f6ff8a56518a80da406aad6ac8364c046cc7f18 -- ___ Python tracker <https://bugs.python.org/issue37050> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue37050] Remove expr_text from ast node FormattedValue
Change by Eric V. Smith : -- priority: release blocker -> resolution: -> fixed stage: patch review -> resolved status: open -> closed type: -> behavior ___ Python tracker <https://bugs.python.org/issue37050> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue37003] ast unparse does not support f-string new debug format.
Eric V. Smith added the comment: mbussonn: can you re-check this in light of the changes for issue37050? I'm not sure if there's still a problem that needs fixing or not. -- ___ Python tracker <https://bugs.python.org/issue37003> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue37070] Clean up f-string debug handling, including potential memory leaks
Change by Eric V. Smith : -- keywords: +patch pull_requests: +13513 stage: -> patch review pull_request: https://github.com/python/cpython/pull/13607 ___ Python tracker <https://bugs.python.org/issue37070> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue37050] Remove expr_text from ast node FormattedValue
New submission from Eric V. Smith : I added the expr_text optional field to the FormattedValue node in order to implement the '=' feature of f-strings (see issue 36817). However, the expr_text field isn't strictly needed. Instead, the same feature could be added with another Constant string node child of the JoinedStr node. I'm going to remove expr_text and use another Constant in order to remove this change to the 3.8 ast nodes. I have a patch mostly worked out, I'll have it ready in the next day or two. I want to get this in to 3.8 beta 1, because otherwise we're stuck with the expr_text implementation. -- assignee: eric.smith components: Interpreter Core messages: 343511 nosy: eric.smith, lukasz.langa priority: release blocker severity: normal stage: needs patch status: open title: Remove expr_text from ast node FormattedValue versions: Python 3.8 ___ Python tracker <https://bugs.python.org/issue37050> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue37061] The strangest glitch I have ever seen - incorrect indenterror, even on commented out code.
Eric V. Smith added the comment: Line 41 is indented 4 spaces past line 38, but should not be. You'd be better served by first asking questions like this on the python-list mailing list. -- nosy: +eric.smith resolution: -> not a bug stage: -> resolved status: open -> closed ___ Python tracker <https://bugs.python.org/issue37061> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue35761] Allow dataclasses to be updated in place
Eric V. Smith added the comment: I'm going to reject this. There's nothing special about dataclasses that would require a feature like this. -- resolution: -> rejected stage: -> resolved status: open -> closed ___ Python tracker <https://bugs.python.org/issue35761> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue33569] dataclasses InitVar does not maintain any type info
Eric V. Smith added the comment: Thanks for the PR! -- resolution: -> fixed stage: patch review -> resolved status: open -> closed type: -> behavior ___ Python tracker <https://bugs.python.org/issue33569> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue33569] dataclasses InitVar does not maintain any type info
Eric V. Smith added the comment: New changeset 01ee12ba35a333e8a6a25c4153c4a21838e9585c by Eric V. Smith (Augusto Hack) in branch 'master': bpo-33569 Preserve type information with dataclasses.InitVar (GH-8927) https://github.com/python/cpython/commit/01ee12ba35a333e8a6a25c4153c4a21838e9585c -- ___ Python tracker <https://bugs.python.org/issue33569> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue37163] dataclasses.replace() fails with the field named "obj"
Eric V. Smith added the comment: Possibly a use for positional-only parameters. Backward compatibility is the question, of course. -- ___ Python tracker <https://bugs.python.org/issue37163> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue37106] python re.escape doesn't escape some special characters.
Eric V. Smith added the comment: Could you show a problem caused by the characters that are unescaped? I assume you're talking about the ` and ' characters, since that's what your example shows. But those aren't listed as "special characters" (https://docs.python.org/3.5/library/re.html#regular-expression-syntax), so I'm not sure what problem would be caused by them being unescaped. -- nosy: +eric.smith stage: -> test needed ___ Python tracker <https://bugs.python.org/issue37106> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue37106] python re.escape doesn't escape some special characters.
Eric V. Smith added the comment: re.escape() is designed to only escape characters that have special meaning in regular expressions. It is not a general purpose escaping mechanism, and it is especially dangerous to use it for building SQL statements. You should be using parameterized SQL queries. See https://en.wikipedia.org/wiki/SQL_injection and for example https://stackoverflow.com/questions/162/how-to-put-parameterized-sql-query-into-variable-and-then-execute-in-python In any event, it seems that re.escape() is working as designed, so I'm going to close this. -- resolution: -> not a bug stage: test needed -> resolved status: open -> closed ___ Python tracker <https://bugs.python.org/issue37106> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue37103] Undo deprecation of optparse
Change by Eric V. Smith : -- nosy: +eric.smith ___ Python tracker <https://bugs.python.org/issue37103> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue37113] 'ß'.upper() should return 'ẞ'
Eric V. Smith added the comment: See http://unicode.org/faq/casemap_charprop.html, search for "Why does ß (U+00DF LATIN SMALL LETTER SHARP S) not uppercase to U+1E9E LATIN CAPITAL LETTER SHARP S by default?" -- nosy: +eric.smith ___ Python tracker <https://bugs.python.org/issue37113> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue37184] suggesting option to raise exception if process exits nonzero in `with subprocess.Popen(...):`
Eric V. Smith added the comment: I think Popen() is just about as complex as anyone wants it to be. Is there something about .run() or .check_call() that keeps you from using them? -- nosy: +eric.smith versions: +Python 3.9 ___ Python tracker <https://bugs.python.org/issue37184> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue37184] suggesting option to raise exception if process exits nonzero in `with subprocess.Popen(...):`
Eric V. Smith added the comment: I figured as much (but didn't want to lead the witness!). I'm not completely opposed to this. I think the best thing to do is to bring up the proposal on python-ideas, and point here. -- ___ Python tracker <https://bugs.python.org/issue37184> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue37070] Clean up f-string debug handling, including potential memory leaks
Change by Eric V. Smith : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.org/issue37070> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue37070] Clean up f-string debug handling, including potential memory leaks
Eric V. Smith added the comment: New changeset f83d1dbd3bfbde940117c85f5c70de00e47b7e6e by Eric V. Smith in branch 'master': bpo-37070: Cleanup fstring debug handling (GH-13607) https://github.com/python/cpython/commit/f83d1dbd3bfbde940117c85f5c70de00e47b7e6e -- ___ Python tracker <https://bugs.python.org/issue37070> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue37086] time.sleep error message misleading
Eric V. Smith added the comment: I think it's reasonable to change the TypeError to say integer or float. That's what _PyTime_FromObject is looking for. -- nosy: +eric.smith ___ Python tracker <https://bugs.python.org/issue37086> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue37170] Wrong return value from PyLong_AsUnsignedLongLongMask on PyErr_BadInternalCall
Eric V. Smith added the comment: As ztane says, the issue isn't the -1, it's the type of the cast. This looks like a legitimate issue to me. -- nosy: +eric.smith resolution: not a bug -> stage: resolved -> patch review status: closed -> open ___ Python tracker <https://bugs.python.org/issue37170> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com