[issue40570] len(platform.uname()) has changed in Python 3.9

2020-05-13 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: Hi Jason, I think I have to review the whole set of changes again to understand what your motivation is/was. For https://bugs.python.org/issue35967 I had already stated that your use case is not special enough to make the platform.py logic more

[issue40570] len(platform.uname()) has changed in Python 3.9

2020-05-09 Thread Jason R. Coombs
Jason R. Coombs added the comment: > you added a late binding optimization for the whole uname return tuple to save the effort of ... shell access. It wasn't to save the effort and it wasn't an optimization. There was a fundamental race condition where it became impossible to implement a

[issue40570] len(platform.uname()) has changed in Python 3.9

2020-05-09 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: Ok, let me add some more context: When I wrote the uname interface I was aware that calling the API will take some resources. That's why I added the cache. IMO, that was enough as optimization. Now, you added a late binding optimization for the whole

[issue40570] len(platform.uname()) has changed in Python 3.9

2020-05-09 Thread Jason R. Coombs
Jason R. Coombs added the comment: I've gone ahead and merged PR 20015 to fix the issue, but I'm happy to revisit if a better approach is proposed. -- keywords: +3.9regression -patch resolution: -> fixed stage: patch review -> resolved status: open -> closed

[issue40570] len(platform.uname()) has changed in Python 3.9

2020-05-09 Thread Jason R. Coombs
Jason R. Coombs added the comment: New changeset 2c3d508c5fabe40dac848fb9ae558069f0576879 by Jason R. Coombs in branch 'master': bpo-40570: Improve compatibility of uname_result with late-bound .platform (#20015)

[issue40570] len(platform.uname()) has changed in Python 3.9

2020-05-09 Thread Jason R. Coombs
Jason R. Coombs added the comment: Thanks Marc-Andre for the suggestion, but I don't think that approach is viable here. The whole point of issue35967 was to defer the execution of the `.processor` behavior until it was requested. The intention is not to extend the tuple, but to shorten it

[issue40570] len(platform.uname()) has changed in Python 3.9

2020-05-09 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: Hi Jason, to achieve better backwards compatibility, it's probably better to use the approach taken for CodeInfo in the codecs.py module: class CodecInfo(tuple): """Codec details when looking up the codec registry""" def __new__(cls, encode,

[issue40570] len(platform.uname()) has changed in Python 3.9

2020-05-08 Thread Jason R. Coombs
Jason R. Coombs added the comment: Thanks David for the report and the draft PR (which helped me validate my thinking on the matter). In PR 20015, I've included additional tests. I've also re-written the compatibility functions to rely on the main `__iter__` override. Another situation

[issue40570] len(platform.uname()) has changed in Python 3.9

2020-05-08 Thread Jason R. Coombs
Change by Jason R. Coombs : -- pull_requests: +19326 pull_request: https://github.com/python/cpython/pull/20015 ___ Python tracker ___

[issue40570] len(platform.uname()) has changed in Python 3.9

2020-05-08 Thread Jason R. Coombs
Jason R. Coombs added the comment: If it is important to retain the `len`, it's probably also important to retain the `[-N]` accesses and possibly other behaviors of a length 6 tuple. -- ___ Python tracker

[issue40570] len(platform.uname()) has changed in Python 3.9

2020-05-08 Thread Jason R. Coombs
Jason R. Coombs added the comment: It was intentional to address issue35967, although it was meant to remain compatible. Is len(uname()) an important behavior to retain? It feels like an implementation detail to me. -- ___ Python tracker

[issue40570] len(platform.uname()) has changed in Python 3.9

2020-05-08 Thread Zachary Ware
Change by Zachary Ware : -- nosy: +jaraco, lemburg ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue40570] len(platform.uname()) has changed in Python 3.9

2020-05-08 Thread David Tucker
Change by David Tucker : -- keywords: +patch pull_requests: +19320 stage: -> patch review pull_request: https://github.com/python/cpython/pull/20009 ___ Python tracker ___

[issue40570] len(platform.uname()) has changed in Python 3.9

2020-05-08 Thread David Tucker
New submission from David Tucker : https://github.com/python/cpython/commit/518835f3354d6672e61c9f52348c1e4a2533ea00#diff-47c8e5750258a08a6dd9de3e9c3774acL741-R804 That diff changed len(platform.uname()) to 5 (from 6). I noticed because we have some code that checks for 6 strs (arguably