[issue30951] Documentation error in inspect module

2020-03-22 Thread laike9m


Change by laike9m :


--
nosy: +laike9m

___
Python tracker 

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



[issue1635741] Py_Finalize() doesn't clear all Python objects at exit

2020-03-22 Thread hai shi


hai shi  added the comment:

> I noticed that caches on Lib/encodings/__init__.py and codec_search_cach of 
> PyInterpreterState are the places holding the refs. I removed those caches 
> and number went do to.

Good Catch, Paulo.
IMHO, caches is useful in codecs(it's improve the search efficiency).

I have two humble idea:
1. Clean all item of codec_search_xxx in `Py_Finalize()`;
2. change the refcount mechanism(in this case, refcount+1 or refcount+2 make no 
differenct);

--

___
Python tracker 

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



Re: How to copy paragraphs (with number formatting) and images from Words (.docx) and paste into Excel (.xlsx) using Python

2020-03-22 Thread A S
On Monday, 23 March 2020 01:58:38 UTC+8, Beverly Pope  wrote:
> > On Mar 22, 2020, at 9:47 AM, A S  wrote:
> > 
> > I can't seem to paste pictures into this discussion so please see both my 
> > current and desired Excel output here:
> > 
> > https://stackoverflow.com/questions/60800494/how-to-copy-paragraphs-with-number-formatting-and-images-from-words-docx-an
> >  
> > 
> Did you try using the 2 part answer on the stackoverflow webpage?
> 
> Bev in TX

I'm able to get the paragraphs copied correctly now! But i'm trying to figure 
out if there's a way to copy and paste the images into the Excel, along with 
the paragraphs as well. Do you have an idea? :)
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue40028] Math module method to find prime factors for non-negative int n

2020-03-22 Thread Tim Peters


Tim Peters  added the comment:

Jonathan, _almost_ no factoring algorithms have any use for a table of primes.  
Brute force trial division can use one, but that's about it.

A table of primes _is_ useful for implementing functions related to pi(x) = the 
number of primes <= x, and the bigger the table the better.  But that's not 
what this report is about.

Raymond, spinning up a process to factor a small integer is pretty wildly 
expensive and clumsy - even if you're on a box with gfactor.  This is the kind 
of frequently implemented thing where someone who knows what they're doing can 
easily whip up relatively simple Python code that's _far_ better than what most 
users come up with on their own.  For example, to judge from many stabs I've 
seen on StackOverflow, most users don't even realize that trial division can be 
stopped when the trial divisor exceeds the square root of what remains of the 
integer to be factored.

Trial division alone seems perfectly adequate for factoring 32-bit ints, even 
at Python speed, and even if it merely skips multiples of 2 and 3 (except, of 
course, for 2 and 3 themselves).

Pollard rho seems perfectly adequate for factoring 64-bit ints that _are_ 
composite (takes time roughly proportional to the square root of the smallest 
factor), but really needs to be backed by a fast "is it a prime?" test to avoid 
taking "seemingly forever" if fed a large prime.

To judge from the docs I could find, that's as far as gfactor goes too.  Doing 
that much in Python isn't a major project.  Arguing about the API would consume 
10x the effort ;-)

--

___
Python tracker 

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



Re: Like c enumeration in python3 [ERRATA]

2020-03-22 Thread DL Neil via Python-list

On 23/03/20 3:32 PM, Paulo da Silva wrote:

Às 02:18 de 23/03/20, Paulo da Silva escreveu:

Hi!


Olá,



Suppose a class C.
I want something like this:

class C:
KA=0
KB=1

KC=2

...
Kn=n

def __init__ ...
...


These constants come from an enum in a .h (header of C file).
They are many and may change from time to time.
Is there a way to somehow define them from inside __init__ giving for
example a list of names as strings?
There is an additional problem: C is not recognized inside __init__!



Please read the PSL docs carefully, because Python's enums seem to 
differ from those in other languages - sometimes in significant ways, 
and sometimes in a subtle manner!



I have been asking similar questions recently - particularly wanting to 
(also) use the "strings", because of the effort of upgrading many 
modules of code at the same time (the manual, or was it the PEP(?) 
refers to the need to upgrade the PSL to use enums, and to the effort 
that might cost - I suggest there has been little/v.slow take-up, but 
then keeping the PSL updated is a subject of a great many conversations, 
elsewhere).


Python's enums cannot be changed. Once set, C.KA cannot be changed to 1 
(for example). We may not add element Km (where m>n) at some later 
occasion after class definition-time (in fact the __new__() constructor 
is 're-wired' in order to prohibit its use post-definition). It is not 
permitted to sub-class an existing enum class, eg C(), perhaps to 
enlarge it with more members, if the 'super class' contains "members".


There is usually no need for an __init__. Plus, I've had a distinct lack 
of satisfaction playing with that - but YMMV!


Sub-classing, and even attempting to use the meta-class seems to be a 
major challenge (see StackOverflow).


It is possible to list the elements using the built-in iterator:

for c in C: print( c )

or iterator-conversion:

list( C )

and/or accessing the class's 'data-dict' directly:

for name, value in C.__members__.items():
--
Regards =dn
--
https://mail.python.org/mailman/listinfo/python-list


Re: Like c enumeration in python3 [ERRATA]

2020-03-22 Thread Paulo da Silva
Às 02:18 de 23/03/20, Paulo da Silva escreveu:
> Hi!
> 
> Suppose a class C.
> I want something like this:
> 
> class C:
>   KA=0
>   KB=1
KC=2
>   ...
>   Kn=n
> 
>   def __init__ ...
>   ...
> 
> 
> These constants come from an enum in a .h (header of C file).
> They are many and may change from time to time.
> Is there a way to somehow define them from inside __init__ giving for
> example a list of names as strings?
> There is an additional problem: C is not recognized inside __init__!
Of course I'm talking about C class name, not C language.
> 
> Thanks.
> 

-- 
https://mail.python.org/mailman/listinfo/python-list


Like c enumeration in python3

2020-03-22 Thread Paulo da Silva
Hi!

Suppose a class C.
I want something like this:

class C:
KA=0
KB=1
KC=1
...
Kn=n

def __init__ ...
...


These constants come from an enum in a .h (header of C file).
They are many and may change from time to time.
Is there a way to somehow define them from inside __init__ giving for
example a list of names as strings?
There is an additional problem: C is not recognized inside __init__!

Thanks.
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue37319] Deprecate using random.randrange() with non-integers

2020-03-22 Thread Tim Peters


Tim Peters  added the comment:

I have scant memory of working on this code.  But back then Python wasn't at 
all keen to enforce type checking in harmless contexts.  If, e.g., someone 
found it convenient to pass integers that happened to be in float format to 
randrange(), why not?  Going "tsk, tsk, tsk" won't help them get their work 
done ;-)

If we were restarting from scratch, I'd be happy enough to say "screw floats 
here - _and_ screw operator.index() - this function requires ints, period".  
But, as is, I see insufficient benefit to potentially making code that's been 
working fine for decades "deprecated".

Yes, I realize the code may eventually become marginally faster then.  That 
doesn't, to my eyes, outweigh the certainty of annoying some users.

--
assignee: tim.peters -> 

___
Python tracker 

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



[issue1635741] Py_Finalize() doesn't clear all Python objects at exit

2020-03-22 Thread Paulo Henrique Silva


Paulo Henrique Silva  added the comment:

About half of the remaining refs are related to encodings. I noticed that 
caches on Lib/encodings/__init__.py and codec_search_cach of PyInterpreterState 
are the places holding the refs. I removed those caches and number went do to:

Before: 4382 refs left
After : 2344 refs left (-46%)

The way to destroy codec_search_cache was recently changed on #36854 and $38962.

(Not proposing to merge this, but my changes are at 
https://github.com/python/cpython/compare/master...phsilva:remove-codec-caches).

--

___
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-03-22 Thread Kyle Stanley


Change by Kyle Stanley :


--
priority: normal -> low

___
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-03-22 Thread Kyle Stanley


New submission from Kyle Stanley :

In a recent python-ideas thread, the rule of dunder methods being reserved for 
Python internal usage only was brought up 
(https://mail.python.org/archives/list/python-id...@python.org/message/GMRPSSQW3SXNCP4WU7SYDINL67M2WLQI/),
 due to an author of a third party library using them without knowing better. 
Steven D'Aprano linked the following section of the docs that defines the rule: 
https://docs.python.org/3/reference/lexical_analysis.html#reserved-classes-of-identifiers.
 

When I had attempted to search for the rule in the documentation (prior to the 
above discussion), I noticed that it was rather difficult to discover because 
it was written just as "System-defined names" with no mention of "dunder" 
(which is what the dev community typically refers to them as, at least in more 
recent history).

To make it easier for the average user and library maintainer to locate this 
section, I propose changing the first line to one of the following:

1) System-defined names, also known as "dunder" names.
2) System-defined names, informally known as "dunder" names.

I'm personally in favor of (1), but I could also see a reasonable argument for 
(2). If we can decide on the wording, it would make for a good first-time PR to 
the CPython docs.

--
assignee: docs@python
components: Documentation
keywords: easy, newcomer friendly
messages: 364832
nosy: aeros, docs@python
priority: normal
severity: normal
status: open
title: Make "dunder" method documentation easier to locate
type: enhancement
versions: Python 3.8, Python 3.9

___
Python tracker 

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



[issue21760] inspect documentation describes module type inaccurately

