Re: Friday Finking: Source code organisation

2020-01-01 Thread Cameron Simpson
On 02Jan2020 18:01, DL Neil wrote: On 29/12/19 5:49 PM, Cameron Simpson wrote: For main, i have the opposite habit. If a module has a main() function for command line use I usually want that right up the front:  #!/usr/bin/env python3    import...  def main(argv=None):    ... main

Re: Python, Be Bold!

2020-01-01 Thread Abdur-Rahmaan Janhangeer
if not self-updating, at least the ability to update Yours, Abdur-Rahmaan Janhangeer pythonmembers.club | github Mauritius -- https://mail.python.org/mailman/listinfo/python-list

[issue39187] urllib.robotparser does not respect the longest match for the rule

2020-01-01 Thread Andre Burgaud
Andre Burgaud added the comment: During testing identified a related issue that is fixed by the same sort function implemented to address the longest match rule. This related problem also addressed by this change takes into account the situation when 2 equivalent rules (same path for allow

[issue36051] Drop the GIL during large bytes.join operations?

2020-01-01 Thread Inada Naoki
Inada Naoki added the comment: > In the single-threaded case, the benchmark seems to show that for 64K+, > performance is improved by dropping the GIL (which I'm guessing must be > statistical noise, since there shouldn't be anything contending for it), > which is my reasoning behind the

[issue39187] urllib.robotparser does not respect the longest match for the rule

2020-01-01 Thread Andre Burgaud
Change by Andre Burgaud : -- keywords: +patch pull_requests: +17227 stage: -> patch review pull_request: https://github.com/python/cpython/pull/17794 ___ Python tracker ___

[issue16399] argparse: append action with default list adds to list instead of overriding

2020-01-01 Thread hai shi
Change by hai shi : -- pull_requests: +17226 stage: -> patch review pull_request: https://github.com/python/cpython/pull/17793 ___ Python tracker ___

Re: Friday Finking: Source code organisation

2020-01-01 Thread DL Neil via Python-list
On 29/12/19 5:49 PM, Cameron Simpson wrote: On 29Dec2019 09:49, Chris Angelico wrote: "Define before use" is a broad principle that I try to follow, even when the code itself doesn't mandate this. This generally means that "if name is main" is the very last thing in the file, and if there's a

[issue1820] Enhance Object/structseq.c to match namedtuple and tuple api

2020-01-01 Thread Raymond Hettinger
Change by Raymond Hettinger : -- versions: +Python 3.9 -Python 3.7 ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue39187] urllib.robotparser does not respect the longest match for the rule

2020-01-01 Thread Andre Burgaud
New submission from Andre Burgaud : As per the current Robots Exclusion Protocol internet draft, https://tools.ietf.org/html/draft-koster-rep-00#section-3.2. a robot should apply the rules respecting the longest match. urllib.robotparser relies on the order of the rules in the robots.txt

[issue35457] robotparser reads empty robots.txt file as "all denied"

2020-01-01 Thread Andre Burgaud
Andre Burgaud added the comment: Hi, Is this ticket still relevant for Python 3.8? While running some tests with an empty robotstxt file I realized that it was returning "ALLOWED" for any path (as per the current draft of the Robots Exclusion Protocol:

Re: Front end

2020-01-01 Thread James Lu
I would use software like Airtable. You set the columns, Airtable produces a type-checked form. Every spreadsheet also comes with its own API, so you can exfiltrate the data programmatically easily. On Sat, Dec 28, 2019, 10:36 L A Smit wrote: > Hi > > Don't know if this is the correct subject

[issue39186] Windows installer instructions refer to mercurial

2020-01-01 Thread anthony shaw
New submission from anthony shaw : Very minor, but the instructions in Tools/msi/readme.txt tell the user to ensure hg.exe is in PATH, but the scripts use Git. -- components: Windows messages: 359179 nosy: anthonypjshaw, paul.moore, steve.dower, tim.golden, zach.ware priority: normal

[issue39186] Windows installer instructions refer to mercurial

2020-01-01 Thread anthony shaw
Change by anthony shaw : -- keywords: +patch pull_requests: +17225 stage: -> patch review pull_request: https://github.com/python/cpython/pull/17792 ___ Python tracker ___

[issue39185] Add quiet and detailed verbosity levels to build.bat

2020-01-01 Thread anthony shaw
Change by anthony shaw : -- keywords: +patch pull_requests: +17224 stage: -> patch review pull_request: https://github.com/python/cpython/pull/17791 ___ Python tracker ___

[issue39185] Add quiet and detailed verbosity levels to build.bat

2020-01-01 Thread anthony shaw
New submission from anthony shaw : The build.bat script (windows build) has a flag for verbose, which sets the msbuild verbosity level to normal. The default level is minimal. The quiet and detailed levels would also be useful for development. -- components: Windows messages: 359178

Re: Does the argparse generate a wrong help message?

2020-01-01 Thread jfong
Random832於 2020年1月2日星期四 UTC+8上午5時04分36秒寫道: > On Fri, Dec 27, 2019, at 23:08, jf...@ms4.hinet.net wrote: > > > > optional arguments: > > > > -h, --help show this help message and exit > > > > --foo [FOO] foo help > > > > --goo GOOgoo help > > > > > > > > D:\Works\Python>py test.py

[issue15795] Zipfile.extractall does not preserve file permissions

2020-01-01 Thread Roundup Robot
Change by Roundup Robot : -- pull_requests: +17223 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/17790 ___ Python tracker ___

[issue39184] Many command execution functions are not raising auditing events

2020-01-01 Thread STINNER Victor
Change by STINNER Victor : -- nosy: +steve.dower ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue39184] Many command execution functions are not raising auditing events

2020-01-01 Thread Saiyang Gou
New submission from Saiyang Gou : Similar to `os.system` (which is already raising auditing event), the following functions are also capable of command execution, so they also need auditing: - os.execl - os.execle - os.execlp - os.execlpe - os.execv - os.execve - os.execvp - os.execvpe -

[issue27973] urllib.urlretrieve() fails on second ftp transfer

2020-01-01 Thread David Bolen
David Bolen added the comment: The issue appears to be the temporary flag (O_TEMPORARY) that is used under Windows with delete on close temporary files. That appears to prevent any separate access to the file by anyone else including obtaining another reference in the same process: >>>

[issue39183] Text divided in two strings due to wrong formatting

2020-01-01 Thread miss-islington
miss-islington added the comment: New changeset 6bf382ac9a07f42c6f91f35a7f0df4c63e35a8a7 by Miss Islington (bot) in branch '3.8': bpo-39183: Fix formatting in library/ensurepip (GH-17787) https://github.com/python/cpython/commit/6bf382ac9a07f42c6f91f35a7f0df4c63e35a8a7 --

[issue39183] Text divided in two strings due to wrong formatting

2020-01-01 Thread miss-islington
miss-islington added the comment: New changeset 3959638ba1b1e25c25a2da880aba78fd53dd947f by Miss Islington (bot) in branch '3.7': bpo-39183: Fix formatting in library/ensurepip (GH-17787) https://github.com/python/cpython/commit/3959638ba1b1e25c25a2da880aba78fd53dd947f --

[issue39183] Text divided in two strings due to wrong formatting

2020-01-01 Thread miss-islington
Change by miss-islington : -- pull_requests: +17221 pull_request: https://github.com/python/cpython/pull/17788 ___ Python tracker ___

[issue39183] Text divided in two strings due to wrong formatting

2020-01-01 Thread miss-islington
miss-islington added the comment: New changeset 149175c6dfc8455023e4335575f3fe3d606729f9 by Miss Islington (bot) (Rafael Fontenelle) in branch 'master': bpo-39183: Fix formatting in library/ensurepip (GH-17787) https://github.com/python/cpython/commit/149175c6dfc8455023e4335575f3fe3d606729f9

[issue39183] Text divided in two strings due to wrong formatting

2020-01-01 Thread miss-islington
Change by miss-islington : -- pull_requests: +17222 pull_request: https://github.com/python/cpython/pull/17789 ___ Python tracker ___

[issue13601] sys.stderr should be line-buffered when stderr is not a TTY

2020-01-01 Thread Antoine Pitrou
Antoine Pitrou added the comment: Jendrik, thank you for fixing this! -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___

[issue13601] sys.stderr should be line-buffered when stderr is not a TTY

2020-01-01 Thread Antoine Pitrou
Antoine Pitrou added the comment: New changeset 5b9077134cd0535f21905d5f5195847526cac99c by Antoine Pitrou (Jendrik Seipp) in branch 'master': bpo-13601: always use line-buffering for sys.stderr (GH-17646) https://github.com/python/cpython/commit/5b9077134cd0535f21905d5f5195847526cac99c

[issue39183] Text divided in two strings due to wrong formatting

2020-01-01 Thread Roundup Robot
Change by Roundup Robot : -- keywords: +patch pull_requests: +17219 stage: -> patch review pull_request: https://github.com/python/cpython/pull/17787 ___ Python tracker ___

[issue39183] Text divided in two strings due to wrong formatting

2020-01-01 Thread Rafael Fontenelle
New submission from Rafael Fontenelle : When translating Python docs, the 'library/ensurepip' module [1] has an bullet list where one item's text is split in two due to a simple extra whitespace character. This causes two separated translations strings "``--default-pip``: if a \"default

[issue38879] Reordered error checking in PyArena_New().

2020-01-01 Thread Antoine Pitrou
Antoine Pitrou added the comment: I'm rejecting this, as explained on the Github PR. -- nosy: +pitrou resolution: -> not a bug stage: -> resolved status: open -> closed ___ Python tracker

Re: Does the argparse generate a wrong help message?

2020-01-01 Thread Random832
On Fri, Dec 27, 2019, at 23:08, jf...@ms4.hinet.net wrote: > > > optional arguments: > > > -h, --help show this help message and exit > > > --foo [FOO] foo help > > > --goo GOOgoo help > > > > > > D:\Works\Python>py test.py --foo 1 --goo 2 > > > 1 ['2'] > > So the square bracket means

[issue39142] logging.config.dictConfig will convert namedtuple to ConvertingTuple

2020-01-01 Thread Vinay Sajip
Change by Vinay Sajip : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___ ___

[issue39142] logging.config.dictConfig will convert namedtuple to ConvertingTuple

2020-01-01 Thread Vinay Sajip
Vinay Sajip added the comment: New changeset 0e0e4acaabdcf8efb60cf75f08301022ac4422a4 by Vinay Sajip (Miss Islington (bot)) in branch '3.7': bpo-39142: Avoid converting namedtuple instances to ConvertingTuple. (GH-17773) (GH-17786)

[issue39142] logging.config.dictConfig will convert namedtuple to ConvertingTuple

2020-01-01 Thread Vinay Sajip
Vinay Sajip added the comment: New changeset 1d5a7e5694bd9104f56f4f28357c2d13afd58a29 by Vinay Sajip (Miss Islington (bot)) in branch '3.8': bpo-39142: Avoid converting namedtuple instances to ConvertingTuple. (GH-17773) (GH-17785)

[issue39142] logging.config.dictConfig will convert namedtuple to ConvertingTuple

2020-01-01 Thread miss-islington
Change by miss-islington : -- pull_requests: +17217 pull_request: https://github.com/python/cpython/pull/17785 ___ Python tracker ___

[issue39142] logging.config.dictConfig will convert namedtuple to ConvertingTuple

2020-01-01 Thread miss-islington
Change by miss-islington : -- pull_requests: +17218 pull_request: https://github.com/python/cpython/pull/17786 ___ Python tracker ___

[issue39142] logging.config.dictConfig will convert namedtuple to ConvertingTuple

2020-01-01 Thread Vinay Sajip
Vinay Sajip added the comment: New changeset 46abfc1416ff8e450999611ef8f231ff871ab133 by Vinay Sajip in branch 'master': bpo-39142: Avoid converting namedtuple instances to ConvertingTuple. (GH-17773) https://github.com/python/cpython/commit/46abfc1416ff8e450999611ef8f231ff871ab133

[issue39182] sys.addaudithook(hook) loops indefinitely on mismatch for hook

2020-01-01 Thread Karthikeyan Singaravelan
Change by Karthikeyan Singaravelan : -- nosy: +christian.heimes, steve.dower ___ Python tracker ___ ___ Python-bugs-list mailing

[ANN] ppci 0.5.7

2020-01-01 Thread Windel Bouwman
Hello all! I'am pleased to announce release 0.5.7 of ppci. What is ppci? The PPCI (Pure Python Compiler Infrastructure) project is a compiler written entirely in the Python programming language. It contains front-ends for various programming languages as well

NumPy 1.17.5 Released

2020-01-01 Thread Charles R Harris
Hi All, On behalf of the NumPy team I am pleased to announce that NumPy 1.17.5 has been released. This release fixes bugs reported against the 1.17.4 release. The supported Python versions are 3.5-3.7. This is the last planned release that supports Python 3.5. Wheels for this release can be

[issue39134] can't construct dataclass as ABC (or runtime check as data protocol)

2020-01-01 Thread Guido van Rossum
Guido van Rossum added the comment: Try adding a setter to the base class method. -- ___ Python tracker ___ ___ Python-bugs-list

