[issue46455] Deprecate / remove os.name=java

2022-01-21 Thread Xavier Morel
Xavier Morel added the comment: PS: "platform.system()" also documents `Java` as a value which doesn't seem to make that much sense, however it's an open set so probably less of an issue / source of confusion. -- ___ Py

[issue46455] Deprecate / remove os.name=java

2022-01-21 Thread Xavier Morel
New submission from Xavier Morel : os.name is defined as: > The following names have currently been registered: 'posix', 'nt', 'java'. In my understanding, the value `'java'` is for the benefit of jython, which is rather poorly. Other third-party

[issue45368] ~(True) and ~(False) gives incorrect result

2021-10-04 Thread Xavier Morel
Xavier Morel added the comment: > True is a boolean so ~True should return False according to me. That's be a BC break for no reason: if you want to invert a boolean you can just `not` it. > True is not the same as 1 For historical reasons, in Python it is: >>> bool.m

[issue45365] concurrent.futures.Future should be suitable for use outside of executors

2021-10-04 Thread Xavier Morel
New submission from Xavier Morel : concurrent.futures.Future currently has the note: > Future instances are created by Executor.submit() and should not be created > directly except for testing. That seems like a shame as futures are useful concurrency construct and having to rebuil

[issue43526] Programmatic management of BytesWarning doesn't work for native triggers.

2021-08-07 Thread Xavier Morel
Xavier Morel added the comment: > If working Python 3 program suddenly became emitting BytesWarning it will > confuse users. Oh yeah no I meant making it a normal warning, without needing the `-b` flag, not enabling it by default. Because controlling / configuring warnings can b

[issue43526] Programmatic management of BytesWarning doesn't work for native triggers.

2021-08-07 Thread Xavier Morel
Xavier Morel added the comment: And though I did not check, I expect the `-b` flag exists mostly because of the performance impact of the warning any time bytes are checked for equality, but surely that impact would be limited and probably not very relevant for the stringification of bytes

[issue43526] Programmatic management of BytesWarning doesn't work for native triggers.

2021-08-07 Thread Xavier Morel
Xavier Morel added the comment: > I am not against documenting the behavior of -b and BytesWarning clearly. I > don't think that anyone would be against. Just somebody have to provide a PR. Right but what about the ability to enable warning on stringification without enabling the

[issue43526] Programmatic management of BytesWarning doesn't work for native triggers.