2020-03-22 Thread Furkan Önder

Furkan Önder  added the comment:

I sent a PR to fix a __file__ description.
https://github.com/python/cpython/pull/19097

--

___
Python tracker 

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



[issue40043] RegExp Conditional Construct (?(id/name)yes-pattern|no-pattern) Problem

2020-03-22 Thread SilentGhost


SilentGhost  added the comment:

Leon, this most likely is not a bug, not because what's stated in 
documentation, but because you're most likely not testing what you think you 
do. Here is the test that you should be doing:

>>> re.match(r'(<)?(\w+@\w+(?:\.\w+)+)(?(1)>|$)', '>>

No match. If there is a different output in your setup, please provide both the 
output and the details of your system and Python installation.

--
nosy: +SilentGhost
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



[issue15436] __sizeof__ is not documented

2020-03-22 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

> I can add those changes if someone didn't take it already?

I think we've decided that this is an implementation specific detail.

--
resolution:  -> not a bug
stage: needs patch -> 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



[issue10572] Move test sub-packages to Lib/test

2020-03-22 Thread Ido Michael


Ido Michael  added the comment:

GH-18727

Only tkinter module for start.

--

___
Python tracker 

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



[issue35885] configparser: indentation

2020-03-22 Thread Ido Michael


Ido Michael  added the comment:

@SilentGhost Added documentation to the module and a test for a give space 
indent in the module test.

--

___
Python tracker 

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



[issue15436] __sizeof__ is not documented

2020-03-22 Thread Ido Michael


Change by Ido Michael :


--
nosy:  -Ido Michael

___
Python tracker 

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



[issue38856] asyncio ProactorEventLoop: wait_closed() can raise ConnectionResetError

2020-03-22 Thread Ido Michael


Change by Ido Michael :


--
nosy:  -Ido Michael

___
Python tracker 

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



[issue39107] Upgrade tcl/tk to 8.6.10 (Windows and maxOS)

2020-03-22 Thread Ido Michael


Change by Ido Michael :


--
nosy:  -Ido Michael

___
Python tracker 

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



[issue22490] Using realpath for __PYVENV_LAUNCHER__ makes Homebrew installs fragile

2020-03-22 Thread Jason R. Coombs


Jason R. Coombs  added the comment:

I've filed [Homebrew/brew#7204](https://github.com/Homebrew/brew/issues/7204) 
to track the testing/validation of this change against Homebrew.

--

___
Python tracker 

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



[issue39989] Output closing parenthesis in ast.dump() on separate line

2020-03-22 Thread Anthony Sottile


Anthony Sottile  added the comment:

fwiw, astpretty's output looks like the black output: 
https://github.com/asottile/astpretty

>>> astpretty.pprint(ast.parse('if x == y: y += 4').body[0])
If(
lineno=1,
col_offset=0,
test=Compare(
lineno=1,
col_offset=3,
left=Name(lineno=1, col_offset=3, id='x', ctx=Load()),
ops=[Eq()],
comparators=[Name(lineno=1, col_offset=8, id='y', ctx=Load())],
),
body=[
AugAssign(
lineno=1,
col_offset=11,
target=Name(lineno=1, col_offset=11, id='y', ctx=Store()),
op=Add(),
value=Num(lineno=1, col_offset=16, n=4),
),
],
orelse=[],
)

--
nosy: +Anthony Sottile

___
Python tracker 

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



[issue37319] Deprecate using random.randrange() with non-integers

2020-03-22 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Using index() simplifies the code. Adding deprecation warnings complicates it. 
The PR consists of two commits, look at the first one to see how the code can 
finally look.

If you think that the deprecation is not needed, we can just keep the 
simplified version.

--

___
Python tracker 

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



[issue37319] Deprecate using random.randrange() with non-integers

2020-03-22 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

I'm generally against "fixing" things that aren't broken.  AFAICT, this has 
never been an issue for any real user over its 20 year history.  Also, the 
current PR makes the code look gross and may impact code that is currently 
working.  Tim, this is mostly your code, what do you think?

--
assignee:  -> tim.peters

___
Python tracker 

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



Re: php to python code converter

2020-03-22 Thread bobimapexa
On Friday, May 8, 2009 at 1:38:25 PM UTC+3, bvidinli wrote:
> if anybody needs:
> http://code.google.com/p/phppython/

hi
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue40018] test_ssl fails with OpenSSL 1.1.1e

2020-03-22 Thread Charalampos Stratakis


Charalampos Stratakis  added the comment:

The relevant info which seems to make the tests fail:

Properly detect EOF while reading in libssl. Previously if we hit an EOF while 
reading in libssl then we would report an error back to the application 
(SSL_ERROR_SYSCALL) but errno would be 0. We now add an error to the stack 
(which means we instead return SSL_ERROR_SSL) and therefore give a hint as to 
what went wrong.

Upstream PR: https://github.com/openssl/openssl/pull/10882

urllib3 issue: https://github.com/urllib3/urllib3/issues/1825

--
nosy: +cstratak

___
Python tracker 

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



[issue40044] Tests failing with the latest update of openssl to version 1.1.1e

2020-03-22 Thread Charalampos Stratakis


Charalampos Stratakis  added the comment:

Closing it as duplicate of https://bugs.python.org/issue40018

--
resolution:  -> duplicate
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



[issue37319] Deprecate using random.randrange() with non-integers

2020-03-22 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Many functions that accepts non-integer arguments (except float) and truncate 
them to integers emits a deprecation warning since 3.8 (see issue36048 and 
issue20092). They will be errors in 3.10 (see 37999).

--

___
Python tracker 

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



[issue40044] Tests failing with the latest update of openssl to version 1.1.1e

2020-03-22 Thread Charalampos Stratakis


New submission from Charalampos Stratakis :

The fedora rawhide buildbots started failing due to the latest update of 
openssl to version 1.1.1e.

e.g. https://buildbot.python.org/all/#/builders/607/builds/137

Changelog: https://www.openssl.org/news/cl111.txt

The relevant info which seems to make the tests fail:

Properly detect EOF while reading in libssl. Previously if we hit an EOF while 
reading in libssl then we would report an error back to the application 
(SSL_ERROR_SYSCALL) but errno would be 0. We now add an error to the stack 
(which means we instead return SSL_ERROR_SSL) and therefore give a hint as to 
what went wrong.

Upstream PR: https://github.com/openssl/openssl/pull/10882

urllib3 issue: https://github.com/urllib3/urllib3/issues/1825

--
assignee: christian.heimes
components: Library (Lib), SSL, Tests
messages: 364818
nosy: christian.heimes, cstratak
priority: normal
severity: normal
status: open
title: Tests failing with the latest update of openssl to version 1.1.1e
versions: Python 2.7, Python 3.6, Python 3.7, Python 3.8, Python 3.9

___
Python tracker 

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



[issue37319] Deprecate using random.randrange() with non-integers

2020-03-22 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


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

___
Python tracker 

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



[issue22490] Using realpath for __PYVENV_LAUNCHER__ makes Homebrew installs fragile

2020-03-22 Thread Jason R. Coombs


Change by Jason R. Coombs :


--
versions: +Python 3.9

___
Python tracker 

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



[issue22490] Using realpath for __PYVENV_LAUNCHER__ makes Homebrew installs fragile

2020-03-22 Thread Jason R. Coombs


Change by Jason R. Coombs :


--
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



[issue22490] Using realpath for __PYVENV_LAUNCHER__ makes Homebrew installs fragile

2020-03-22 Thread Jason R. Coombs


Jason R. Coombs  added the comment:


New changeset 5765acaf64cc2c52ce8a35de9407faddf6885598 by Jason R. Coombs in 
branch '3.7':
[3.7] bpo-22490: Remove __PYVENV_LAUNCHER__ from environment during launch 
(GH-9516) (GH-19111)
https://github.com/python/cpython/commit/5765acaf64cc2c52ce8a35de9407faddf6885598


--

___
Python tracker 

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



[issue40043] RegExp Conditional Construct (?(id/name)yes-pattern|no-pattern) Problem

2020-03-22 Thread Matthew Barnett


Matthew Barnett  added the comment:

The documentation is talking about whether it'll match at the current position 
in the string. It's not a bug.

--
resolution:  -> not a bug

___
Python tracker 

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



Sphinx-3.0.0b1 released.

2020-03-22 Thread Komiya Takeshi
Hi all,

We just released Sphinx-3.0.0b1.
It has many changes including incompatible ones.
Please confirm it working fine on your documents.

In detail, please see CHANGES:
https://github.com/sphinx-doc/sphinx/blob/3.0.x/CHANGES

You can use it with: pip install --pre Sphinx

Since this is a beta release, we expect that you may encounter bugs.
If you find a bug, please file an issue on Github issues:
https://github.com/sphinx-doc/sphinx/issues

Thanks,
Takeshi KOMIYA
--
Python-announce-list mailing list -- python-announce-list@python.org
To unsubscribe send an email to python-announce-list-le...@python.org
https://mail.python.org/mailman3/lists/python-announce-list.python.org/

Support the Python Software Foundation:
http://www.python.org/psf/donations/


Confusing textwrap parameters, and request for RE help

2020-03-22 Thread Chris Angelico
When using textwrap.fill() or friends, setting break_long_words=False
without also setting break_on_hyphens=False has the very strange
behaviour that a long hyphenated word will still be wrapped. I
discovered this as a very surprising result when trying to wrap a
paragraph that contained a URL, and wanting the URL to be kept
unchanged:

