[issue41859] Uncaught ValueError

2020-09-30 Thread Patricia Timmers
Patricia Timmers added the comment: JRequest Id: 74c342d8-c8af-46fe-a488-837736590d01 Correlation Id: 79fac27b-d04d-4597-9bfd-ee7624927c4e Timestamp: 2020-10-01T04:53:13Z Message: AADSTS750054: SAMLRequest or SAMLResponse must be present as query string parameters in HTTP request for SAML Redi

[issue41870] Use PEP 590 vectorcall to speed up calls to bool()

2020-09-30 Thread Dong-hee Na
Dong-hee Na added the comment: Now the suggestion is applied! Thank you Pablo and Victor!!! -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker

[issue41870] Use PEP 590 vectorcall to speed up calls to bool()

2020-09-30 Thread Dong-hee Na
Dong-hee Na added the comment: New changeset fa7ce080175f65d678a7d5756c94f82887fc9803 by Dong-hee Na in branch 'master': bpo-41870: Avoid the test when nargs=0 (GH-22462) https://github.com/python/cpython/commit/fa7ce080175f65d678a7d5756c94f82887fc9803 -- __

[issue41899] Poor example for Element.remove()

2020-09-30 Thread WoodyWoo
WoodyWoo added the comment: Could I say the mutable sequence containing not the object but the pointer like C++. So they can changed in def functions. -- ___ Python tracker _

[issue41859] Uncaught ValueError

2020-09-30 Thread Raymond Hettinger
Raymond Hettinger added the comment: I don't have a reproducer. The event occurred one in a full-day session. I don't get a completion box. -- ___ Python tracker ___ ___

[issue41892] use both "for in" and "ElementTree.remove" has a index bug

2020-09-30 Thread WoodyWoo
WoodyWoo added the comment: @eric.smith @scoder @serhiy.storchaka Thank U all. I get what to do,and still think the "for in" structure should rebuilding. All three methods: import xml.etree.ElementTree as ET xmlstr=\ r''' 2 2008 141100

[issue36255] Provide a simple way to delete and edit python's welcome message

2020-09-30 Thread Raymond Hettinger
Change by Raymond Hettinger : -- stage: -> resolved status: open -> closed ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue41899] Poor example for Element.remove()

2020-09-30 Thread Eric V. Smith
Eric V. Smith added the comment: As you've seen, the example is correct. I made the same mistake earlier today. For others: see also #41891 for a suggestion to improve the documentation. As was pointed out in that issue, it's generally true in Python that you should not mutate a sequence whi

[issue41899] Poor example for Element.remove()

2020-09-30 Thread WoodyWoo
WoodyWoo added the comment: The docs should specially tell that when need root.remove(child) must works with "for child in root.findall()". And my code with "while if continue" could make root.insert(index,newchild) easily. -- ___ Python tracker

[issue41899] Poor example for Element.remove()

2020-09-30 Thread WoodyWoo
WoodyWoo added the comment: My fault. "for country in root.findall('country')“ is not working as same as "for country in root" all 3 method below: import xml.etree.ElementTree as ET xmlstr=\ r''' 2 2008 141100 5 2011

[issue41899] Poor example for Element.remove()

2020-09-30 Thread WoodyWoo
WoodyWoo added the comment: #new code to avoid an err index=0 count=len(root.findall("./*")) while index 50: root.remove(root[index]) index=index+0 count=count-1 # avoid index err continue index=index+1 -- ___ Py

[issue37294] concurrent.futures.ProcessPoolExecutor state=finished raised error