2021-08-06 Thread Xavier Morel
Xavier Morel added the comment: Serhiy an other question (because I've encountered it *again*), do you think it'd be possible to split out the specific warning of stringifying (but *not* explicitely repr-ing) a bytes instance from everything else? There are use-cases for it, b

[issue44178] Add an interpreter-level critical section construct

2021-05-19 Thread Xavier Morel
New submission from Xavier Morel : Python code uses a fair amount of globals, and sometimes there's no good choice but to do dodgy things and temporarily update global state for one reason or another e.g. redirect a standard fd or stream (cf redirect_stdout), monkey-patch a built

[issue12056] "…" (HORIZONTAL ELLIPSIS) should be an alternative syntax for "..." (FULL STOP FULL STOP FULL STOP)

2021-05-18 Thread Xavier Morel
Xavier Morel added the comment: > But if we allow for ellipsis, then would we not also have to start allowing > characters like ≥ and ≤ in Python? No, they're not defined as canonically equivalent to >= and <= by the Unicode specification: >>> u

[issue44157] redirect_* should also redirect C-level streams

2021-05-17 Thread Xavier Morel
New submission from Xavier Morel : In 3.4 (resp. 3.5), `redirect_stdout` and `redirect_stderr` were added to provide easy and reentrant stream redirection. Although that is documented, it seems like a waste that they only redirect the high-level `sys.std*` streams: those are already pretty

[issue43526] Programmatic management of BytesWarning doesn't work for native triggers.

2021-03-20 Thread Xavier Morel
Xavier Morel added the comment: > In normal circumstances you should never deal with BytesWarning. The -b > option is only used for testing your program for some possible bugs caused by > migration from Python 2. If your program always worked only with Python 3, > the -b optio

[issue43527] Support full stack trace extraction in warnings.

2021-03-17 Thread Xavier Morel
New submission from Xavier Morel : When triggering warnings, it's possible to pass in a `stacklevel` in order to point to a more informative cause than the `warnings.warn` call. For instance `stacklevel=2` is a common one for DeprecationWarning in order to mark the call itself as depre

[issue43526] Programmatic management of BytesWarning doesn't work for native triggers.

2021-03-17 Thread Xavier Morel
Xavier Morel added the comment: Addendum: is there a way to force `-b` from within the running Python program? -- ___ Python tracker <https://bugs.python.org/issue43

[issue43526] Programmatic management of BytesWarning doesn't work for native triggers.

2021-03-17 Thread Xavier Morel
New submission from Xavier Morel : When setting `BytesWarning` programmatically (via the warnings API), though the `warnings.filters` value matches what's obtained via `python -b` and an explicit `warnings.warn` trigger will trigger, "native" triggers of the warning fail to t

[issue43036] TOS-behaviour documentation is inconsistent

2021-01-27 Thread Xavier Morel
Change by Xavier Morel : -- title: TOS-behaviour documentation is -> TOS-behaviour documentation is inconsistent ___ Python tracker <https://bugs.python.org/issu

[issue43036] TOS-behaviour documentation is

2021-01-27 Thread Xavier Morel
New submission from Xavier Morel : I was looking at the disassembly of a fairly straightforward listcomp: [e for e in s if e[0]] 1 0 BUILD_LIST 0 2 LOAD_FAST0 (.0) >>4 FOR_ITER16 (to 22)

[issue42644] logging.disable('WARN') breaks AsyncIO

2020-12-15 Thread Xavier Morel
Xavier Morel added the comment: Oh I now see you've created a PR to do essentially that, nm. -- ___ Python tracker <https://bugs.python.org/issue42644> ___ ___

[issue42644] logging.disable('WARN') breaks AsyncIO

2020-12-15 Thread Xavier Morel
Xavier Morel added the comment: > I think that patching logging.disable to raise a type error immediately would > be welcome FWIW `logging` has a built-in checker / converter[0] which is already used in a bunch of places (e.g. the aforementioned setLevel), it could just be added

[issue42644] logging.disable('WARN') breaks AsyncIO

2020-12-15 Thread Xavier Morel
Xavier Morel added the comment: The problem seems to be in the user code? As you were told by "Carreau", loggin.disable takes a logging level (an integer), since you're giving it a string which it dutifully stores, it blows up at the next logging call which happens to be in

[issue42572] Better path handling with argparse

2020-12-08 Thread Xavier Morel
Xavier Morel added the comment: > What exactly do you do with a path argument? Because they mention "convert[ing] the string to a path", I would expect an output of `pathlib.Path`, optionally checked for existence / non-existence and / or kind (file, directory, symlink, ...).

[issue42470] DeprecationWarning triggers for sequences which happen to be sets as well

2020-12-06 Thread Xavier Morel
Xavier Morel added the comment: Tried patterning the PR after the one which originally added the warning. Wasn't too sure how the news item was supposed to be generated, and grepping the repository didn't reveal any clear script doing that, so I made up a date and copied an exist

[issue42470] DeprecationWarning triggers for sequences which happen to be sets as well

2020-12-06 Thread Xavier Morel
Change by Xavier Morel : -- pull_requests: +22532 pull_request: https://github.com/python/cpython/pull/23665 ___ Python tracker <https://bugs.python.org/issue42

[issue42470] DeprecationWarning triggers for sequences which happen to be sets as well

2020-12-04 Thread Xavier Morel
Xavier Morel added the comment: I was preparing to open the PR but now I'm doubting: should I open the PR against master and miss islington will backport it, or should I open the PR against 3.9? -- ___ Python tracker <https://bugs.py

[issue42470] DeprecationWarning triggers for sequences which happen to be sets as well

2020-11-27 Thread Xavier Morel
Xavier Morel added the comment: > Do you want to submit a PR for this? Sure. Do you think the code I proposed would be suitable? > * The current logic matches the logic before the warning was added. > * The proposed logic matches what the code will do after the > deprecatio

[issue42470] DeprecationWarning triggers for sequences which happen to be sets as well

2020-11-26 Thread Xavier Morel
New submission from Xavier Morel : In 3.9, using `random.sample` on sets triggers DeprecationWarning: Sampling from a set deprecated since Python 3.9 and will be removed in a subsequent version. *However* it also triggers on types which implement *both* Sequence and Set, despite Sequence

[issue42106] docs.python.org prioritises search horribly

2020-10-21 Thread Xavier Morel
Xavier Morel added the comment: Apparently it's at least a possibility on DDG's side (https://duckduckgo.com/search_box), don't know how easy it'd be to integrate in sphinx, or whether a hard dependency on an external search engine is ac

[issue42106] docs.python.org prioritises search horribly

2020-10-21 Thread Xavier Morel
New submission from Xavier Morel : I expect it simply uses sphinx and I don't know if sphinx's search is easily customisable but the experience is really terrible when looking for the doc of a specific thing, *especially* when that thing is or is related to a builtin, which I'

[issue33387] Simplify bytecodes for try-finally, try-except and with blocks.

2020-10-16 Thread Xavier Morel
Xavier Morel added the comment: The 3.9 changelog mentions WITH_EXCEPT_FINISH but that seems to have ultimately been called WITH_EXCEPT_START, maybe it shoudl be updated also? -- nosy: +xmorel ___ Python tracker <https://bugs.python.

[issue24828] Segfault when using store-context AST node in a load context

2020-10-15 Thread Xavier Morel
Xavier Morel added the comment: Should I close this since I believe 2.7 is not supported anymore? -- ___ Python tracker <https://bugs.python.org/issue24

[issue40325] Random.seed does not affect string hash randomization leading to non-intuitive results

2020-10-15 Thread Xavier Morel
Xavier Morel added the comment: @rhettinger checking software against 3.9 there's a little issue with the way the check is done: if passed something which is *both* a sequence and a set (e.g. an ordered set), `random.sample` will trigger a warning, which I don't think is correct.

[issue42033] Seemingly unnecessary complexification of foo(**kw)

2020-10-15 Thread Xavier Morel
Xavier Morel added the comment: I have not noticed anything, I was just looking at the bytecode changes and stumbled upon this oddity. Though I would expect a small slowdown as every fn(**kw) would now incur an extra dict copy, unless there’s something in call_function_ex which copies the

[issue42033] Seemingly unnecessary complexification of foo(**kw)

2020-10-14 Thread Xavier Morel
New submission from Xavier Morel : Following bpo-39320 the highly specialised bytecode for vararg calls were replaced by simpler ones, but there seems to be at least one area where the generated bytecode regressed for possibly no reason? In Python 3.8, foo(**var) compiles to: 0 LOAD_GLOBAL

[issue41641] Add a "message" action to warnings, to trigger for every *unique* message

2020-08-26 Thread Xavier Morel
New submission from Xavier Morel : Warning actions allow deduplicating warning triggers based on category ("once"), category + file ("module") and category + exact location ("default"). One thing which is missing is support for a single location generating

[issue30951] Documentation error in inspect module

2020-06-25 Thread Xavier Morel
Xavier Morel added the comment: Maybe something along the lines of "names other than arguments and function locals", or "names of the symbols used in the code object, other than arguments and function locals"? This is still slightly confusing because in the case of a

[issue30535] Warn that meta_path is not empty

2017-06-02 Thread Xavier Morel
Xavier Morel added the comment: > Fair enough. So we can just add a sentence informing readers that `meta_path`, by default, holds entries to handle the standard kinds of modules (.py files, extension modules…). Yeah that's basically what I meant, talking about a "warning" in

[issue30535] Warn that meta_path is not empty

2017-06-02 Thread Xavier Morel
Xavier Morel added the comment: > A warning is probably too strong. Also, it's easy to check sys.meta_path at > the interpreter prompt, so I'm not sure it's worth mentioning at all. It's easy if you think of it and did not miss a small bit of the Python 3.3 releas

[issue30535] Warn that meta_path is not empty

2017-06-02 Thread Xavier Morel
Xavier Morel added the comment: > I'm fine with adding a note to the Python 2 docs, but putting it in Python 3 > seems to be going in the wrong direction as having sys.meta_path not be empty > is how Python will be going forward. I don't think putting a note is any hin

[issue29920] Document cgitb.text and cgitb.html

2017-06-01 Thread Xavier Morel
Xavier Morel added the comment: Should I close this since the PR was merged? -- ___ Python tracker <http://bugs.python.org/issue29920> ___ ___ Python-bugs-list m

[issue30535] Warn that meta_path is not empty

2017-06-01 Thread Xavier Morel
Xavier Morel added the comment: And it turns out the change was noted in the Python 3.3 release notes[0] though not all the consequences were spelled out (and the meta_path and path_hooks documentations were not changed) [0] https://docs.python.org/3/whatsnew/3.3.html#visible-changes

[issue30535] Warn that meta_path is not empty

2017-06-01 Thread Xavier Morel
Xavier Morel added the comment: Addendum: the warning was present (in the documentation) until Python 3.5, even though Python 3.3 is apparently where the "default finders" were moved to meta_path: > python3.2 -c 'import sys;print(sys.meta_path)' [] > pyth

[issue30535] Warn that meta_path is not empty

2017-06-01 Thread Xavier Morel
New submission from Xavier Morel: Encountered this issue porting Python 2 code manipulating meta_path to Python 3. In Python 2, meta_path is empty by default and its documentation specifically notes that: > sys.meta_path is searched before any implicit default finders or sys.path. A

[issue29920] Document cgitb.text and cgitb.html

2017-03-27 Thread Xavier Morel
Changes by Xavier Morel : -- pull_requests: -747 ___ Python tracker <http://bugs.python.org/issue29920> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue29920] Document cgitb.text and cgitb.html

2017-03-27 Thread Xavier Morel
Xavier Morel added the comment: PR targetted to master rather than 2.7 -- pull_requests: +748 ___ Python tracker <http://bugs.python.org/issue29920> ___ ___ Pytho

[issue29920] Document cgitb.text and cgitb.html

2017-03-27 Thread Xavier Morel
New submission from Xavier Morel: Currently, cgitb documents the hook (enable) and somewhat unclearly the ability to dump the HTML traceback to stdout, but despite that being technically available it does not document the ability to dump the traceback to a string as either text or html

[issue24828] Segfault when using store-context AST node in a load context

2015-08-08 Thread Xavier Morel
New submission from Xavier Morel: It looks to be fixed in 3.3 and up, but in Python 2.7 import ast m = ast.Module(body=[ ast.Expr(value=ast.Name(id='foo', ctx=ast.Store())) ]) ast.fix_missing_locations(m) code = compile(m, '', mode='exe

[issue21590] Systemtap and DTrace support

2014-06-26 Thread Xavier Morel
Changes by Xavier Morel : -- nosy: +xmorel ___ Python tracker <http://bugs.python.org/issue21590> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue14776] Add SystemTap static markers

2014-06-26 Thread Xavier Morel
Changes by Xavier Morel : -- nosy: +xmorel ___ Python tracker <http://bugs.python.org/issue14776> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue13405] Add DTrace probes

2014-06-26 Thread Xavier Morel
Changes by Xavier Morel : -- nosy: +xmorel ___ Python tracker <http://bugs.python.org/issue13405> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue15639] csv.Error description is incorrectly broad

2012-08-14 Thread Xavier Morel
Xavier Morel added the comment: Correction: csv also seems to raise csv.Error if the file contains NUL bytes: Error: line contains NULL byte -- ___ Python tracker <http://bugs.python.org/issue15

[issue15639] csv.Error description is incorrectly broad

2012-08-13 Thread Xavier Morel
New submission from Xavier Morel: In both Python 2.7 and Python 3.x, csv.Error is documented as: Raised by any of the functions when an error is detected. As far as I can tell from using the module and looking at the code, this is completely incorrect. There is actually a single instance

[issue13850] Summary tables for argparse add_argument options

2012-03-25 Thread Xavier Morel
Xavier Morel added the comment: completion for list item 4: > although it would definitely make the "raw text" (in-rst) much harder to read > compared to the current table (which can be used from the rst source without > compiling) -- ___

[issue13850] Summary tables for argparse add_argument options

2012-03-25 Thread Xavier Morel
Xavier Morel added the comment: Had some time to play with this today, here's a draft matrix of actions and add_argument parameters which is pretty readable, but: * It's incredibly not helpful for people who don't know argparse * I tried adding effects descriptions in the c

[issue13850] Summary tables for argparse add_argument options

2012-01-24 Thread Xavier Morel
Xavier Morel added the comment: > The "Parameters" column would span multiple lines, with one parameter and a > brief description of the parameter on each line. I started looking into that, and it turns out that's more annoying than expected: a bunch of parameters are s

[issue13850] Summary tables for argparse add_argument options

2012-01-24 Thread Xavier Morel
Xavier Morel added the comment: > My specific suggestion is to have a dedicated "Quick Reference" section > before the first example. OK, that looks like a good plan. -- ___ Python tracker <http://bugs.py

[issue13850] Summary tables for argparse add_argument options

2012-01-24 Thread Xavier Morel
Xavier Morel added the comment: Creating the tables should not be too hard, especially using e.g. org-mode, but: 1. Where should those tables live? The argparse documentation is pretty big and there's no completely obvious place. I would guess table 1. could just replace the li

[issue12056] "…" (HORIZONTAL ELLIPSIS) should be an alternative syntax for "..." (FULL STOP FULL STOP FULL STOP)

2011-05-11 Thread Xavier Morel
New submission from Xavier Morel : In Python 3, "..." became useable as a normal expression, and translates into an ellipsis instance. Unicode defines an ellipsis character "…" (U+2026 HORIZONTAL ELLIPSIS) which is canonically equivalent to a 3-sequence of FULL STOP [U+00

[issue11979] Minor improvements to the Sockets readme: typos, wording and sphinx features usage

2011-05-02 Thread Xavier Morel
Changes by Xavier Morel : Added file: http://bugs.python.org/file21854/sphinx-features ___ Python tracker <http://bugs.python.org/issue11979> ___ ___ Python-bugs-list m

[issue11979] Minor improvements to the Sockets readme: typos, wording and sphinx features usage

2011-05-02 Thread Xavier Morel
New submission from Xavier Morel : First patch fixes a typo ("the reads a reply" -> "then reads a reply") and — I believe — improves the wording of a pair of sentences. Second patch makes use of Sphinx's ``:abbr:`` role, and removes some period which I think a

[issue11260] smtpd-as-a-script feature should be documented and should use argparse

2011-02-22 Thread Xavier Morel
Xavier Morel added the comment: > Only "document and formalize" the parts that are well thought out. I don't believe I have the knowledge, right or ability to make that call for any module or package but a pair of extremely obvious ones (http.server seems a pretty good

[issue11260] smtpd-as-a-script feature should be documented and should use argparse

2011-02-22 Thread Xavier Morel
Xavier Morel added the comment: Barry, do I correctly understand your comment to mean I should write end-to-end tests of the CLI (until reaching the already tested "meat" of smtpd), not just the CLI options parsing? -- ___ Python trac

[issue11260] smtpd-as-a-script feature should be documented and should use argparse

2011-02-22 Thread Xavier Morel
Xavier Morel added the comment: One more note I forgot previously: the conversion of as much scripts as possible to argparse would be for three reasons: * Make behavior consistent across the board (e.g. -h/--help) * Make CLI documentation format consistent across the board either so users

[issue11260] smtpd-as-a-script feature should be documented and should use argparse

2011-02-22 Thread Xavier Morel
Xavier Morel added the comment: > any of the undocumented command-line interfaces are intentionally > undocumented -- they were there for the convenience of the developer for > exercising the module as it was being developed and are not part of the > official API. I can understa

[issue11260] smtpd-as-a-script feature should be documented and should use argparse

2011-02-22 Thread Xavier Morel
Xavier Morel added the comment: > Do tests currently exist for smtpd run as a script? I have to confess I didn't think to check. > If not, our experience with converting compileall to argparse indicates a > thorough test suite is needed (and even so we missed some things we had

[issue11260] smtpd-as-a-script feature should be documented and should use argparse

2011-02-20 Thread Xavier Morel
Xavier Morel added the comment: Second patch: documenting smtpd-as-a-script in the module's rst -- Added file: http://bugs.python.org/file20813/smtpd-as-script-doc.diff ___ Python tracker <http://bugs.python.org/is

[issue11260] smtpd-as-a-script feature should be documented and should use argparse

2011-02-20 Thread Xavier Morel
New submission from Xavier Morel : argparse has been merged to the standard library in 3.2, and (tell me if I'm wrong) would therefore be the "best-practices" way to parse command-line arguments. Numerous stdlib modules can be used as scripts, but they tend to have ad-hoc do