import shutil, re, textwrap
w = textwrap.TextWrapper(width=shutil.get_terminal_size().columns,
initial_indent=" ", subsequent_indent=" ",
break_long_words=False)
text = ("Lorem ipsum dolor sit amet, consectetur adipiscing elit. "
"Praesent facilisis risus sed quam ultricies tempus. Vestibulum "
"quis tincidunt turpis, id euismod turpis. Etiam pellentesque sem "
"a magna laoreet sagittis. Proin id convallis odio, vel ornare "
"ipsum. Vivamus tincidunt sodales orci. Proin egestas sollicitudin "
"viverra. Etiam egestas, erat ac elementum tincidunt, risus nisl "
"fermentum ex, ut iaculis lorem quam vel erat. Pellentesque "
"condimentum ipsum varius ligula volutpat, sit amet pulvinar ipsum "
"condimentum. Nulla ut orci et mi sollicitudin vehicula. In "
"consectetur aliquet tortor, sed commodo orci porta malesuada. "
"Nulla urna sapien, sollicitudin et nunc et, ultrices euismod "
"lorem. Curabitur tempor est mauris, a ultricies urna mattis id. "
"Nam efficitur turpis a sem tristique sagittis. "

"https://example.com/long-url-goes-here/with-multiple-parts/wider-than-your-terminal/should-not-be-wrapped
"
"more words go here")
print(w.fill(text))

Unless you also add break_on_hyphens, this will appear to ignore the
break_long_words setting. Logically, it would seem that
break_long_words=False should take precedence over break_on_hyphens -
if you're not allowed to break a long word, why break it at a hyphen?

Second point, and related to the above. The regex that defines break
points, as found in the source code, is:

wordsep_re = re.compile(r'''
( # any whitespace
  %(ws)s+
| # em-dash between words
  (?<=%(wp)s) -{2,} (?=\w)
| # word, possibly hyphenated
  %(nws)s+? (?:
# hyphenated word
  -(?: (?<=%(lt)s{2}-) | (?<=%(lt)s-%(lt)s-))
  (?= %(lt)s -? %(lt)s)
| # end of word
  (?=%(ws)s|\Z)
| # em-dash
  (?<=%(wp)s) (?=-{2,}\w)
)
)''' % {'wp': word_punct, 'lt': letter,
'ws': whitespace, 'nws': nowhitespace},

It's built primarily out of small matches with long assertions, eg
"match a hyphen, as long as it's preceded by two letters or a letter
and a hyphen". What I want to do is create a *negative* assertion:
specifically, to disallow any breaking between "\b[a-z]+://" and "\b",
which will mean that a URL will never be broken ("https://..;
until the next whitespace boundary). Regex assertions of this form
have to be fixed lengths, though, so as described, this isn't
possible. Regexperts, any ideas? How can I modify this to never break
inside a URL?

Ultimately it would be great to have a break_urls parameter
(defaulting to True, and if False, will change the RE as described),
but since I can just patch in a different RE, that would work for
current Pythons.

I'd prefer to still be able to break words on hyphens while keeping
URLs intact, but if it's not possible, I'll just deny all hyphen
breaking. Seems unnecessary though.

ChrisA
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue22490] Using realpath for __PYVENV_LAUNCHER__ makes Homebrew installs fragile

2020-03-22 Thread Jason R. Coombs


Jason R. Coombs  added the comment:


New changeset c959fa9353b92ce95dd7fe3f25fe65bacbe22338 by Miss Islington (bot) 
in branch '3.8':
bpo-22490: Remove __PYVENV_LAUNCHER__ from environment during launch (GH-9516) 
(GH-19110)
https://github.com/python/cpython/commit/c959fa9353b92ce95dd7fe3f25fe65bacbe22338


--

___
Python tracker 

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



[issue22490] Using realpath for __PYVENV_LAUNCHER__ makes Homebrew installs fragile

2020-03-22 Thread Jason R. Coombs


Change by Jason R. Coombs :


--
pull_requests: +18472
pull_request: https://github.com/python/cpython/pull/19111

___
Python tracker 

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



[issue39999] Fix some issues with AST node classes

2020-03-22 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
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



[issue39999] Fix some issues with AST node classes

2020-03-22 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset bace59d8b8e38f5c779ff6296ebdc0527f6db14a by Serhiy Storchaka in 
branch 'master':
bpo-3: Improve compatibility of the ast module. (GH-19056)
https://github.com/python/cpython/commit/bace59d8b8e38f5c779ff6296ebdc0527f6db14a


--

___
Python tracker 

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



[issue22490] Using realpath for __PYVENV_LAUNCHER__ makes Homebrew installs fragile

2020-03-22 Thread Jason R. Coombs


Jason R. Coombs  added the comment:


New changeset 044cf94f610e831464a69a8e713dad89878824ce by Ronald Oussoren in 
branch 'master':
bpo-22490: Remove __PYVENV_LAUNCHER__ from environment during launch (GH-9516)
https://github.com/python/cpython/commit/044cf94f610e831464a69a8e713dad89878824ce


--

___
Python tracker 

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



[issue22490] Using realpath for __PYVENV_LAUNCHER__ makes Homebrew installs fragile

2020-03-22 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 8.0 -> 9.0
pull_requests: +18471
pull_request: https://github.com/python/cpython/pull/19110

___
Python tracker 

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



Re: How to copy paragraphs (with number formatting) and images from Words (.docx) and paste into Excel (.xlsx) using Python

2020-03-22 Thread Beverly Pope



> On Mar 22, 2020, at 9:47 AM, A S  wrote:
> 
> I can't seem to paste pictures into this discussion so please see both my 
> current and desired Excel output here:
> 
> https://stackoverflow.com/questions/60800494/how-to-copy-paragraphs-with-number-formatting-and-images-from-words-docx-an
>  
> 
Did you try using the 2 part answer on the stackoverflow webpage?

Bev in TX
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue40043] RegExp Conditional Construct (?(id/name)yes-pattern|no-pattern) Problem

2020-03-22 Thread Leon Hampton


Leon Hampton  added the comment:

Hello,
There may be a bug in the implementation of the Conditional Construction of 
Regular Expressions, namely the (?(id/name)yes-pattern|no-pattern).
In the Regular Expression documentation 
(https://docs.python.org/3.7/library/re.html), in the portion about the 
Conditional Construct, it gives this sample pattern 
'(<)?(\w+@\w+(?:\.\w+)+)(?(1)>|$)' and states that the pattern WILL NOT MATCH 
this string ' RegExp 
Conditional Construct (?(id/name)yes-pattern|no-pattern) Problem

___
Python tracker 

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



[issue40043] Poor RegEx example for (?(id/name)yes-pattern|no-pattern)

2020-03-22 Thread Leon Hampton


New submission from Leon Hampton :

Hello,
In the 3.7.7 documentation on Regular Expression, the Conditional Construct, 
(?(id/name)yes-pattern|no-pattern), is discussed. (This is a very thorough 
document, by the way. Good job!)
One example given for the Conditional Construct does not work as described. 
Specifically, the example gives this matching pattern 
'(<)?(\w+@\w+(?:\.\w+)+)(?(1)>|$)' and states that it will NOT MATCH the string 
'

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



Re: How to incorporate environment from with python.

2020-03-22 Thread Chris Angelico
On Mon, Mar 23, 2020 at 3:24 AM Peter Otten <__pete...@web.de> wrote:
>
> Antoon Pardon wrote:
>
> > I think I can best explain what I want by showing two bash sessions:
>
> > Python 2.6.4 (r264:75706, Sep  9 2015, 15:05:38) [C] on sunos5
> > ImportError: No module named cx_Oracle
>
> > Python 2.6.7 (r267:88850, Feb 10 2012, 01:39:24) [C] on sunos5
>  import cx_Oracle
> 
>
> > As you can see the import works in the second session because I
> > had done the needed assignments and exports in bash.
>
> These seem to be different python interpreters. Maybe you just need to
> install cx_Oracle with the first one, or append the path containing
> cx_Oracle.so or whatever it's called to sys.path.

I think everything else is irrelevant, and this is the only part that
matters. Why are there two distinct builds of Python 2.6, accessed via
the exact same path? What's going on here?

(Also, Python 2.6 is quite quite old by now. One of them was built in
2012 and hasn't been updated since. Any chance of installing something
newer?)

ChrisA
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Intermittent bug with asyncio and MS Edge

2020-03-22 Thread Barry Scott



> On 22 Mar 2020, at 09:41, Frank Millman  wrote:
> 
> On 2020-03-22 11:00 AM, Barry Scott wrote:
>>> On 22 Mar 2020, at 07:56, Frank Millman  wrote:
>>> 
>>> On 2020-03-21 8:04 PM, Barry Scott wrote:
 I'd look at the network traffic with wireshark to see if there is anything 
 different between edge and the other browsers.
>>> 
>>> You are leading me into deep waters here :-)  I have never used Wireshark 
>>> before. I have now downloaded it and am running it - it generates a *lot* 
>>> of data, most of which I do not understand yet!
>> You can tell wireshark to only capture on one interface and to only capture 
>> packets for port 80.
>> (Captureing HTTPS means you cannot decode the packets without going deeper I 
>> recall)
>> Then you can tell wireshark to decode the captured data for http to drop a 
>> lot of the lower level details.
> 
> Thanks. I am more or less doing that. Interestingly the [RST,ACK] messages 
> appear on the tcp packets, so if I filter on http I do not see them.
> 
>>> 
>>> One thing immediately stands out. When I run it with MS Edge and Python3.8, 
>>> it shows a lot of lines highlighted in red, with the symbols [RST,ACK]. 
>>> They do not appear when running Chrome, and they do not appear when running 
>>> Python3.7.
>> As Chris said that should not happen.
> 
> As I replied to Chris, they appear in packets sent *from* Python *to* Edge.
> 
>>> 
>>> I have another data point. I tried putting an asyncio.sleep() after sending 
>>> each file. A value of 0.01 made no difference, but a value of 0.1 makes the 
>>> problem go away.
>> What is the async wait to wait for the transmit buffers to drain?
> 
> Not sure what you are asking. I am just doing what it says in the docs -
> 
> =
> 
> write(data)
> The method attempts to write the data to the underlying socket immediately. 
> If that fails, the data is queued in an internal write buffer until it can be 
> sent.
> 
> The method should be used along with the drain() method:
> 
> stream.write(data)
> await stream.drain()
> 
> =
> 
> coroutine drain()
> Wait until it is appropriate to resume writing to the stream. Example:
> 
> writer.write(data)
> await writer.drain()
> This is a flow control method that interacts with the underlying IO write 
> buffer. When the size of the buffer reaches the high watermark, drain() 
> blocks until the size of the buffer is drained down to the low watermark and 
> writing can be resumed. When there is nothing to wait for, the drain() 
> returns immediately.
> 
> =

That you called drain() is what I was asking. I'm a Twisted user and have not 
used asyncio yet.

Barry

> 
> Frank
> -- 
> https://mail.python.org/mailman/listinfo/python-list
> 

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Intermittent bug with asyncio and MS Edge

2020-03-22 Thread Barry Scott



> On 22 Mar 2020, at 11:59, Frank Millman  wrote:
> 
> On 2020-03-22 1:01 PM, Chris Angelico wrote:
>> On Sun, Mar 22, 2020 at 12:45 AM Frank Millman  wrote:
>>> 
>>> Hi all
>>> 
>>> I have a strange intermittent bug.
>>> 
>>> The role-players -
>>>  asyncio on Python 3.8 running on Windows 10
>>>  Microsoft Edge running as a browser on the same machine
>>> 
>>> The bug does not occur with Python 3.7.
>>> It does not occur with Chrome or Firefox.
>>> It does not occur when MS Edge connects to another host on the network,
>>> running the same Python program (Python 3.8 on Fedora 31).
>> What exact version of Python 3.7 did you test? I'm looking through the
>> changes to asyncio and came across this one, which may have some
>> impact.
> 
> Python 3.7.2 (tags/v3.7.2:9a3ffc0492, Dec 23 2018, 23:09:28) [MSC v.1916 64 
> bit (AMD64)] on win32

Can you confirm that you have implemented Connection: keep-alive?
This means that the browser can send a 2nd GET on the same connection.

Barry


> 
> Frank
> 
> -- 
> https://mail.python.org/mailman/listinfo/python-list
> 

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: How to incorporate environment from with python.

2020-03-22 Thread Peter J. Holzer
On 2020-03-22 16:04:59 +0100, Antoon Pardon wrote:
> $ /opt/csw/bin/python
> Python 2.6.4 (r264:75706, Sep  9 2015, 15:05:38) [C] on sunos5
> Type "help", "copyright", "credits" or "license" for more information.

Hmm. Solaris

> As you can see the import works in the second session because I
> had done the needed assignments and exports in bash.
> 
> Now I was wondering, if I could do those kind of preparations in python.
> I would like to start python from an unprepared bash, and do the necessary
> stuff to make the import work.
> 
> I already tried changing os.environ and using os.putenv, but that didn't
> seem to work.

I remember that once upon a time setting LD_LIBRARY_PATH had no effect
on the process itself (only on child processes) on 64 bit Linux, because
the runtime saved that value before loading the first shared library.
Maybe Solaris does the same?

In this case it might help to reexec the program. Something like

if "ORACLE_HOME" not in os.environ:
# Need to set env and reexec
os.environ["ORACLE_HOME"] = ...
os.environ["LD_LIBRARY_PATH"] = ...
...

os.execv(sys.argv[0], sys.argv)

# real content starts here

hp

-- 
   _  | Peter J. Holzer| Story must make more sense than reality.
|_|_) ||
| |   | h...@hjp.at |-- Charles Stross, "Creative writing
__/   | http://www.hjp.at/ |   challenge!"


signature.asc
Description: PGP signature
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: How to incorporate environment from with python.

2020-03-22 Thread DL Neil via Python-list



On 23/03/20 4:04 AM, Antoon Pardon wrote:

I think I can best explain what I want by showing two bash sessions:

Session 1)
--

$ /opt/csw/bin/python
Python 2.6.4 (r264:75706, Sep  9 2015, 15:05:38) [C] on sunos5
Type "help", "copyright", "credits" or "license" for more information.

import cx_Oracle

Traceback (most recent call last):
   File "", line 1, in 
ImportError: No module named cx_Oracle

^D


===

Session 2)
--
$ ORACLE_OWNER=...
$ LD_LIBRARY_PATH=...
$ ORACLE_SID=...
$ TNS_ADMIN=...
$ LD_RUN_PATH=...
$ ORA_NLS33=...

$ export export LDFLAGS ORACLE_OWNER LD_LIBRARY_PATH ORACLE_SID TNS_ADMIN 
LD_RUN_PATH ORA_NLS33

$ /opt/csw/bin/python
Python 2.6.7 (r267:88850, Feb 10 2012, 01:39:24) [C] on sunos5
Type "help", "copyright", "credits" or "license" for more information.

import cx_Oracle





As you can see the import works in the second session because I
had done the needed assignments and exports in bash.

Now I was wondering, if I could do those kind of preparations in python.
I would like to start python from an unprepared bash, and do the necessary
stuff to make the import work.

I already tried changing os.environ and using os.putenv, but that didn't
seem to work.



It is possible to trap the import error using try...except.

The 'traditional' way to interrogate/modify the OS environment used 
https://docs.python.org/3/library/os.html#os.system


However, these days most prefer 
https://docs.python.org/3/library/subprocess.html


Please read the pros-and-cons carefully!
--
Regards =dn
--
https://mail.python.org/mailman/listinfo/python-list


[issue28180] Implementation of the PEP 538: coerce C locale to C.utf-8

2020-03-22 Thread Matej Cepl


Matej Cepl  added the comment:

Thank you very much for the hint. Do I have to include the patch for bpo-19977 
only (that would be easy), or also all twelve PRs for bpo-29240 (that would 
probably broke my will to do it)?

--

___
Python tracker 

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



Re: How to incorporate environment from with python.

2020-03-22 Thread Peter Otten
Antoon Pardon wrote:

> I think I can best explain what I want by showing two bash sessions:

> Python 2.6.4 (r264:75706, Sep  9 2015, 15:05:38) [C] on sunos5
> ImportError: No module named cx_Oracle

> Python 2.6.7 (r267:88850, Feb 10 2012, 01:39:24) [C] on sunos5
 import cx_Oracle


> As you can see the import works in the second session because I
> had done the needed assignments and exports in bash.

These seem to be different python interpreters. Maybe you just need to 
install cx_Oracle with the first one, or append the path containing 
cx_Oracle.so or whatever it's called to sys.path.


-- 
https://mail.python.org/mailman/listinfo/python-list


[issue40024] Add _PyModule_AddType private helper function

2020-03-22 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 05e4a296ecc127641160a04f39cc02c0f66a8c27 by Dong-hee Na in branch 
'master':
bpo-40024: Add PyModule_AddType() helper function (GH-19088)
https://github.com/python/cpython/commit/05e4a296ecc127641160a04f39cc02c0f66a8c27


--

___
Python tracker 

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



[issue37207] Use PEP 590 vectorcall to speed up calls to range(), list() and dict()

2020-03-22 Thread STINNER Victor


STINNER Victor  added the comment:

Remaining issue: optimize list(iterable), PR 18928. I reviewed the PR and I'm 
waiting for Petr.

--

___
Python tracker 

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



[issue39148] DatagramProtocol + IPv6 does not work with ProactorEventLoop

2020-03-22 Thread Kjell Braden


Kjell Braden  added the comment:

Just to confirm, for some reason ENABLE_IPV6 is not set when compiling 
_overlapped. I'm not familiar enough with the windows build infrastructure to 
submit a PR though.

--
versions: +Python 3.9

___
Python tracker 

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



[issue39380] ftplib uses latin-1 as default encoding

2020-03-22 Thread Sebastian G Pedersen


Sebastian G Pedersen  added the comment:

Yes, I will update the PR before the end of next week.

--

___
Python tracker 

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



[issue40039] [CVE-2020-10796] Python multiprocessing Remote Code Execution vulnerability

2020-03-22 Thread Junyu Zhang


Junyu Zhang  added the comment:

Thank you for your reply, this report is indeed the situation prompted by the 
warning. There will be few problems in the single-machine deployment mode. Of 
course, it is also possible to take advantage of the possibility of elevation 
of privilege. In the distributed deployment mode, the client script is leaked. 
The resulting authkey leak will also cause RCE problems. I have an idea. If 
ManagerBase can allow users to customize the serialization operation, it may be 
greatly relieved. Your suggestion is that I need to submit this to 
secur...@python.org Report it?