[issue39182] sys.addaudithook(hook) loops indefinitely on mismatch for hook

2020-01-01 Thread Dutcho
New submission from Dutcho : When hook is not a compatible callable, addaudithook() will loop forever. At the minimum, a check for being callable should be executed. Preferably, a non-compatible (i.e. signature != [[str, tuple], Any]) hook callable should also be detected. >py Python 3.8.1

[issue39134] can't construct dataclass as ABC (or runtime check as data protocol)

2020-01-01 Thread Alexander Hirner
Alexander Hirner added the comment: Dropping ABCMeta stops at instantiation. This should be in the dataclass code that's been generated. File "", line 2, in __init__ AttributeError: can't set attribute Repro: ``` class QuasiABC: @property @abstractmethod def x(self) -> int:

[issue39181] Add `os.makedirs()` as `Path.mkdir()` equivalent in correspondence table

2020-01-01 Thread jack1142
New submission from jack1142 : https://github.com/python/cpython/blob/3.7/Doc/library/pathlib.rst#correspondence-to-tools-in-the-modos-module The table mapping `os` functions to `Path`'s equivalents is missing `os.makedirs` in the row with `Path.mkdir()` and they are both equivalent when

[issue39178] Should we make dict not accept a sequence of sets?

2020-01-01 Thread Steven D'Aprano
Steven D'Aprano added the comment: "should dict preemptively make sure it doesn't accept a sequence of sets" No. The person on StackOverflow made a mistake in their code: they used an unordered data structure (set) instead of an ordered data structure (tuple): dict({i,j} for i,j in

[issue39180] Missing getlines func documentation from linecache module

2020-01-01 Thread Khalid Mammadov
Change by Khalid Mammadov : -- keywords: +patch pull_requests: +17216 stage: -> patch review pull_request: https://github.com/python/cpython/pull/17784 ___ Python tracker ___

[issue39165] Completeness and symmetry in RE, avoid `findall(...)[0]`

2020-01-01 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: This was discussed recently on the Python-ideas mailing list. https://mail.python.org/archives/list/python-id...@python.org/thread/M2OZCN5C26YUJJ4EXLIIXHQBGF6IM5GW/#H3GURL35C7AZ3ZBK6CQZGGCISUZ42WDV I agree with Raymond that this is an education problem.

[issue35561] Valgrind reports Syscall param epoll_ctl(event) points to uninitialised byte(s)

2020-01-01 Thread Zackery Spytz
Change by Zackery Spytz : -- nosy: +ZackerySpytz versions: +Python 3.9 ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue35561] Valgrind reports Syscall param epoll_ctl(event) points to uninitialised byte(s)

2020-01-01 Thread Zackery Spytz
Change by Zackery Spytz : -- keywords: +patch pull_requests: +17215 stage: -> patch review pull_request: https://github.com/python/cpython/pull/17782 ___ Python tracker ___

[issue39180] Missing getlines func documentation from linecache module

2020-01-01 Thread Karthikeyan Singaravelan
New submission from Karthikeyan Singaravelan : As a note getlines is not exposed via __all__ : https://github.com/python/cpython/blob/22424c02e51fab3b62cbe255d0b87d1b55b9a6c3/Lib/linecache.py#L13 -- nosy: +xtreak ___ Python tracker

[issue39179] pandas tz_convert() seems to report incorrect date conversion

2020-01-01 Thread Karthikeyan Singaravelan
Karthikeyan Singaravelan added the comment: This tracker is for issues related to CPython. Unless there is a simple reproducer in Python without pandas to illustrate the issues reported I would propose closing this as third party. Please follow this up at

[issue39180] Missing getlines func documentation from linecache module

2020-01-01 Thread Khalid Mammadov
Change by Khalid Mammadov : -- assignee: docs@python components: Documentation nosy: docs@python, khalidmammadov priority: normal severity: normal status: open title: Missing getlines func documentation from linecache module versions: Python 3.8 ___

[issue39178] Should we make dict not accept a sequence of sets?

2020-01-01 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: This is a very special case. I think it is better to leave it to third-party linters. Actually it is so uncommon, that I have doubts that even linters will want to handle it. -- nosy: +serhiy.storchaka ___

[issue39179] pandas tz_convert() seems to report incorrect date conversion

2020-01-01 Thread seeking.that
New submission from seeking.that : Hi python pandas bdate_range tz_convert() seems to have problems as it prints the information incorrectly. Please clarity. The python script and the output is shown below: Two issues that can be highlighted here are: 1) Setting the timezone correctly to

[issue39178] Should we make dict not accept a sequence of sets?

2020-01-01 Thread Karthikeyan Singaravelan
Change by Karthikeyan Singaravelan : -- nosy: +inada.naoki, rhettinger ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue39178] Should we make dict not accept a sequence of sets?

2020-01-01 Thread Adi
New submission from Adi : While writing this SO answer (https://stackoverflow.com/a/59552970/1453822) I came to think, should dict preemptively make sure it doesn't accept a sequence of sets (given that it may lead to wrong output in the good case, and miserably fail in the worst case)?

[issue39166] Python 3.9.0a2 changed how "async for" traces its final iteration

2020-01-01 Thread Karthikeyan Singaravelan
Karthikeyan Singaravelan added the comment: Bisecting points me to fee552669f . I tried compiling latest master with the bytecode changes and the behavior is same as reported. ➜ cpython git:(5dcc06f6e0) ./python ../backups/bpo39166.py > fee552669f_before.txt ➜ cpython git:(5dcc06f6e0) ✗

Re: Python, Be Bold!

2020-01-01 Thread o1bigtenor
On Wed, Jan 1, 2020 at 1:24 AM Abdur-Rahmaan Janhangeer wrote: > > Greetings list, > > I wanted to make some suggestion about the Python interpreter but since > it's more high-level, i decided to post it here instead of python-ideas. > > Well, concerning distributing Python apps, a natural way is

[issue39165] Completeness and symmetry in RE, avoid `findall(...)[0]`

2020-01-01 Thread Juancarlo Añez
Juancarlo Añez added the comment: The discussion on python-ideas favored the inclusion of `findfirst()`. At any rate, not having a generator version of `findall()` is an important omission. Another user's search of Github public repositories found that `findall(...)[0]` is prevalent.

[issue1820] Enhance Object/structseq.c to match namedtuple and tuple api

2020-01-01 Thread Karthikeyan Singaravelan
Change by Karthikeyan Singaravelan : -- pull_requests: -17214 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue39166] Python 3.9.0a2 changed how "async for" traces its final iteration

2020-01-01 Thread Karthikeyan Singaravelan
Change by Karthikeyan Singaravelan : -- nosy: +asvetlov, yselivanov ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue39175] Funkness with issubset

2020-01-01 Thread Justin Hodder
Justin Hodder added the comment: AttributeError: 'tuple' object has no attribute 'issubset' And it doesn't explain why it works as expected in Brython. -- ___ Python tracker

[issue1820] Enhance Object/structseq.c to match namedtuple and tuple api

2020-01-01 Thread Vinay Sajip
Change by Vinay Sajip : -- pull_requests: +17214 pull_request: https://github.com/python/cpython/pull/17773 ___ Python tracker ___

[issue39166] Python 3.9.0a2 changed how "async for" traces its final iteration

2020-01-01 Thread Ned Batchelder
Ned Batchelder added the comment: I see that you are right, the bytecode is the same in 3.8 and 3.9. Nevertheless, the trace has definitely changed. Using the same program from the top of the issue, here are the ends of the traces for a number of Python versions. The extra trace of line

[issue39166] Python 3.9.0a2 changed how "async for" traces its final iteration

2020-01-01 Thread Mark Shannon
Mark Shannon added the comment: Ned, can you confirm that the trace has changed from 3.8 to 3.9? The bytecode for `doit_async` is identical for 3.8 and 3.9. -- ___ Python tracker

[issue38871] lib2to3 generates invalid code with filter and ternary operator

2020-01-01 Thread Dong-hee Na
Change by Dong-hee Na : -- keywords: +patch pull_requests: +17213 stage: -> patch review pull_request: https://github.com/python/cpython/pull/17780 ___ Python tracker ___

[issue39173] _AttributeHolder of argparse should support the sort function or not?

2020-01-01 Thread SilentGhost
SilentGhost added the comment: You'd need to elaborate on that. I've been using argparse for years and never once had presentational aspects affected by work. So, again, what is the actual use case for this? -- ___ Python tracker

[issue39171] Missing default root in tkinter simpledialog.py

2020-01-01 Thread Karthikeyan Singaravelan
Change by Karthikeyan Singaravelan : -- nosy: +gpolo, serhiy.storchaka ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue38750] Solve IPv4 categorisation issues with the ipaddress module

2020-01-01 Thread sam jonas
sam jonas added the comment: Hi i am also facing the same issue, please provide a good solution -- nosy: +samjonas ___ Python tracker ___