[issue36207] robotsparser deny all with some rules

2020-07-30 Thread James Gray

James Gray  added the comment:

Bonjour, je vois que nous ne sommes pas les seuls dans ce cas, nous avons 
besoin que les robots indexent nos pages html mais qu'elles n'indexent pas 
celles en /*.php$ ainsi que les ressources PC en PDF. Nous avons tenté en vain 
plusieurs solutions en passant par le robots.txt à la racine de notre domaine 
https://demolinux.org/ mais sans succès. Le RobotsParser ne prends pas ces 
règles en compte, merci.

--
nosy: +Jmgray47

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40360] Deprecate lib2to3 (and 2to3) for future removal

2020-07-30 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
pull_requests: +20838
pull_request: https://github.com/python/cpython/pull/21694

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41441] io reading & updating fix

2020-07-30 Thread 施文峰

Change by 施文峰 :


--
pull_requests: +20837
pull_request: https://github.com/python/cpython/pull/21686

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41274] Better way to random.seed()?

2020-07-30 Thread Juan Jimenez


Juan Jimenez  added the comment:

Pull request https://github.com/python/cpython/pull/21693 created for the demo 
steven.daprano suggested.

--
message_count: 8.0 -> 9.0
pull_requests: +20836
pull_request: https://github.com/python/cpython/pull/21693

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41446] New demo, using a web api

2020-07-30 Thread Juan Jimenez


Change by Juan Jimenez :


--
keywords: +patch
pull_requests: +20835
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/21693

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41441] io reading & updating fix

2020-07-30 Thread 施文峰

Change by 施文峰 :


--
pull_requests:  -20829

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41131] Augment random.choices() with the alias method

2020-07-30 Thread Tim Peters


Tim Peters  added the comment:

Oh yes - I understood the intent of the code.  It's as good an approach to 
living with floating-point slop in this context as I've seen.  It's not 
obviously broken.  But neither is it obviously correct, and after a few minutes 
I didn't see a clear path to rigorously proving it can't break.  In FP, if 
there's one chance in 2**53 that it _can_ break, it will ;-)

The suggestions I made change none of that:  reducing the number of rounding 
errors can only help.

OTOH, an all-integer version of the algorithm _can_ be "obviously correct", and 
can embed asserts to verify that it is.  It can all be done in a single 
fixed-size list of 3-lists ([weight, value, alias]), swapping entries as needed 
to keep the 3 regions of interest ("too small", "on the nose", "too large") 
each contiguous.  Then it's straightforward to prove that you run out of "too 
small" entries at the same time you run out of "too large" ones.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6143] IDLE - clear and restart the shell window

2020-07-30 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

@Pokerstar: First we have to agree on several things.

1. What is the need, what are the use cases? When do *you* feel a need to clear 
the shell?

2. What is the basic strategy?
 a. Delete selections: make delete, backspace, and cut work in the shell, as in 
editor.
I prefer this.  No new doc or menu entries needed.
People can delele less than everything.
 b. New feature. All or nothing.  Changes 8 files.  There was discussin of how 
to delete, but seems not difficult.

3. Details need to be agreed on.
  If new feature, menu entry and shortcut: I thing 'Clear shell' is enough.  
Patch disagrees with discussion on shortcut.
  Should header be deleted or left?  (Delete selection lets user decide.)
  Should deleted text be undoable?  We do not currently allow any editing of 
shell history?  Undo amounts to pasting or retyping, and if we do not allow 
pasting or typing in general, why with undo?
  Should squeezes text be expanded?  I think not.  help(tkinter) produces over 
22000 lines.
  Should the current prompt and any code be deleted?  I think not.  If prompt 
gets deleted, it has to be re-written, but without current in-process entry.
  Should remote process be restarted?  Why?  This can easily be done 
independently and might not be wanted.
  

4. New behavior must be tested.  The is usually the hardest part of a patch, 
which is why it is neglected.  Incomplete testing may result in adding a new 
bug.  It was just reported that closing IDLE while the Shell is waiting for a 
response to input(prompt) leads to incomplete shutdown and a zombie process.  
On macOS, this can lead to a crash and possibly a need to reboot.
  So, should we allow clearing, deletion while user code is executing?  While 
user code is requesting input?  Or must we prohibit?  I don't know, other than 
this must be tested at least on Windows and macOS.

Overall, I prefer to use the deletion mechanism we have, rather than add a new 
one.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41131] Augment random.choices() with the alias method

2020-07-30 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

FWIW, I paid close attention to rounding.  The reason for the "while small and 
large" is that the loop stops making aliases unless we have both something at 
or below 0.5 and something known to be above 0.5.  If we end up with only two 
bins slightly above over below 0.5, they are considered close-enough and will 
alias to themselves.

By giving the bins a default alias to themselves, there is always a reasonable 
dispatch in the main sampling loop even if the random() value compares to an 
unfavorably rounded entry in U.

The code assumes that weird roundings will happen through out.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41131] Augment random.choices() with the alias method

2020-07-30 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

Okay, thank you for looking!

--
resolution:  -> wont fix
stage:  -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37586] macOS: posix_spawn(..., setsid=True)

2020-07-30 Thread Steve Dower


Steve Dower  added the comment:

Oh great, it's one of these style changes :)

You probably want to define some macros for those barriers so the added 
optional nesting doesn't come back to bite us later.

Otherwise, best of luck! Let me know if I can help out (for now I'm just 
ignoring the setsid test).

--
versions: +Python 3.10

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41131] Augment random.choices() with the alias method

2020-07-30 Thread Tim Peters


Tim Peters  added the comment:

I'm not clear on that the alias method is valuable here. Because of the 
preprocessing expense, it cries out for a class instead: an object that can 
retain the preprocessed tables, be saved to disk (pickled), restored later, and 
used repeatedly to make O(1) selections. I have such a class, which uses exact 
integer arithmetic (e.g., during preprocessing, there's at least one "too 
small" bin if and only if there's at least one "too large" bin), and is as 
unbiased as choice() and randrange(). Reasoning about float vagaries is much 
harder, and I see no error analysis here.

Most troubling: that due to rounding, reducing a "too large" bin results in a 
weight that spuriously compares <= bin_size. Then a "too small" bin with a 
genuinely tiny weight can be left with nothing to pair with, and so ends up 
aliasing itself, giving it a massively too-high probability of being picked.

So if you're determined to stick to "a function", I'd stick to the simple 
inverse CDF sampling method.  Unless the number of choices is "very" large, the 
log factor doesn't much matter.

That said, the alias numerics here could be improved some by working with the 
weights directly, "normalizing" them only at the end.  Instead of comparing 
weights to bin_size, compare them instead to the mean:

mean = total / n

(note: the next step to getting rid of floats entirely is to pre-multiply the 
weights by lcm(total, n) // total  - then their mean is exactly the integer 
lcm(total, n) // n).

The mean (instead of bin_size) suffers rounding errors then, but the original 
weights don't during the "hard part" of preprocessing.  At the end,

fn = n + 0.0
U = [weights[i] / total + i / fn for i in range(n)]

instead.  The "i / fn" also suffers just one rounding error as opposed to the 
two in the current "bin_width * i".  That can make a difference for n as small 
as 5:

>>> 3/5
0.6
>>> (1/5)*3
0.6001

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue20684] inspect.getfullargspec (etc) incorrectly follows __wrapped__ chains

2020-07-30 Thread Anthony Sottile


Change by Anthony Sottile :


--
nosy: +Anthony Sottile
nosy_count: 3.0 -> 4.0
pull_requests: +20834
pull_request: https://github.com/python/cpython/pull/21100

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41447] Resource Tracker in Multiprocessing Shared Memory not working correctly

2020-07-30 Thread Damian Barabonkov


New submission from Damian Barabonkov :

The way the resource tracker is used in /Lib/multiprocessing/shared_memory.py 
leads to it issuing warnings/errors, even when resources are cleaned up 
properly.

Attached are two simple demo files copied from the documentation example 
(https://docs.python.org/3.9/library/multiprocessing.shared_memory.html) that 
illustrate the warnings below: 

proc1.py

Traceback (most recent call last):
  File "proc1.py", line 19, in 
shm.unlink()  # Free and release the shared memory block at the very end
  File 
"/home/damian/Documents/QuantCo/miniconda3/envs/pipeline-parallel/lib/python3.8/multiprocessing/shared_memory.py",
 line 244, in unlink
_posixshmem.shm_unlink(self._name)
FileNotFoundError: [Errno 2] No such file or directory: '/shmem'
/home/damian/Documents/QuantCo/miniconda3/envs/pipeline-parallel/lib/python3.8/multiprocessing/resource_tracker.py:218:
 UserWarning: resource_tracker: There appear to be 1 leaked shared_memory 
objects to clean up at shutdown
  warnings.warn('resource_tracker: There appear to be %d '
/home/damian/Documents/QuantCo/miniconda3/envs/pipeline-parallel/lib/python3.8/multiprocessing/resource_tracker.py:231:
 UserWarning: resource_tracker: '/shmem': [Errno 2] No such file or directory: 
'/shmem'
  warnings.warn('resource_tracker: %r: %s' % (name, e))


proc2.py

python3.8/multiprocessing/resource_tracker.py:218: UserWarning: 
resource_tracker: There appear to be 1 leaked shared_memory objects to clean up 
at shutdown
  warnings.warn('resource_tracker: There appear to be %d '

--
files: shmem_bug.py
messages: 374621
nosy: damian.barabonkov
priority: normal
severity: normal
status: open
title: Resource Tracker in Multiprocessing Shared Memory not working correctly
type: behavior
versions: Python 3.8
Added file: https://bugs.python.org/file49351/shmem_bug.py

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41446] New demo, using a web api

2020-07-30 Thread Juan Jimenez


New submission from Juan Jimenez :

As per a suggestion in https://bugs.python.org/issue41274 I would like to 
submit for consideration a new demo program, one that demonstrates how to use a 
web API to generate a pseudo-random generator seed from high resolution, high 
cadence images of the sun. I will be submitting a pull request for 
consideration.

--
components: Demos and Tools
messages: 374620
nosy: flybd5
priority: normal
severity: normal
status: open
title: New demo, using a web api
type: enhancement
versions: Python 3.10

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41445] Adding configure temporary files to gitignore

2020-07-30 Thread fj92f3jj923f923


Change by fj92f3jj923f923 :


--
keywords: +patch
pull_requests: +20833
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/21691

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41445] Adding configure temporary files to gitignore

2020-07-30 Thread fj92f3jj923f923


New submission from fj92f3jj923f923 :

I noticed that a lot of files generated and removed due configuring.
I was too scary, when I saw them, and decided to add them to .gitignore.

--
components: Build
messages: 374619
nosy: fj92f3jj923f923
priority: normal
severity: normal
status: open
title: Adding configure temporary files to gitignore
type: enhancement
versions: Python 3.10

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41444] CPython 3.8.5 fails to build on Windows with -E option

2020-07-30 Thread Vladislav Mikhalin


Vladislav Mikhalin  added the comment:

The documentation states:
  -E  Don't fetch or build external libraries.  Extension modules that
  depend on external libraries will not attempt to build if this flag
  is present; -e is also accepted to explicitly enable fetching and
  building externals.

So, according to this, any module that is dependent on external libraries will 
not be built. Ant it was working with 3.7.5.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41444] CPython 3.8.5 fails to build on Windows with -E option

2020-07-30 Thread Steve Dower


Steve Dower  added the comment:

Yes, if you use -E then you need to provide the dependencies in some other way.

The option is there to suppress network access at build time, not to build 
without those modules.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41330] Inefficient error-handle for CJK encodings

2020-07-30 Thread Dong-hee Na


Dong-hee Na  added the comment:

I am also +1 on Serhiy's opinion.

As I am Korean, (I don't know Japan or China environment)
I know that there still exist old Korean websites that use EUC-KR encoding.
But at least 2010s modern Korea website/application.
Most of the applications are built on UTF-8.

--
nosy: +corona10

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40841] Provide mimetypes.sniff API as stdlib

2020-07-30 Thread Dong-hee Na


Dong-hee Na  added the comment:

https://www.garykessler.net/library/file_sigs.html looks like a good resource 
for this kind of API.

However, I would like to choose well-known standard from whatwg or w3c etc..

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41444] CPython 3.8.5 fails to build on Windows with -E option

2020-07-30 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
components: +Windows
nosy: +paul.moore, steve.dower, tim.golden, zach.ware

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41444] CPython 3.8.5 fails to build on Windows with -E option

2020-07-30 Thread Vladislav Mikhalin


New submission from Vladislav Mikhalin :

These errors are generated on a clean build:

C:\cpython-3.8.5\Modules\_ctypes\_ctypes.c(107,10): fatal error C1083: Cannot 
open include file: 'ffi.h': No such file or directory 
[C:\cpython-3.8.5\PCbuild\_ctypes.vcxproj]
C:\cpython-3.8.5\Modules\_ctypes\callbacks.c(4,10): fatal error C1083: Cannot 
open include file: 'ffi.h': No such file or directory 
[C:\cpython-3.8.5\PCbuild\_ctypes.vcxproj]
C:\cpython-3.8.5\Modules\_ctypes\callproc.c(71,10): fatal error C1083: Cannot 
open include file: 'ffi.h': No such file or directory 
[C:\cpython-3.8.5\PCbuild\_ctypes.vcxproj]
C:\cpython-3.8.5\Modules\_ctypes\cfield.c(3,10): fatal error C1083: Cannot open 
include file: 'ffi.h': No such file or directory 
[C:\cpython-3.8.5\PCbuild\_ctypes.vcxproj]
C:\cpython-3.8.5\Modules\_ctypes\malloc_closure.c(2,10): fatal error C1083: 
Cannot open include file: 'ffi.h': No such file or directory 
[C:\cpython-3.8.5\PCbuild\_ctypes.vcxproj]
C:\cpython-3.8.5\Modules\_ctypes\stgdict.c(2,10): fatal error C1083: Cannot 
open include file: 'ffi.h': No such file or directory 
[C:\cpython-3.8.5\PCbuild\_ctypes.vcxproj]

--
components: Build
messages: 374614
nosy: Vladislav Mikhalin
priority: normal
severity: normal
status: open
title: CPython 3.8.5 fails to build on Windows with -E option
versions: Python 3.8

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41360] method _tunnel does not allow for a standard proxy authentication solution

2020-07-30 Thread Вадим Новиков

Change by Вадим Новиков :


--
nosy: +Вадим Новиков

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41411] Improve and consolidate f-strings docs

2020-07-30 Thread Ezio Melotti


Ezio Melotti  added the comment:

Thanks both for pointing out the additional section in inputoutput.rst that I 
initially missed.

> I have done PR 21681 that adds index to the tutorial although searching[2][3] 
> does not seem to be better now that the reference has an index.

The online docs seem updated, so I'm not sure why it's not working. Maybe you 
could try moving things around and see if you can make it work?  You should be 
able to build the docs locally and test from there.  You can also see if Sphinx 
raises any warning during the build process, try to move the `.. index` 
directive just after the section title (instead of before), or add an empty 
line between the list of entries and the section label (unnecessary if you move 
the entries after the title). 

> This is there[0] but it _IS_ hard to find, when you don't know it is there.

I noticed (or rather, I didn't :)!

> It may not be very "introduction-y", and if you like I can make a go at 
> trying to reword it.

I think this section is fine, the only thing that needs to be update is the 
link at the end of the section to point to the main f-string section that we 
will add elsewhere.

>> The stdtypes page is already quite long and crowded ...
> True. But is this wrong? In my feeling this is reference documentation. It 
> should be accurate, complete and clear. It may not need to be "textbook-like".

You might be right.

> Some thoughts:
> - There may be benefit in reorganising stdtypes.rst to improve the flow 
> without changing the actual content. This could mean breaking it up into a 
> number of documents rather than the monolith it is.

Both in the documentation and in the code, there are advantages in having 
everything on a single page/file (such as easier ctrl+f search) but also 
disadvantages.  Given the goal of the page, I think keeping it monolithic is 
fine: it provides a summary of all the built-in types in a single place.  
Breaking it down into multiple pages will have other issues.  If you make a 
page per type, you will have some pages that are very short, and it will be 
more difficult to get an overview of all the types, comparing them, and 
searching through all of them at once. 

> - It does feel like printf[4] was plugged in later because str.format()[5] 
> had been explained earlier. (Although I believe printf came before 
> str.format()). A first time reader of the document will find it hard to know 
> the one way that is right when it comes to formatting.

If I recall correctly that section has also been there, but initially it was 
just describing the standard way of doing string formatting, and when 
str.format() was added, it got renamed and the note at the top was added to 
link to the str.format() documentation.  I guess that the str.format 
documentation ended up in string.rst because it was related to 
string.formatter, and the author wanted to keep them together.

> - f-strings should probably also be described here because it _is_ built in, 
> no? It may not be accurate to say it is in /Lib/strings. There is no 
> reference that a developer can just look at to remind/confirm to themselves 
> how to "do it".

Agreed, stdtypes.rst would be the right place where to document this, my only 
concerns were: 1) the size of the page (that as said above, is not such a big 
deal); 2) keeping str.format() and string.Formatter() together (but this is 
also not a huge concern).

Also note that str.format() is not documented in stdtypes.rst, however there is 
an entry for str.format() with a clear link to the formatting docs, so I never 
had a problem finding it, even if I needed an extra click.

[...]

> But now (and this is mainly to me) it appears that another problem is a need 
> to consistently, clearly, and in one place describe the various 
> elements/nuances/eccentricities of presenting data in Python: 
>  - string
>  - string.Formatter,
>  - string.Template,
>  - str.format()
>  - f-string
>  - Format Specification Mini-Language
>  - maybe even __format__ and conversion?
>  - etc

What about doing the following:
* keep having stdtypes.rst cover and explain all the built-in types and their 
features;
* move the "Format String Syntax", "Format Specification Mini-Language", 
"Format examples" sections from string.rst to stdtypes.rst where they belong;
* integrate f-strings in these sections, and add a new section explaining 
f-string-specific quirks;
* leave the printf-style string formatting in stdtypes.rst, after the format 
sections
* use string.rst to document the string module and its objects, hence leaving 
string.Formatter and string.Template here, where they belong (string.Formatter 
is self contained enough that doesn't need to be with the other format 
sections);
* leave the inputoutput.rst and lexical_analysis pages as they are;
* update the introduction.rst page to mention f-string;
* once all this is done, update all links to point to the appropriate sections 
and cross-link all related sections;


[issue40045] Make "dunder" method documentation easier to locate

2020-07-30 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

Closing as fixed. Thanks Hilit.

--
nosy: +xtreak
resolution:  -> fixed
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41435] Allow to retrieve ongoing exception handled by every threads

2020-07-30 Thread Julien Danjou


Change by Julien Danjou :


--
keywords: +patch
pull_requests: +20832
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/21689

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40360] Deprecate lib2to3 (and 2to3) for future removal

2020-07-30 Thread David Halter


David Halter  added the comment:

@gvanrossum

> Does parso have to be pure Python? If not, we could generate C code like we 
> do for CPython's parser. 

I would rather write the parser either in C or Rust. So no, parso does not need 
to be pure Python.

> Now, that doesn't work for incremental parsing, but I did an alternative 
> implementation that uses a stack machine, also in C, that's only 2x slower 
> than the PEG parser. Maybe that could be adapted to incremental parsing 
> (because it's a stack machine). Error recovery is still a research project 
> (at least for me -- I'm actually reading papers :-).

Makes sense! I was also thinking about GLL parsing. Obviously GLL does not 
cover all cases where PEG could potentially work, but I doubt that Python ever 
moves to a place where GLL would not be sufficient.

I'm also doing a bit of research on Rust parsers and trying to find a solution 
for my parsing needs in the future. (I'd rather have a Rust parser than a C 
one, because I like the language better and both should still work in Python).

Please let me know if you're making a lot of progress with PEG parsers and 
error recovery/incremental parsing. I'm definitely interested in copying an 
approach if it works :).

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41443] some test cases in test_posix.py fail if some os attributes are not supported

2020-07-30 Thread Peixing Xin


Change by Peixing Xin :


--
keywords: +patch
pull_requests: +20831
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/21688

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41443] some test cases in test_posix.py fail if some os attributes are not supported

2020-07-30 Thread Peixing Xin


New submission from Peixing Xin :

Some operating systems like VxWorks can't support posix.chown, posix.mknod and 
posix.readlink. This results that test_chown_dir_fd, test_mknod_dir_fd and 
test_readlink_dir_fd fail.

--
components: Tests
messages: 374610
nosy: pxinwr
priority: normal
severity: normal
status: open
title: some test cases in test_posix.py fail if some os attributes are not 
supported
type: behavior
versions: Python 3.10

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41442] test_posix.PosixTester.test_getgroups fail on operating systems without supporting unix shell

2020-07-30 Thread Peixing Xin


Change by Peixing Xin :


--
keywords: +patch
pull_requests: +20830
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/21687

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41441] io reading & updating fix

2020-07-30 Thread 施文峰

Change by 施文峰 :


--
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41442] test_posix.PosixTester.test_getgroups fail on operating systems without supporting unix shell

2020-07-30 Thread Peixing Xin


New submission from Peixing Xin :

test_posix.PosixTester.test_getgroups requires unix shell supported on tested 
platform. However some operating systems like VxWorks doesn't support unix 
shell. This case will fail on it.

--
components: Tests
messages: 374609
nosy: pxinwr
priority: normal
severity: normal
status: open
title: test_posix.PosixTester.test_getgroups fail on operating systems without 
supporting unix shell
type: behavior
versions: Python 3.10

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40075] _tkinter PythonCmd fails to acquire GIL

2020-07-30 Thread E. Paine


E. Paine  added the comment:

Thanks Steve for your explanation. I had a quick experiment with the 
ENTER_PYTHON definition and initially just added a call to PyThreadState_Get if 
the tstate was NULL. This still crashed the interpreter with the following 
error (which I think reaffirms Steve's explanation):

Fatal Python error: PyThreadState_Get: the function must be called with the GIL 
held, but the GIL is released (the current Python thread state is NULL)

To work-around this error, I temporarily acquired the GIL and then released it 
after the call to PyThreadState_Get. The result worked correctly and can be 
found in the attached diff. I am not saying that the attached diff is the 
solution, but I don't think we need to stop using tstate in favour of the 
gstate introduced in the PR.

> I could not reproduce the crash without showing any non-tk dialog.

That would help explain why I cannot reproduce it on Linux - it is differences 
in the windowing API under Tcl not some platform-specific code in Tcl/Tk or 
_tkinter.

--
Added file: https://bugs.python.org/file49350/tstate_acquire.diff

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41441] io reading & updating fix

2020-07-30 Thread 施文峰

施文峰  added the comment:

Please refer to the test case-  https://github.com/841020/open_source

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41323] Perform "peephole" optimization directly on control-flow graph.

2020-07-30 Thread Mark Shannon


Mark Shannon  added the comment:


New changeset 6e8128f02e1d36e38e5866f9dc36e051caa47bc9 by Mark Shannon in 
branch 'master':
bpo-41323: Perform 'peephole' optimizations directly on the CFG. (GH-21517)
https://github.com/python/cpython/commit/6e8128f02e1d36e38e5866f9dc36e051caa47bc9


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41323] Perform "peephole" optimization directly on control-flow graph.

2020-07-30 Thread Mark Shannon


Change by Mark Shannon :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41441] io reading & updating fix

2020-07-30 Thread 施文峰

Change by 施文峰 :


--
resolution:  -> fixed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41395] pickle and pickletools cli interface doesn't close input and output file.

2020-07-30 Thread Sebastien Williams-Wynn


Change by Sebastien Williams-Wynn :


--
nosy: +s.williams-wynn

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41441] io reading & updating fix

2020-07-30 Thread 施文峰

New submission from 施文峰 :

happen at io's reading & updating(r+) mode
if you remove whole content ( truncate(0) ), tell wil not back to 0
then you start writing will start at current position
that's why problem happen

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41441] io reading & updating fix

2020-07-30 Thread 施文峰

Change by 施文峰 :


--
keywords: +patch
pull_requests: +20829
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/21686

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41441] io reading & updating fix

2020-07-30 Thread 施文峰

Change by 施文峰 :


--
components: IO
nosy: ke265379ke
priority: normal
severity: normal
status: open
title: io  reading & updating fix
type: enhancement
versions: Python 3.8

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41177] ConvertingList and ConvertingTuple lack iterators and ConvertingDict lacks items()

2020-07-30 Thread Brett Hannigan


Brett Hannigan  added the comment:

Just wanted to check-in to see if there were any updates on my proposed PR?

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37586] macOS: posix_spawn(..., setsid=True)

2020-07-30 Thread Ronald Oussoren


Ronald Oussoren  added the comment:

That's this issue.

FWIW: I'm slowly working on a patch to build on macOS 11 and deploy to macOS 
10.9 or later, the current rough and untested PR is at 
https://github.com/python/cpython/pull/21583. 

This needs testing and cleanup before it can be considered for merging.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40075] _tkinter PythonCmd fails to acquire GIL

2020-07-30 Thread Thomas Holder


Thomas Holder  added the comment:

Attaching an even simpler example which doesn't use PyQt. It shows a native 
Windows dialog using ctypes. I could not reproduce the crash without showing 
any non-tk dialog.

Steve's explanation sounds plausible.

--
Added file: https://bugs.python.org/file49349/simple_tk_demo.py

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41440] os.cpu_count doesn't work on VxWorks RTOS

2020-07-30 Thread Peixing Xin


Change by Peixing Xin :


--
keywords: +patch
pull_requests: +20828
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/21685

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41440] os.cpu_count doesn't work on VxWorks RTOS

2020-07-30 Thread Peixing Xin


New submission from Peixing Xin :

Now os.cpu_count() always returns NONE on VxWorks RTOS. It needs to be fixed 
particularly for VxWorks.

--
components: Library (Lib)
messages: 374601
nosy: pxinwr
priority: normal
severity: normal
status: open
type: enhancement
versions: Python 3.10

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41439] some test cases in test_uuid.py and test_ssl.py fail on some operating systems because of no os.fork support

2020-07-30 Thread Peixing Xin


Change by Peixing Xin :


--
keywords: +patch
pull_requests: +20827
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/21684

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40045] Make "dunder" method documentation easier to locate

2020-07-30 Thread Hilit Oreny


Hilit Oreny  added the comment:

This issue has been resolved (thanks to @javadmokhtari and @nanjekyejoannah), 
but its Status is still "open" and the Resolution is blank...
Members of Python triage team, please change the Status to "closed" and  the 
Resolution to "fixed".
Thank you!

--
nosy: +HO

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41439] some test cases in test_uuid.py and test_ssl.py fail on some operating systems because of no os.fork support

2020-07-30 Thread Peixing Xin


New submission from Peixing Xin :

Some operating systems, for example VxWorks RTOS, don't support fork(). Some 
test cases that depend on os.fork() will fail. 
test_ssl.BasicSocketTests.test_random_fork and 
test_uuid.TestUUIDWithExtModule.testIssue8621 fail are this case.

--
components: Tests
messages: 374599
nosy: pxinwr
priority: normal
severity: normal
status: open
title: some test cases in test_uuid.py and test_ssl.py fail on some operating 
systems because of no os.fork support
type: behavior
versions: Python 3.10

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com