--

___
Python tracker 

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



How to incorporate environment from with python.

2020-03-22 Thread Antoon Pardon
I think I can best explain what I want by showing two bash sessions:

Session 1)
--

$ /opt/csw/bin/python
Python 2.6.4 (r264:75706, Sep  9 2015, 15:05:38) [C] on sunos5
Type "help", "copyright", "credits" or "license" for more information.
>>> import cx_Oracle
Traceback (most recent call last):
  File "", line 1, in 
ImportError: No module named cx_Oracle
>>> ^D

===

Session 2)
--
$ ORACLE_OWNER=...
$ LD_LIBRARY_PATH=...
$ ORACLE_SID=...
$ TNS_ADMIN=...
$ LD_RUN_PATH=...
$ ORA_NLS33=...

$ export export LDFLAGS ORACLE_OWNER LD_LIBRARY_PATH ORACLE_SID TNS_ADMIN 
LD_RUN_PATH ORA_NLS33

$ /opt/csw/bin/python
Python 2.6.7 (r267:88850, Feb 10 2012, 01:39:24) [C] on sunos5
Type "help", "copyright", "credits" or "license" for more information.
>>> import cx_Oracle
>>>



As you can see the import works in the second session because I
had done the needed assignments and exports in bash.

Now I was wondering, if I could do those kind of preparations in python.
I would like to start python from an unprepared bash, and do the necessary
stuff to make the import work.

I already tried changing os.environ and using os.putenv, but that didn't
seem to work.

-- 
Antoon Pardon
-- 
https://mail.python.org/mailman/listinfo/python-list


How to copy paragraphs (with number formatting) and images from Words (.docx) and paste into Excel (.xlsx) using Python

2020-03-22 Thread A S
I have contract clauses in Words (.docx) format that needs to be frequently 
copy and pasted into Excel (.xlsx) to be sent to the third party. The clauses 
are often updated hence there's always a need to copy and paste these clauses 
over. I only need to copy and paste all the paragraphs and images after the 
contents page. Here is a sample of the Clause document 
(https://drive.google.com/open?id=1ZzV29R6y2q0oU3HAVrqsFa158OhvpxEK).

I have tried doing up a code using Python to achieve this outcome. Here is the 
code that I have done so far:

!pip install python-docx
import docx
import xlsxwriter

document = docx.Document("Clauses Sample.docx")
wb = xlsxwriter.Workbook('C://xx//clauses sample.xlsx')

docText = []
index_row = 0
Sheet1 = wb.add_worksheet("Shee")

for paragraph in document.paragraphs:
if paragraph.text:
docText.append(paragraph.text)
xx = '\n'.join(docText)

Sheet1.write(index_row,0, xx)

index_row = index_row+1

wb.close()
#print(xx) 
However, my Excel file output looks like this:

I can't seem to paste pictures into this discussion so please see both my 
current and desired Excel output here:

https://stackoverflow.com/questions/60800494/how-to-copy-paragraphs-with-number-formatting-and-images-from-words-docx-an
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue28859] os.path.ismount sometimes raises FileNotFoundError on Windows

2020-03-22 Thread 朱聖黎

Change by 朱聖黎 :


--
keywords: +patch
nosy: +akarei
nosy_count: 10.0 -> 11.0
pull_requests: +18470
stage: test needed -> patch review
pull_request: https://github.com/python/cpython/pull/19109

___
Python tracker 

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



[issue28180] Implementation of the PEP 538: coerce C locale to C.utf-8

2020-03-22 Thread Nick Coghlan


Nick Coghlan  added the comment:

The test cases for locale coercion *not* triggering still assume that 
bpo-19977, using surrogateescape on the standard streams in the POSIX locale, 
has been implemented (since that was implemented in Python 3.5).

Hence the various test cases complaining that they found "ascii:strict" (Py 3.4 
behaviour without bpo-19977) where they expected "ascii:surrogateescape" (the 
Py 3.5+ behaviour *with* bpo-19977).

To get a PEP 538 backport to work as intended on 3.4, you'd need to backport 
that earlier IO stream error handling change as well.

--

___
Python tracker 

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



[issue39148] DatagramProtocol + IPv6 does not work with ProactorEventLoop

2020-03-22 Thread Kjell Braden


Kjell Braden  added the comment:

I tried some debugging with Python 3.9.0a4 and it looks like unparse_address in 
overlapped.c 
(https://github.com/python/cpython/blob/v3.9.0a4/Modules/overlapped.c#L689) 
raises the error. Almost seems like ENABLE_IPV6 is not set...

--

___
Python tracker 

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



[issue40042] Enum Flag: psuedo-members have None for name attribute

2020-03-22 Thread Ethan Furman


Change by Ethan Furman :


--
type:  -> enhancement

___
Python tracker 

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



[issue40042] Enum Flag: psuedo-members have None for name attribute

2020-03-22 Thread Ethan Furman


Change by Ethan Furman :


--
assignee: ethan.furman
nosy: ethan.furman
priority: normal
severity: normal
stage: needs patch
status: open
title: Enum Flag: psuedo-members have None for name attribute
versions: Python 3.9

___
Python tracker 

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



[issue36543] Remove old-deprecated ElementTree features (part 2)

2020-03-22 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset b33e52511a59c6da7132c226b7f7489b092a33eb by Serhiy Storchaka in 
branch 'master':
bpo-36543: Remove the xml.etree.cElementTree module. (GH-19108)
https://github.com/python/cpython/commit/b33e52511a59c6da7132c226b7f7489b092a33eb


--

___
Python tracker 

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



[issue36759] datetime: astimezone() results in OSError: [Errno 22] Invalid argument

2020-03-22 Thread Ard Kuijpers


Ard Kuijpers  added the comment:

Encountered this bug on Python 3.7.6 (default, Jan  8 2020, 20:23:39) [MSC 
v.1916 64 bit (AMD64)], so on Windows 10. I can reproduce the bug with the code 
in message https://bugs.python.org/msg341149. 

It does not seem to be a duplicate of #29097 since I cannot reproduce that 
issue.

--
nosy: +Ard Kuijpers
versions: +Python 3.7

___
Python tracker 

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



[issue40037] py_compile.py quiet undefined in main function

2020-03-22 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

Closing this as duplicate. Feel free to reopen if it's a mistake. Thanks.

--
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> bad input crashes py_compile library

___
Python tracker 

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



[issue40041] Typo in argparse ja-document wrong:'append', correct:'extend'

2020-03-22 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

Japanese translation is tracked in GitHub and can be reported there. 
https://github.com/python/python-docs-ja

--
nosy: +xtreak

___
Python tracker 

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



[issue32592] Drop support of Windows Vista and 7 in Python 3.9

2020-03-22 Thread Steve Dower


Steve Dower  added the comment:

Go ahead. I think you should create three PRs (docs, tests and code), with only 
as many tests in the code PR as are needed to keep it passing.

--

___
Python tracker 

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



Re: Intermittent bug with asyncio and MS Edge

2020-03-22 Thread Frank Millman

On 2020-03-22 1:01 PM, Chris Angelico wrote:

On Sun, Mar 22, 2020 at 12:45 AM Frank Millman  wrote:


Hi all

I have a strange intermittent bug.

The role-players -
  asyncio on Python 3.8 running on Windows 10
  Microsoft Edge running as a browser on the same machine

The bug does not occur with Python 3.7.
It does not occur with Chrome or Firefox.
It does not occur when MS Edge connects to another host on the network,
running the same Python program (Python 3.8 on Fedora 31).


What exact version of Python 3.7 did you test? I'm looking through the
changes to asyncio and came across this one, which may have some
impact.


Python 3.7.2 (tags/v3.7.2:9a3ffc0492, Dec 23 2018, 23:09:28) [MSC v.1916 
64 bit (AMD64)] on win32


Frank

--
https://mail.python.org/mailman/listinfo/python-list


Re: Intermittent bug with asyncio and MS Edge

2020-03-22 Thread Kouli
The RST from Python is probably caused here by HTTP 1.1 server closing TCP
connection without signalling "Connection: Close" in response headers: a
fast HTTP client will send another HTTP request before its TCP stack
detects the connection is being closed - and packets containing this new
requests will be replied with RST.

When you delay your response (as you mentioned), the Edge browser probably
opens more HTTP connections and will not send more HTTP requests in a
single connection as described above.

You should search for the cause Python closes the TCP connection (instead
of waiting for another HTTP request).

Kouli

On Sun, Mar 22, 2020 at 12:04 PM Chris Angelico  wrote:

> On Sun, Mar 22, 2020 at 12:45 AM Frank Millman  wrote:
> >
> > Hi all
> >
> > I have a strange intermittent bug.
> >
> > The role-players -
> >  asyncio on Python 3.8 running on Windows 10
> >  Microsoft Edge running as a browser on the same machine
> >
> > The bug does not occur with Python 3.7.
> > It does not occur with Chrome or Firefox.
> > It does not occur when MS Edge connects to another host on the network,
> > running the same Python program (Python 3.8 on Fedora 31).
>
> What exact version of Python 3.7 did you test? I'm looking through the
> changes to asyncio and came across this one, which may have some
> impact.
>
> https://bugs.python.org/issue36801
>
> Also this one made a change that introduced a regression that was
> subsequently fixed. Could be interesting.
>
> https://bugs.python.org/issue36802
>
> What happens if you try awaiting your writes? I think it probably
> won't make any difference, though - from my reading of the source, I
> believe that "await writer.write(...)" is the same as
> "writer.write(...); await writer.drain()", so it's going to be exactly
> the same as you're already doing.
>
> ChrisA
> --
> https://mail.python.org/mailman/listinfo/python-list
>
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue40041] Typo in argparse ja-document wrong:'append', correct:'extend'

2020-03-22 Thread Yasunobu Imamura


New submission from Yasunobu Imamura :

In Japanese document of argparse,

https://docs.python.org/ja/3/library/argparse.html

In explain of action,

ENGLISH DOCUMENT: ..., 'append', ..., 'extend'
JAPANESE DOCUMENT: ..., 'append', ..., 'append'

So, Japanese document is wrong.

--
assignee: docs@python
components: Documentation
messages: 364797
nosy: Yasunobu Imamura, docs@python
priority: normal
severity: normal
status: open
title: Typo in argparse ja-document wrong:'append', correct:'extend'
type: enhancement
versions: Python 3.9

___
Python tracker 

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



Re: Python 3.8.2 on MacOSX Sierra?

2020-03-22 Thread Greg Ewing

On 22/03/20 10:20 pm, Greg Ewing wrote:

I'm going to try again with XCode 8, which purportedly comes
with a 10.12 SDK, and see if that fixes it.


It does.

--
Greg

--
https://mail.python.org/mailman/listinfo/python-list


Re: Intermittent bug with asyncio and MS Edge

2020-03-22 Thread Chris Angelico
On Sun, Mar 22, 2020 at 12:45 AM Frank Millman  wrote:
>
> Hi all
>
> I have a strange intermittent bug.
>
> The role-players -
>  asyncio on Python 3.8 running on Windows 10
>  Microsoft Edge running as a browser on the same machine
>
> The bug does not occur with Python 3.7.
> It does not occur with Chrome or Firefox.
> It does not occur when MS Edge connects to another host on the network,
> running the same Python program (Python 3.8 on Fedora 31).

What exact version of Python 3.7 did you test? I'm looking through the
changes to asyncio and came across this one, which may have some
impact.

https://bugs.python.org/issue36801

Also this one made a change that introduced a regression that was
subsequently fixed. Could be interesting.

https://bugs.python.org/issue36802

What happens if you try awaiting your writes? I think it probably
won't make any difference, though - from my reading of the source, I
believe that "await writer.write(...)" is the same as
"writer.write(...); await writer.drain()", so it's going to be exactly
the same as you're already doing.

ChrisA
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue40031] Python Configure IDLE 'Ok' and 'Apply' buttons do not seem to work.

2020-03-22 Thread Saaheer Purav


Saaheer Purav  added the comment:

I have tried everything like going to the .idlerc folder and making changes, 
but nothing worked. Finally, I had to change the original config files and it 
worked because Python is assuming that another theme which I put under 'IDLE 
Classic' is the original one. Also, the key for run-module(F5) doesn't work. In 
the original config file, the key for run-module is . However, Python 
does not read only that particular line and in the configure IDLE it shows that 
the field for run-module is empty.

--

___
Python tracker 

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



[issue39148] DatagramProtocol + IPv6 does not work with ProactorEventLoop

2020-03-22 Thread Kjell Braden


Change by Kjell Braden :


Removed file: https://bugs.python.org/file48996/udp_ipv6_server.py

___
Python tracker 

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



[issue39148] DatagramProtocol + IPv6 does not work with ProactorEventLoop

2020-03-22 Thread Kjell Braden


Change by Kjell Braden :


--
nosy: +kbr
Added file: https://bugs.python.org/file48996/udp_ipv6_server.py

___
Python tracker 

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



[issue40040] ProactorEventLoop fails on recvfrom with IPv6 sockets

2020-03-22 Thread Kjell Braden


Kjell Braden  added the comment:

sorry - is a duplicate of https://bugs.python.org/issue39148

--
resolution:  -> duplicate
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



Re: Intermittent bug with asyncio and MS Edge

2020-03-22 Thread Chris Angelico
On Sun, Mar 22, 2020 at 8:42 PM Frank Millman  wrote:
>
> On 2020-03-22 11:00 AM, Barry Scott wrote:
> >
> >
> >> On 22 Mar 2020, at 07:56, Frank Millman  wrote:
> >>
> >> On 2020-03-21 8:04 PM, Barry Scott wrote:
> >>> I'd look at the network traffic with wireshark to see if there is 
> >>> anything different between edge and the other browsers.
> >>
> >> You are leading me into deep waters here :-)  I have never used Wireshark 
> >> before. I have now downloaded it and am running it - it generates a *lot* 
> >> of data, most of which I do not understand yet!
> >
> > You can tell wireshark to only capture on one interface and to only capture 
> > packets for port 80.
> > (Captureing HTTPS means you cannot decode the packets without going deeper 
> > I recall)
> >
> > Then you can tell wireshark to decode the captured data for http to drop a 
> > lot of the lower level details.
> >
>
> Thanks. I am more or less doing that. Interestingly the [RST,ACK]
> messages appear on the tcp packets, so if I filter on http I do not see
> them.
>

I'm not 100% sure what "filter on HTTP" actually means, and it might
show only the data packets. Instead, filter on "from port 80 or to
port 80", which should show you the entire connection including the
SYN - SYN/ACK - ACK handshake, every data and acknowledgement packet,
and then whichever closing sequence gets used.

> >> I have another data point. I tried putting an asyncio.sleep() after 
> >> sending each file. A value of 0.01 made no difference, but a value of 0.1 
> >> makes the problem go away.
> >
> > What is the async wait to wait for the transmit buffers to drain?
> >
>
> Not sure what you are asking. I am just doing what it says in the docs -
>

I think his question is "what would asyncio be sleeping for, since you
already made it wait till it was drained". And my guess is that
there's a bug somewhere; the question is where.

ChrisA
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Intermittent bug with asyncio and MS Edge

2020-03-22 Thread Chris Angelico
On Sun, Mar 22, 2020 at 8:30 PM Frank Millman  wrote:
>
> On 2020-03-22 10:45 AM, Chris Angelico wrote:
> > On Sun, Mar 22, 2020 at 6:58 PM Frank Millman  wrote:
> >>> I'd look at the network traffic with wireshark to see if there is 
> >>> anything different between edge and the other browsers.
> >>>
> >>
> >> You are leading me into deep waters here :-)  I have never used
> >> Wireshark before. I have now downloaded it and am running it - it
> >> generates a *lot* of data, most of which I do not understand yet!
> >>
> >> One thing immediately stands out. When I run it with MS Edge and
> >> Python3.8, it shows a lot of lines highlighted in red, with the symbols
> >> [RST,ACK]. They do not appear when running Chrome, and they do not
> >> appear when running Python3.7.
> >
> > Interesting. RST means "Reset" and is sent when the connection is
> > closed. Which direction were these packets sent (Edge to Python or
> > Python to Edge)? You can tell by the source and destination ports -
> > one of them is going to be the port Python is listening on (eg 80 or
> > 443), so if the destination port is 80, it's being sent *to* Python,
> > and if the source port is 80, it's being sent *from* Python.
> >
>
> They are all being sent *from* Python *to* Edge.

Very interesting indeed. What that *might* mean is that Python is
misinterpreting something and then believing that the connection has
been closed, so it responds "Okay, I'm closing the connection". Or
possibly it sees some sort of error condition.

> >> I have another data point. I tried putting an asyncio.sleep() after
> >> sending each file. A value of 0.01 made no difference, but a value of
> >> 0.1 makes the problem go away.
> >
> > Interesting also.
> >
> > Can you recreate the problem without Edge? It sounds like something's
> > going on with concurrent transfers, so it'd be awesome if you can
> > replace Edge with another Python program, and then post both programs.
> >
>
> Do you mean write a program that emulates a browser - make a connection,
> receive the HTML page, send a GET request for each file, and receive the
> results?
>
> I will give it a go!

Yes - although the HTML page is most likely irrelevant. You could just
make a connection and then spam requests. Or make multiple
connections.

Actually, that's another thing worth checking. Is Edge using a single
connection for all requests, or separate connections for each request,
or something in between (eg a pool of four connections and spreading
requests between them)? You'll be able to recognize different
connections by the port numbers Edge uses, which are guaranteed unique
among concurrent connections, and are most likely to not be reused for
a while even if the other is closed.

> > Also of interest: Does the problem go away if you change "Connection:
> > Keep-Alive" to "Connection: Close" in your headers?
> >
>
> Yes, the problem does go away.
>

This makes me think that the answer to the previous question is going
to involve some connection reuse.

If you can recreate the problem with a single socket and multiple
requests, that would be extremely helpful. I also think it's highly
likely that this is the case.

My theory: Your program is sending a large amount of data to the lower
level API functions, which attempt to send a large amount of data to
the socket. At some point, something gets told "sorry, can't handle
all that data, hold some of it back" at a time when it's not prepared
to do so, and it misinterprets it as an error. This error results in
the connection being closed.

But that's just a theory.

ChrisA
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue40040] ProactorEventLoop fails on recvfrom with IPv6 sockets

2020-03-22 Thread Kjell Braden


New submission from Kjell Braden :

on Windows 10 with Python 3.8.2 and Python 3.9.0a4, the ProactorEventLoop 
raises "OSError: [WinError 87] The parameter is incorrect" when recvfrom on an 
AF_INET6 socket returns data:


DEBUG:asyncio:Using proactor: IocpProactor
INFO:asyncio:Datagram endpoint local_addr=('::', 1) remote_addr=None 
created: (<_ProactorDatagramTransport fd=288>, <__main__.Prot object at 
0x028739A09580>)
ERROR:root:error_received
Traceback (most recent call last):
  File "...\Python\Python39\lib\asyncio\proactor_events.py", line 548, in 
_loop_reading
res = fut.result()
  File "...\Python\Python39\lib\asyncio\windows_events.py", line 808, in _poll
value = callback(transferred, key, ov)
  File "...\Python\Python39\lib\asyncio\windows_events.py", line 496, in 
finish_recv
return ov.getresult()
OSError: [WinError 87] The parameter is incorrect


The same code works without issues on python 3.7 or when using 
WindowsSelectorEventLoopPolicy.

--
components: asyncio
files: udp_ipv6_server.py
messages: 364794
nosy: asvetlov, kbr, yselivanov
priority: normal
severity: normal
status: open
title: ProactorEventLoop fails on recvfrom with IPv6 sockets
type: behavior
versions: Python 3.8, Python 3.9
Added file: https://bugs.python.org/file48995/udp_ipv6_server.py

___
Python tracker 

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



[issue32592] Drop support of Windows Vista and 7 in Python 3.9

2020-03-22 Thread C.A.M. Gerlach


C.A.M. Gerlach  added the comment:

Hey, any update on this? As I mentioned, I'm willing to implement everything I 
mention here in one or more PRs, but I wanted to wait for a go-ahead in case 
some of the changes were not desired. Let me know and I'll go ahead. Thanks!

--

___
Python tracker 

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



Re: Intermittent bug with asyncio and MS Edge

2020-03-22 Thread Frank Millman

On 2020-03-22 11:00 AM, Barry Scott wrote:




On 22 Mar 2020, at 07:56, Frank Millman  wrote:

On 2020-03-21 8:04 PM, Barry Scott wrote:

I'd look at the network traffic with wireshark to see if there is anything 
different between edge and the other browsers.


You are leading me into deep waters here :-)  I have never used Wireshark 
before. I have now downloaded it and am running it - it generates a *lot* of 
data, most of which I do not understand yet!


You can tell wireshark to only capture on one interface and to only capture 
packets for port 80.
(Captureing HTTPS means you cannot decode the packets without going deeper I 
recall)

Then you can tell wireshark to decode the captured data for http to drop a lot 
of the lower level details.



Thanks. I am more or less doing that. Interestingly the [RST,ACK] 
messages appear on the tcp packets, so if I filter on http I do not see 
them.






One thing immediately stands out. When I run it with MS Edge and Python3.8, it 
shows a lot of lines highlighted in red, with the symbols [RST,ACK]. They do 
not appear when running Chrome, and they do not appear when running Python3.7.


As Chris said that should not happen.



As I replied to Chris, they appear in packets sent *from* Python *to* Edge.



I have another data point. I tried putting an asyncio.sleep() after sending 
each file. A value of 0.01 made no difference, but a value of 0.1 makes the 
problem go away.


What is the async wait to wait for the transmit buffers to drain?



Not sure what you are asking. I am just doing what it says in the docs -

=

write(data)
The method attempts to write the data to the underlying socket 
immediately. If that fails, the data is queued in an internal write 
buffer until it can be sent.


The method should be used along with the drain() method:

stream.write(data)
await stream.drain()

=

coroutine drain()
Wait until it is appropriate to resume writing to the stream. Example:

writer.write(data)
await writer.drain()
This is a flow control method that interacts with the underlying IO 
write buffer. When the size of the buffer reaches the high watermark, 
drain() blocks until the size of the buffer is drained down to the low 
watermark and writing can be resumed. When there is nothing to wait for, 
the drain() returns immediately.


=

Frank

--
https://mail.python.org/mailman/listinfo/python-list


[issue40014] os.getgrouplist() can fail on macOS

2020-03-22 Thread hai shi


Change by hai shi :


--
nosy: +shihai1991

___
Python tracker 

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



[issue40031] Python Configure IDLE 'Ok' and 'Apply' buttons do not seem to work.

2020-03-22 Thread Saaheer Purav


Saaheer Purav  added the comment:

I use Windows 10. I had a similar issue with python 3.8.0, which is why I 
uninstalled it and installed Python 3.8.2. The issue had been cleared, but then 
after a few weeks it happened again.

--

___
Python tracker 

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



[issue4926] putenv() accepts names containing '=', return value of unsetenv() not checked

2020-03-22 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

posix_putenv_garbage no longer used on Windows.

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

___
Python tracker 

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



Re: Intermittent bug with asyncio and MS Edge

2020-03-22 Thread Frank Millman

On 2020-03-22 10:45 AM, Chris Angelico wrote:

On Sun, Mar 22, 2020 at 6:58 PM Frank Millman  wrote:

I'd look at the network traffic with wireshark to see if there is anything 
different between edge and the other browsers.



You are leading me into deep waters here :-)  I have never used
Wireshark before. I have now downloaded it and am running it - it
generates a *lot* of data, most of which I do not understand yet!

One thing immediately stands out. When I run it with MS Edge and
Python3.8, it shows a lot of lines highlighted in red, with the symbols
[RST,ACK]. They do not appear when running Chrome, and they do not
appear when running Python3.7.


Interesting. RST means "Reset" and is sent when the connection is
closed. Which direction were these packets sent (Edge to Python or
Python to Edge)? You can tell by the source and destination ports -
one of them is going to be the port Python is listening on (eg 80 or
443), so if the destination port is 80, it's being sent *to* Python,
and if the source port is 80, it's being sent *from* Python.



They are all being sent *from* Python *to* Edge.


I have another data point. I tried putting an asyncio.sleep() after
sending each file. A value of 0.01 made no difference, but a value of
0.1 makes the problem go away.


Interesting also.

Can you recreate the problem without Edge? It sounds like something's
going on with concurrent transfers, so it'd be awesome if you can
replace Edge with another Python program, and then post both programs.



Do you mean write a program that emulates a browser - make a connection, 
receive the HTML page, send a GET request for each file, and receive the 
results?


I will give it a go!


Also of interest: Does the problem go away if you change "Connection:
Keep-Alive" to "Connection: Close" in your headers?



Yes, the problem does go away.

Frank

--
https://mail.python.org/mailman/listinfo/python-list


Re: Python 3.8.2 on MacOSX Sierra?

2020-03-22 Thread Greg Ewing

On 22/03/20 9:55 pm, Barry Scott wrote:

I guess you are using an old Mac that will not update to something newer?


It's more that I don't *want* to update to something newer if I
don't have to. Also it seems very un-python-like to depend on a
specific OS version like this, which leads me to believe that
something is wrong somewhere.


if your XCode is new enough you might be able to build it with

export MACOSX_DEPLOYMENT_TARGET=10.13


Actually it seems to be more a matter of my XCode being *too*
new. I was using XCode 9, which turns out to contain an SDK
for 10.13. Which shouldn't matter, except that there seems to
be a bug in autoconf that makes it think some things are there
even though they're not:

https://bugs.python.org/issue31359

That's talking about a slightly different scenario (building
with one version and running on an older version) but I think
I'm being bitten by the same underlying issue.

I'm going to try again with XCode 8, which purportedly comes
with a 10.12 SDK, and see if that fixes it.

--
Greg

--
https://mail.python.org/mailman/listinfo/python-list


[issue39538] SystemError when set Element.attrib to non-dict

2020-03-22 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Fixed by issue39822. e.attrib = 1 now raises a TypeError.

--
resolution:  -> out of date
stage: needs patch -> resolved
status: open -> closed
versions:  -Python 2.7, Python 3.7, Python 3.8

___
Python tracker 

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



[issue40039] [CVE-2020-10796] Python multiprocessing Remote Code Execution vulnerability

2020-03-22 Thread Kubilay Kocak


Change by Kubilay Kocak :


--
nosy: +koobs

___
Python tracker 

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



Re: Intermittent bug with asyncio and MS Edge

2020-03-22 Thread Barry Scott



> On 22 Mar 2020, at 07:56, Frank Millman  wrote:
> 
> On 2020-03-21 8:04 PM, Barry Scott wrote:
>>> On 21 Mar 2020, at 13:43, Frank Millman  wrote:
>>> 
>>> Hi all
>>> 
>>> I have a strange intermittent bug.
>>> 
>>> The role-players -
>>>asyncio on Python 3.8 running on Windows 10
>>>Microsoft Edge running as a browser on the same machine
>>> 
>>> The bug does not occur with Python 3.7.
>>> It does not occur with Chrome or Firefox.
>>> It does not occur when MS Edge connects to another host on the network, 
>>> running the same Python program (Python 3.8 on Fedora 31).
>>> 
>>> The symptoms -
>>>On receiving a connection, I send an HTML page to the browser,
>>>which has 20 lines like this -
>>> 
>>>
>>>
>>>...
>>> 
>>> Intermittently, one or other of the script files is not received by MS Edge.
>>> 
> [...]
>>> >> I don't know whether the problem lies with Python or MS Edge, but as 
> it does not happen with Python 3.7, I am suspecting that something changed in 
> 3.8 which does not match MS Edge's expectations.
>> I'd look at the network traffic with wireshark to see if there is anything 
>> different between edge and the other browsers.
> 
> You are leading me into deep waters here :-)  I have never used Wireshark 
> before. I have now downloaded it and am running it - it generates a *lot* of 
> data, most of which I do not understand yet!

You can tell wireshark to only capture on one interface and to only capture 
packets for port 80.
(Captureing HTTPS means you cannot decode the packets without going deeper I 
recall)

Then you can tell wireshark to decode the captured data for http to drop a lot 
of the lower level details.


> 
> One thing immediately stands out. When I run it with MS Edge and Python3.8, 
> it shows a lot of lines highlighted in red, with the symbols [RST,ACK]. They 
> do not appear when running Chrome, and they do not appear when running 
> Python3.7.

As Chris said that should not happen.

> 
> I have another data point. I tried putting an asyncio.sleep() after sending 
> each file. A value of 0.01 made no difference, but a value of 0.1 makes the 
> problem go away.

What is the async wait to wait for the transmit buffers to drain?

> 
> I will keep digging, but I thought I would post this information now in case 
> it helps with diagnosis.
> 
> Frank
> -- 
> https://mail.python.org/mailman/listinfo/python-list 
> 
Barry
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue36543] Remove old-deprecated ElementTree features (part 2)

2020-03-22 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
pull_requests: +18469
pull_request: https://github.com/python/cpython/pull/19108

___
Python tracker 

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



Re: Python 3.8.2 on MacOSX Sierra?

2020-03-22 Thread Barry Scott



> On 22 Mar 2020, at 04:47, Greg Ewing  wrote:
> 
> I'm trying to compile a framework build of Python 3.8.2 on
> MacOSX 10.12.6 (Sierra).

I guess you are using an old Mac that will not update to something newer?

> I'm getting:
> 
> ./Modules/posixmodule.c:4696:12: warning: 'utimensat' is only available on 
> macOS
>  10.13 or newer [-Wunguarded-availability-new]
>return utimensat(dir_fd, path, time, flags);
> 
> ./Modules/posixmodule.c:4721:12: warning: 'futimens' is only available on 
> macOS
>  10.13 or newer [-Wunguarded-availability-new]
>return futimens(fd, time);
> 
> And later when linking:
> 
> dyld: lazy symbol binding failed: Symbol not found: _utimensat
>  Referenced from: 
> /Local/Build/Python/Python-3.8.2/Python.framework/Versions/3.8/Python
>  Expected in: /usr/lib/libSystem.B.dylib
> 
> dyld: Symbol not found: _utimensat
>  Referenced from: 
> /Local/Build/Python/Python-3.8.2/Python.framework/Versions/3.8/Python
>  Expected in: /usr/lib/libSystem.B.dylib
> 
> make: *** [sharedinstall] Abort trap: 6
> 
> Am I out of luck? Is Python 3.8 only intended work on very recent
> versions of MacOSX?

if your XCode is new enough you might be able to build it with 

export MACOSX_DEPLOYMENT_TARGET=10.13

But I guess the result will not run.

Barry

> 
> -- 
> Greg
> -- 
> https://mail.python.org/mailman/listinfo/python-list
> 

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Intermittent bug with asyncio and MS Edge

2020-03-22 Thread Chris Angelico
On Sun, Mar 22, 2020 at 6:58 PM Frank Millman  wrote:
> > I'd look at the network traffic with wireshark to see if there is anything 
> > different between edge and the other browsers.
> >
>
> You are leading me into deep waters here :-)  I have never used
> Wireshark before. I have now downloaded it and am running it - it
> generates a *lot* of data, most of which I do not understand yet!
>
> One thing immediately stands out. When I run it with MS Edge and
> Python3.8, it shows a lot of lines highlighted in red, with the symbols
> [RST,ACK]. They do not appear when running Chrome, and they do not
> appear when running Python3.7.

Interesting. RST means "Reset" and is sent when the connection is
closed. Which direction were these packets sent (Edge to Python or
Python to Edge)? You can tell by the source and destination ports -
one of them is going to be the port Python is listening on (eg 80 or
443), so if the destination port is 80, it's being sent *to* Python,
and if the source port is 80, it's being sent *from* Python.

> I have another data point. I tried putting an asyncio.sleep() after
> sending each file. A value of 0.01 made no difference, but a value of
> 0.1 makes the problem go away.

Interesting also.

Can you recreate the problem without Edge? It sounds like something's
going on with concurrent transfers, so it'd be awesome if you can
replace Edge with another Python program, and then post both programs.

Also of interest: Does the problem go away if you change "Connection:
Keep-Alive" to "Connection: Close" in your headers?

ChrisA
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue40039] [CVE-2020-10796] Python multiprocessing Remote Code Execution vulnerability

2020-03-22 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

I am not sure if this was done but CPython has a page on reporting security 
issues that you can use for future reports so that they can be triaged before 
being public.

https://www.python.org/dev/security/

--
nosy: +vstinner

___
Python tracker 

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



[issue40039] [CVE-2020-10796] Python multiprocessing Remote Code Execution vulnerability

2020-03-22 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

Thanks for the report. Is this a case of the warning below?

https://docs.python.org/3.8/library/multiprocessing.html#multiprocessing.connection.Connection.recv

> Warning The Connection.recv() method automatically unpickles the data it 
> receives, which can be a security risk unless you can trust the process which 
> sent the message.

> Therefore, unless the connection object was produced using Pipe() you should 
> only use the recv() and send() methods after performing some sort of 
> authentication. See Authentication keys.

--
nosy: +xtreak

___
Python tracker 

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



Re: Intermittent bug with asyncio and MS Edge

2020-03-22 Thread Frank Millman

On 2020-03-21 8:04 PM, Barry Scott wrote:




On 21 Mar 2020, at 13:43, Frank Millman  wrote:

Hi all

I have a strange intermittent bug.

The role-players -
asyncio on Python 3.8 running on Windows 10
Microsoft Edge running as a browser on the same machine

The bug does not occur with Python 3.7.
It does not occur with Chrome or Firefox.
It does not occur when MS Edge connects to another host on the network, running 
the same Python program (Python 3.8 on Fedora 31).

The symptoms -
On receiving a connection, I send an HTML page to the browser,
which has 20 lines like this -



...

Intermittently, one or other of the script files is not received by MS Edge.


[...]
>> I don't know whether the problem lies with Python or MS Edge, but as 
it does not happen with Python 3.7, I am suspecting that something 
changed in 3.8 which does not match MS Edge's expectations.


I'd look at the network traffic with wireshark to see if there is anything 
different between edge and the other browsers.



You are leading me into deep waters here :-)  I have never used 
Wireshark before. I have now downloaded it and am running it - it 
generates a *lot* of data, most of which I do not understand yet!


One thing immediately stands out. When I run it with MS Edge and 
Python3.8, it shows a lot of lines highlighted in red, with the symbols 
[RST,ACK]. They do not appear when running Chrome, and they do not 
appear when running Python3.7.


I have another data point. I tried putting an asyncio.sleep() after 
sending each file. A value of 0.01 made no difference, but a value of 
0.1 makes the problem go away.


I will keep digging, but I thought I would post this information now in 
case it helps with diagnosis.


Frank

--
https://mail.python.org/mailman/listinfo/python-list


[issue40039] [CVE-2020-10796] Python multiprocessing Remote Code Execution vulnerability

2020-03-22 Thread SilentGhost


Change by SilentGhost :


--
nosy: +davin, pitrou

___
Python tracker 

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



Re: Converting program from shell to tkinter

2020-03-22 Thread Christian Gollwitzer

Hi Randall,

I assume you are asking about the Python programming language 
(tkinter??). This group discusses the Tcl programming language, from 
which Tk originates. See 2 answers below.

Xpost and Fup2 c.l.p

Christian

Am 22.03.20 um 00:59 schrieb Randall Wert:

I am trying to enhance a shell program -- you know, the kind that communicates with the 
user through simple lines of text, using print() and input() statements -- by adding a 
tkinter interface. I have successfully completed three projects using tkinter in the 
past, but this one is proving more difficult. The essence of the problem is, I want the 
program to still have the same control flow as in the "shell" program. It 
should issue messages to the user and receive their input. But tkinter seems to be purely 
designed for event-driven programs (responding to button clicks, for example).

To be more specific: It is a hangman game. The user enters different types of 
input as the program runs (choice of difficulty level, letters (guesses), Y/N 
for playing another game, etc.). I would like to be able to use a single user 
entry field for all of those purposes, and accept input from it when the user 
presses Enter, instead of having a different button for each type of user input.

I hope I am explaining it clearly. I would appreciate any tips on converting to 
a tkinter interface while maintaining the same program flow.



You must convert the program into a state machine. Luckily, both Tcl and 
Python can help you with this, in the form of a coroutine. For Tcl, take 
a look to this page


https://wiki.tcl-lang.org/page/Coroutines+for+event-based+programming

For Python, look up generators and google "asyncio tkinter".

Christian

--
https://mail.python.org/mailman/listinfo/python-list


[issue26527] CGI library - Using unicode in header fields

2020-03-22 Thread Martin Panter

Martin Panter  added the comment:

I’m not an expert on the topic, but it sounds like this might be a duplicate of 
Issue 23434, which has more discussion.

--
nosy: +martin.panter
resolution:  -> duplicate
status: open -> pending
superseder:  -> support encoded filename in Content-Disposition for HTTP in 
cgi.FieldStorage

___
Python tracker 

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