2020-09-30 Thread Kyle Stanley
Kyle Stanley added the comment: DanilZ, could you take a look at the superseding issue (https://bugs.python.org/issue37297) and see if your exception raised within the job is the same? If it's not, I would suggest opening a separate issue (and linking to it in a comment here), as I don't

[issue41703] Most bytecode changes are absent from Python 3.9 What's new

2020-09-30 Thread Matthieu Dartiailh
Matthieu Dartiailh added the comment: Looking at the current version of the page https://docs.python.org/3.9/whatsnew/3.9.html#cpython-bytecode-changes I still see only the LOAD_ASSERTION_ERROR. It seems the changelog got updated but not the What's new -- __

[issue41899] Poor example for Element.remove()

2020-09-30 Thread WoodyWoo
New submission from WoodyWoo : We can remove elements using Element.remove(). Let’s say we want to remove all countries with a rank higher than 50: >>> >>> for country in root.findall('country'): ... rank = int(country.find('rank').text) ... if rank > 50: ... root.remove(country

[issue41892] use both "for in" and "ElementTree.remove" has a index bug

2020-09-30 Thread WoodyWoo
WoodyWoo added the comment: I think "for each in list" should not work by index,but should work by pointer like thing,could be a list of pointers. When the "for each in list" was acting,the pointers list would be fixed,and you need not to worry about the "list" changing. --

[issue36255] Provide a simple way to delete and edit python's welcome message

2020-09-30 Thread Irit Katriel
Irit Katriel added the comment: Raymond, I think you intended to close this but missed a click. -- ___ Python tracker ___ ___ Pytho

[issue41887] ast.literal_eval does not accept strings with leading whitespaces

2020-09-30 Thread Batuhan Taskaya
Change by Batuhan Taskaya : -- keywords: +patch pull_requests: +21492 stage: -> patch review pull_request: https://github.com/python/cpython/pull/22469 ___ Python tracker ___

[issue41887] ast.literal_eval does not accept strings with leading whitespaces

2020-09-30 Thread Guido van Rossum
Guido van Rossum added the comment: Hm, I'm not sure. ast.literal_eval() does accept trailing whitespace, and embedded whitespace. ``` >>> ast.literal_eval("- ( 1\n)\n") -1 >>> ``` So I think it should start accepting leading whitespace too (but only in a feature release, so 3.10). --

[issue41897] ast.parse in Python 3.9 does not produce SyntaxError for assignment to __debug__

2020-09-30 Thread Guido van Rossum
Guido van Rossum added the comment: We moved the check from the parser to the bytecode compiler. I don't think this should be a problem. Kudos for noticing though! :-) ``` >>> compile("__debug__ = 1", "", "exec") Traceback (most recent call last): File "", line 1, in File "", line 1 Synt

[issue41887] ast.literal_eval does not accept strings with leading whitespaces

2020-09-30 Thread Raymond Hettinger
Change by Raymond Hettinger : -- nosy: +gvanrossum ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://ma

[issue41895] PyMethodDef does NOT have any fields contain context in embedded C

2020-09-30 Thread dexter
dexter added the comment: for example, there are some of shared libs, all these libs have a function named getList() exported. and getList() will return a list of names which also as a function name been exported. shared lib A export getList() -> return ["aaa", "bbb"] export aaa() export bbb

[issue41897] ast.parse in Python 3.9 does not produce SyntaxError for assignment to __debug__

2020-09-30 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- nosy: +BTaskaya, gvanrossum, pablogsal ___ Python tracker ___ ___ Python-bugs-list mailing list Unsu

[issue41898] Any logging causes assertLogs to pass

2020-09-30 Thread Troy Daniels
New submission from Troy Daniels : The following test code unexpectedly passes. import logging import unittest LOG_FORMAT = '%(levelname)-10s %(asctime)s: %(message)s' def set_up_logger(app_name, level=logging.INFO, file="test.log"): formatter = logging.Formatter(LOG_FORMAT) log = lo

[issue41895] PyMethodDef does NOT have any fields contain context in embedded C

2020-09-30 Thread dexter
Change by dexter : -- title: PyMethodDef does NOT have any field contains context in embedded C -> PyMethodDef does NOT have any fields contain context in embedded C ___ Python tracker __

[issue31256] xml.etree.ElementTree: add support for doctype in tostring method

2020-09-30 Thread Irit Katriel
Irit Katriel added the comment: It looks like PR 12225 resolved this issue. Can this be closed then? -- nosy: +iritkatriel ___ Python tracker ___ _

[issue41897] ast.parse in Python 3.9 does not produce SyntaxError for assignment to __debug__

2020-09-30 Thread Saiyang Gou
New submission from Saiyang Gou : ast.parse in Python 3.9 does not produce SyntaxError for assignment to __debug__: ``` >>> import ast >>> ast.dump(ast.parse('__debug__ = 0')) "Module(body=[Assign(targets=[Name(id='__debug__', ctx=Store())], value=Constant(value=0))], type_ignores=[])" >>> ex

[issue41896] Moving index with wordstart expression includes non-alphanumberic and underline characters if word is tagged and iat the edge of a text widget

2020-09-30 Thread Tama-kun
New submission from Tama-kun : This issue occurs when using the current mouse position from an event and the wordstart expression to find the index of the start of a clicked word on a text widget and the indices for the clicked word are tagged. If there's a single non-alphanumberic and underl

[issue15877] xml.dom.minidom cannot parse ISO-2022-JP

2020-09-30 Thread Irit Katriel
Irit Katriel added the comment: I don't see this problem on 3.10. Is this still an issue or can this issue be closed? Running Release|Win32 interpreter... Python 3.10.0a0 (heads/bpo17490-dirty:00eb063b66, Sep 27 2020, 13:20:24) [MSC v.1916 32 bit (Intel)] on win32 Type "help", "copyright",

[issue41894] UnicodeDecodeError during load failure in non-UTF-8 locale

2020-09-30 Thread Kevin
Change by Kevin : -- keywords: +patch pull_requests: +21490 stage: -> patch review pull_request: https://github.com/python/cpython/pull/22466 ___ Python tracker ___ __

[issue41895] PyMethodDef does NOT have any field contains context in embedded C

2020-09-30 Thread dexter
New submission from dexter : I am trying to create app embedded python as interpreter, and I use PyImport_AppendInittab to import some helper functions to python. on website the example is excellent when you already know how many functions we want to import. but when my functions are based on

[issue41894] UnicodeDecodeError during load failure in non-UTF-8 locale

2020-09-30 Thread Kevin
New submission from Kevin : If a native module fails to load, the dynload code will call PyUnicode_FromString on the error message to give back to the user. This can cause a UnicodeDecodeError if the locale is not a UTF-8 locale and the error message contains non-ASCII code points. While Linu

[issue41893] remove() method is not working as expected(Hard to explain)

2020-09-30 Thread Eric V. Smith
Change by Eric V. Smith : -- resolution: -> not a bug stage: -> resolved status: open -> closed type: -> behavior ___ Python tracker ___

[issue41883] ctypes pointee goes out of scope, then pointer in struct dangles and crashes

2020-09-30 Thread Ian M. Hoffman
Ian M. Hoffman added the comment: I agree with you. When I wrote "desired behavior" I intended it to mean "my selfishly desired outcome of not loading my struct with a dangling pointer." This issue seems to have descended into workarounds that treat the symptoms; I'm all for treating the cau

[issue41887] ast.literal_eval does not accept strings with leading whitespaces

2020-09-30 Thread Batuhan Taskaya
Batuhan Taskaya added the comment: Looks like skipping the leading whitespace is an undocumented behavior for eval() introduced back in 1992 (f08ab0ad158f88f05dd923b129d2397e1882be14). I don't think that bringing it to the literal_eval is a good idea, at least after this much of a time. If s

[issue41893] remove() method is not working as expected(Hard to explain)

2020-09-30 Thread Ben
Ben added the comment: See the note in https://docs.python.org/3.7/reference/compound_stmts.html#the-for-statement "There is a subtlety when the sequence is being modified by the loop ..." Since your code is mutating the all_fields list as you iterate it, you get the " next item will be s

[issue41889] enum: Mixin and int base class regression in 3.8.6

2020-09-30 Thread William Pickard
William Pickard added the comment: Actually, this is an issue with native types in general that define a 'tp_new' slot value ('!= NULL'). -- nosy: +WildCard65 ___ Python tracker

[issue41887] ast.literal_eval does not accept strings with leading whitespaces

2020-09-30 Thread Batuhan Taskaya
Change by Batuhan Taskaya : -- nosy: +BTaskaya ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.p

[issue41893] remove() method is not working as expected(Hard to explain)

2020-09-30 Thread pushpam kumar
New submission from pushpam kumar : I am not able to understand why "password" word is not removed by remove() method -- components: Interpreter Core files: testtt.py messages: 377708 nosy: ctf.challenge.pushpam priority: normal severity: normal status: open title: remove() method is n

[issue41892] use both "for in" and "ElementTree.remove" has a index bug

2020-09-30 Thread Stefan Behnel
Stefan Behnel added the comment: @WoodyWoo, you can (and should) do something like this: for ELEMchild in list(etroot): Modifying a container while iterating over it is usually not a good idea. The same applies to Python lists and dicts, for example. -- stage: patch review ->

[issue41892] use both "for in" and "ElementTree.remove" has a index bug

2020-09-30 Thread Stefan Behnel
Change by Stefan Behnel : -- stage: -> patch review ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://

[issue41892] use both "for in" and "ElementTree.remove" has a index bug

2020-09-30 Thread Stefan Behnel
Change by Stefan Behnel : -- keywords: +patch pull_requests: +21489 stage: -> patch review pull_request: https://github.com/python/cpython/pull/22464 ___ Python tracker ___ __

[issue41892] use both "for in" and "ElementTree.remove" has a index bug

2020-09-30 Thread Eric V. Smith
Eric V. Smith added the comment: The example is iterating over the list returned by root.findall(), but removing from a different data structure in root, so it won't have a problem. -- ___ Python tracker __

[issue41892] use both "for in" and "ElementTree.remove" has a index bug

2020-09-30 Thread WoodyWoo
WoodyWoo added the comment: Only that makes "for each in list" literally. -- ___ Python tracker ___ ___ Python-bugs-list mailing li

[issue41892] use both "for in" and "ElementTree.remove" has a index bug

2020-09-30 Thread WoodyWoo
WoodyWoo added the comment: I'm green hand in Coding. But I think the problem caused by "for each in list". Anything changed in "list" should not act at once,but should act when "for end" or break. -- ___ Python tracker

[issue41892] use both "for in" and "ElementTree.remove" has a index bug

2020-09-30 Thread Eric V. Smith
Eric V. Smith added the comment: Ah, good point. I agree the example should make that clear. And I think a note in .remove() about using it while iterating would be a good idea, too. -- ___ Python tracker _

[issue41892] use both "for in" and "ElementTree.remove" has a index bug

2020-09-30 Thread Stefan Behnel
Stefan Behnel added the comment: > That example is especially problematic. No, it's not. It uses .findall(), which returns a list. It's like when you make a copy of a list to iterate over, when you want to modify the original list in the loop. That could be made explicit in the text that in

[issue41892] use both "for in" and "ElementTree.remove" has a index bug

2020-09-30 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- assignee: -> docs@python components: +Documentation nosy: +docs@python, eli.bendersky, scoder ___ Python tracker ___ __

[issue41892] use both "for in" and "ElementTree.remove" has a index bug

2020-09-30 Thread Eric V. Smith
Eric V. Smith added the comment: I think the only action here is to improve the documentation. That example is especially problematic. -- ___ Python tracker ___ _

[issue41892] use both "for in" and "ElementTree.remove" has a index bug

2020-09-30 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: You will get the same behavior for lists: >>> a = [1, 2, 3] >>> for x in a: ... if x == 1: ... a.remove(x) ... print(x) ... 1 3 Lists are iterated by index. First you get an item at index 0, then at index 1, etc, to the end of the list. In

[issue41892] use both "for in" and "ElementTree.remove" has a index bug

2020-09-30 Thread Eric V. Smith
Eric V. Smith added the comment: I assume that ElementTree doesn't support mutation while iterating. However, the docs at https://docs.python.org/3/library/xml.etree.elementtree.html#modifying-an-xml-file show removing an item while iterating. It probably only works because the child being

[issue41892] use both "for in" and "ElementTree.remove" has a index bug

2020-09-30 Thread WoodyWoo
Change by WoodyWoo : -- title: use both "for" and "ElementTree.remove" has a index bug -> use both "for in" and "ElementTree.remove" has a index bug ___ Python tracker ___ ___

[issue41892] use both "for" and "ElementTree.remove" has a index bug

2020-09-30 Thread WoodyWoo
New submission from WoodyWoo : #Just run it in Python v3.8.6 of win7 32bit import xml.etree.ElementTree as ET xmlstr=''' ''' etroot = ET.fromstring(xmlstr) for ELEMchild in etroot: if ELEMchild.get("no") == "1" : etroot.remove(ELEMchild) #so far so good print (ELEMchil

[issue41870] Use PEP 590 vectorcall to speed up calls to bool()

2020-09-30 Thread Dong-hee Na
Change by Dong-hee Na : -- pull_requests: +21488 pull_request: https://github.com/python/cpython/pull/22462 ___ Python tracker ___ _

[issue41870] Use PEP 590 vectorcall to speed up calls to bool()

2020-09-30 Thread Dong-hee Na
Change by Dong-hee Na : -- pull_requests: -21486 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mai

[issue41890] crypt produces wrong hashes for passwords containing newline character

2020-09-30 Thread Hazem Amara
Hazem Amara added the comment: Thanks for your answer :) -- stage: -> resolved status: open -> closed ___ Python tracker ___ ___ P

[issue41890] crypt produces wrong hashes for passwords containing newline character

2020-09-30 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: For openssl and mkpasswd the password does not contain the newline character. It contains a pair of characters "\" and "n". And the crypt module produces the same output for it: $ python3 -c 'import crypt; print(crypt.crypt(r"password\n","$6$saltySalt"))'

[issue41891] asyncio.wait_for does not wait for task/future to be completed in all cases

2020-09-30 Thread Richard Kojedzinszky
Change by Richard Kojedzinszky : -- keywords: +patch pull_requests: +21487 stage: -> patch review pull_request: https://github.com/python/cpython/pull/22461 ___ Python tracker ___

[issue41891] asyncio.wait_for does not wait for task/future to be completed in all cases

2020-09-30 Thread Richard Kojedzinszky
New submission from Richard Kojedzinszky : This code should run without errors: ``` #!/usr/bin/env python import asyncio async def task1(): cv = asyncio.Condition() async with cv: await asyncio.wait_for(cv.wait(), 10) async def main(loop): task = loop.create_task(task1()

[issue41890] crypt produces wrong hashes for passwords containing newline character

2020-09-30 Thread Hazem Amara
Change by Hazem Amara : -- type: -> behavior ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.py

[issue41890] crypt produces wrong hashes for passwords containing newline character

2020-09-30 Thread Hazem Amara
New submission from Hazem Amara : I am having an issue with crypt library (Lib/crypt.py) when hashing passwords containing \n character. I am using python 3.8.2 on Linux. To compare hashed passwords produced by crypt, I used openssl and mkpasswd utilities. When generating hashes for passwor

[issue23706] pathlib.Path.write_text should include a newline argument

2020-09-30 Thread Maxim Burov
Maxim Burov added the comment: CLA signed now and PR is ready :) -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubs