[issue43160] argparse: add extend_const action

2021-02-08 Thread Tony Lykke


Tony Lykke  added the comment:

Sorry, there's a typo in my last comment.

--store --foo a
Namespace(foo=['a', 'b', 'c'])

from the first set of examples should have been

--store --foo c
Namespace(foo=['a', 'b', 'c'])

--

___
Python tracker 

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



[issue43160] argparse: add extend_const action

2021-02-08 Thread Tony Lykke

Tony Lykke  added the comment:

Perhaps the example I added to the docs isn't clear enough and should be 
changed because you're right, that specific one can be served by store_const. 
Turns out coming up with examples that are minimal but not too contrived is 
hard! Let me try again with a longer example that hopefully shows more clearly 
how the existing action's behaviours differ from my patch.

parser = argparse.ArgumentParser()
parser.add_argument("--foo", action="append", default=[])
    parser.add_argument("--append", action="append_const", dest="foo", 
const=["a", "b"])
    parser.add_argument("--store", action="store_const", dest="foo", 
const=["a", "b"])

When run on master the following behaviour is observed:

--foo a --foo b --foo c
Namespace(foo=['a', 'b', 'c'])
--foo c --append
Namespace(foo=['c', ['a', 'b']])
--foo c --store
Namespace(foo=['a', 'b'])
--store --foo a
Namespace(foo=['a', 'b', 'c'])

If we then add the following:

parser.add_argument("--extend", action="extend_const", dest="foo", 
const=["a", "b"])

and then run it with my patch the following can be observed:

--foo c --extend
Namespace(foo=['c', 'a', 'b'])
--extend --foo c
Namespace(foo=['a', 'b', 'c'])

store_const is actually a pretty close fit, but the way it makes order 
significant (specifically in that it will silently drop prev values) seems like 
it'd be rather surprising to users and makes it a big enough footgun for this 
use case that I don't think it's a satisfactory alternative.

> I suspect users of your addition will get a surprise if they aren't careful 
> to provide a list or tuple 'const'

I did consider that, but I don't think they'd get any more of a surprise than 
for doing the same with list.extend vs list.append.

--

___
Python tracker 

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



[issue43176] Dataclasses derived from empty frozen bases skip immutability checks

2021-02-08 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +eric.smith

___
Python tracker 

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



[issue43176] Dataclasses derived from empty frozen bases skip immutability checks

2021-02-08 Thread Iurii Kemaev


New submission from Iurii Kemaev :

Dataclasses derived from empty frozen bases skip immutability checks.

Repro snippet:

```
import dataclasses

@dataclasses.dataclass(frozen=True)
class Base:
  pass

@dataclasses.dataclass
class Derived(Base):
  a: int

d = Derived(2)
# OK
```

Usecase: sometimes developers define an empty frozen base dataclass with 
detailed docs and require other dataclasses to inherit from it as a code 
contract to avoid accidental in-place modifications. 
This bug makes this strategy ineffective.

Affects all versions of Python that support dataclasses (including the backport 
for py3.6).

--
components: Library (Lib)
messages: 386695
nosy: hbq1
priority: normal
pull_requests: 23278
severity: normal
status: open
title: Dataclasses derived from empty frozen bases skip immutability checks
type: behavior
versions: Python 3.10, 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



Re: Convert MBOX thunderbird to PST outlook

2021-02-08 Thread Christian Gollwitzer

Am 08.02.21 um 11:08 schrieb J.O. Aho:


On 08/02/2021 10.22, Paul Rubin wrote:

"J.O. Aho"  writes:

I think most migrated to use IMAP like 30 years ago


That handles email but not calendar or the other stuff.  I think there
are starting to be standards for that, but no idea whether either
Thunderbird or Outlook follows them.


Yes, that is true that the IMAP don't handle the calendar, for those you 
need caldav/webcal and then maybe carddav for address books too and I do 
think those are well supported in Thunderbird, the question is more what 
the web based Outlook handles, 


For thatm you can run radicale:

https://radicale.org/3.0.html

A Python-based calendar server. Then upload your calendars there from 
Thunderbird and download them from Outlook.


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


[issue13501] Make libedit support more generic; port readline / libedit to FreeBSD

2021-02-08 Thread Kubilay Kocak


Kubilay Kocak  added the comment:

@Gregory I'm the worker owner and can coordinate buildbot worker changes with 
Zach or Victor

FreeBSD has:

editline (in FreeBSD base, installed in /usr/ )
libedit in ports/packages (installs in /usr/local)
readline in ports/packages (installs in /usr/local)

Which combination would get us the best coverage?

Also, if both libedit and readline are installed from ports, does configure 
have a preference/default or will it barf?

Primary motivation behind the questions is that the Python build system is 
notoriously flaky with respect to third party libs in various locations (we've 
had issues with gettext, ssl, expat, among a few others)

I'm happy to install whatever you'd like on the workers at your convenience to 
the tests can be run as a custom build (if they haven't been already)

--

___
Python tracker 

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



[issue43171] Counter not supported add in Python 3.x

2021-02-08 Thread Irit Katriel

Irit Katriel  added the comment:

That’s correct. This changed in python 3. See section about ordering 
comparisons in

https://docs.python.org/3.0/whatsnew/3.0.html

--
nosy: +iritkatriel
resolution:  -> not a bug
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



[issue43175] filecmp is not working for UTF-8 BOM file.

2021-02-08 Thread suresh


New submission from suresh :

Python base package filecmp is not working properly for 'UTF-8 BOM' css files.
I am using python version 3.6 and windows 10 OS.

while running the below code getting as False always.However the file content 
are same.

Code :

import filecmp
filecmp.clear_cache()
boolfile=filecmp.cmp(r'C:\Users\suresh.n\python\RPA\Page\Sowmiya\downloads\destination.txt',r'C:\Users\suresh.n\python\RPA\Page\Sowmiya\source\source,r'C:\Users\suresh.n\python\RPA\Page\Sowmiya\downloads.txt',shallow=False)
print(boolfile)

--
components: Windows
files: source.txt
hgrepos: 397
messages: 386692
nosy: paul.moore, steve.dower, suresh, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: filecmp is not working for UTF-8 BOM file.
type: behavior
versions: Python 3.6
Added file: https://bugs.python.org/file49798/source.txt

___
Python tracker 

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



[issue43173] Python Windows DLL search paths

2021-02-08 Thread Eryk Sun


Eryk Sun  added the comment:

> What's the correct way to set the DLL search path when running a python 
> script?

If possible, the simplest approach is to put dependent DLLs in the same 
directory as the extension module. 

In 3.8+, the search path for the dependent DLLs of a normally imported 
extension module includes the following directories:

* the loaded extension module's directory
* the application directory (e.g. that of python.exe)
* the user DLL search directories that get added by 
  SetDllDirectory() and AddDllDirectory(), such as with 
  os.add_dll_directory()
* %SystemRoot%\System32

Note that the above list does not include the current working directory or 
%PATH% directories.

> It would be helpful if it listed the actual name of 
> the DLL that it cannot find.

WinAPI LoadLibraryExW() doesn't have an out parameter to get the missing DLL or 
procedure name that caused the call to fail. All we have is the error code to 
report, such as ERROR_MOD_NOT_FOUND (126) and ERROR_PROC_NOT_FOUND (127). Using 
a debugger, you can see the name of the missing DLL or procedure if loader 
snaps are enabled for the application.

--
nosy: +eryksun

___
Python tracker 

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



[issue43160] argparse: add extend_const action

2021-02-08 Thread paul j3


paul j3  added the comment:

It's not clear what your patch does that the existing 'store_const' doesn't.   
Even 'append_const' does the same except for a extra level of list/tuple 
nesting.

But I'll admit that I didn't much need for  'extend' addition, but others, 
including the original developer liked it.

I suspect users of your addition will get a surprise if they aren't careful to 
provide a list or tuple 'const':

const='foobar'
const=str

--

___
Python tracker 

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



[issue43174] Windows: Use /utf-8 compiler flag

2021-02-08 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



[issue43174] Windows: Use /utf-8 compiler flag

2021-02-08 Thread Inada Naoki

New submission from Inada Naoki :

When building Python on Windows Japanese environment, several warnings are 
shown.

```
C:\Users\songo\source\repos\cpython\Modules\_sha3\kcp\KeccakSponge.h(1,1): 
warning C4819: ファイルは、現在のコード ページ (932) で表示できない文字を含んでいます。データの損失を防ぐために、ファイルを
Unicode 形式で保存してください。 
[C:\Users\songo\source\repos\cpython\PCbuild\pythoncore.vcxproj]
C:\Users\songo\source\repos\cpython\Modules\_statisticsmodule.c(1,1): warning 
C4819: ファイルは、現在のコード ページ (932) で表示できない文字を含んで います。データの損失を防ぐために、ファイルを Unico
de 形式で保存してください。 [C:\Users\songo\source\repos\cpython\PCbuild\pythoncore.vcxproj]
C:\Users\songo\source\repos\cpython\Modules\_zoneinfo.c(1,1): warning C4819: 
ファイルは、現在のコード ページ (932) で表示できない文字を含んでいます。 データの損失を防ぐために、ファイルを Unicode 形式で保存
してください。 [C:\Users\songo\source\repos\cpython\PCbuild\_zoneinfo.vcxproj]
C:\Users\songo\source\repos\cpython\Modules\_zoneinfo.c(1028,1): warning C4819: 
ファイルは、現在のコード ページ (932) で表示できない文字を含んでいます。データの損失を防ぐために、ファイルを Unicode 形式
で保存してください。 [C:\Users\songo\source\repos\cpython\PCbuild\_zoneinfo.vcxproj]
C:\Users\songo\source\repos\cpython\Modules\_zoneinfo.c(1970,1): warning C4819: 
ファイルは、現在のコード ページ (932) で表示できない文字を含んでいます。データの損失を防ぐために、ファイルを Unicode 形式
で保存してください。 [C:\Users\songo\source\repos\cpython\PCbuild\_zoneinfo.vcxproj]
C:\Users\songo\source\repos\cpython\Modules\expat\xmltok.c(1,1): warning C4819: 
ファイルは、現在のコード ページ (932) で表示できない文字を含んでいます。データの損失を防ぐために、ファイルを Unicode 形式
で保存してください。 [C:\Users\songo\source\repos\cpython\PCbuild\_elementtree.vcxproj]
C:\Users\songo\source\repos\cpython\Modules\expat\xmltok.c(1,1): warning C4819: 
ファイルは、現在のコード ページ (932) で表示できない文字を含んでいます。データの損失を防ぐために、ファイルを Unicode 形式
で保存してください。 [C:\Users\songo\source\repos\cpython\PCbuild\pyexpat.vcxproj]
C:\Users\songo\source\repos\cpython\Modules\_lzmamodule.c(1,1): warning C4819: 
ファイルは、現在のコード ページ (932) で表示できない文字を含んでいます 。データの損失を防ぐために、ファイルを Unicode 形式で
保存してください。 [C:\Users\songo\source\repos\cpython\PCbuild\_lzma.vcxproj]
```

These warnings are shown because source code is written in UTF-8 but compiler 
assume it's encoded in current code page.


I don't know what is the best way to fix the warning, but I can fix it by 
adding /utf-8 flag.


```
diff --git a/PCbuild/_zoneinfo.vcxproj b/PCbuild/_zoneinfo.vcxproj
index 6e6389c377..4602e45ce5 100644
--- a/PCbuild/_zoneinfo.vcxproj
+++ b/PCbuild/_zoneinfo.vcxproj
@@ -91,6 +91,11 @@
   
 <_ProjectFileVersion>10.0.30319.1
   
+  
+
+  /utf-8 %(AdditionalOptions)
+
+  
   
 
   
```

--
components: Build
messages: 386689
nosy: methane
priority: normal
severity: normal
status: open
title: Windows: Use /utf-8 compiler flag
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



[issue43173] Python Windows DLL search paths

2021-02-08 Thread Jeff Moguillansky


New submission from Jeff Moguillansky :

Hi,
What's the correct way to set the DLL search path when running a python script?

It seems that it doesn't search the directories specified in PATH environment 
variable. 

FYI: For debugging the DLL loading issues, I'm using "Process Monitor" from 
sysinternals:
https://docs.microsoft.com/en-us/sysinternals/downloads/procmon,
but please share any tips if you have a better approach.

Also, the Python error message is not very informative:
when loading a python module (built using Cython), if it fails to load a 
specific DLL, it says 
"import module  failed, DLL not found" but it doesn't say the name 
of the actual DLL that is not found.
It would be helpful if it listed the actual name of the DLL that it cannot find.

--
components: Windows
messages: 386688
nosy: jmoguill2, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: Python Windows DLL search paths
type: behavior
versions: Python 3.10, 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



[issue43162] Enum regression: AttributeError when accessing class variables on instances

2021-02-08 Thread Ethan Furman


Change by Ethan Furman :


--
pull_requests: +23277
pull_request: https://github.com/python/cpython/pull/24487

___
Python tracker 

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



[issue43172] Fix test_readline when compiled using --with-readline=edit

2021-02-08 Thread Gregory P. Smith


Gregory P. Smith  added the comment:

examining the behaviors being tested, it seems there are differences in 0 and 1 
based indexing behaviors between libreadline and libedit.

libedit frankly seems more consistent.  but the Python readline module docs 
document the 0 and 1 based quirks as part of the module API.  We may need to 
adjust for these based on direct libedit use vs libreadline within the module 
code.

it appears code doing such adjustments already exists on macOS (i haven't yet 
looked in the module code or if Darwin as a platform does it in their readline 
shim around libedit).

--

___
Python tracker 

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



Re: Files can only be modified in IDLE, but not via Powershell

2021-02-08 Thread MRAB

On 2021-02-08 21:33, Stefan Ritter wrote:


Hi,

It would be highly appreciated if you could offer me some advice to
solve a problem I'm currently facing:

I have a Windows 10 ADM64 desktop and a Windows 10 AMD64 Laptop.

I wrote some code to insert text in a .txt-file. It works perfectly on
my laptop.

On my desktop it works only if i run it in IDLE, the text appears
afterwards in the file . However it does not work if run it in
Powershell (or anything else), there are no changes made in the file.

I do not understand why this is the case. Python version, installation
paths and user are the same on desktop and laptop. I searched a bit and
found out that this issue might be caused by my antivirus software
comodo, but even after I replaced it with antivir, an reinstalled python
this didn't change anything.

As mentionned, any help is highly appreciated. If you need any
additional information please let me know!


It's difficult to troubleshoot with any code.
--
https://mail.python.org/mailman/listinfo/python-list


[issue42377] allow typing.cast with TYPE_CHECKING

2021-02-08 Thread Guido van Rossum


Change by Guido van Rossum :


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



[issue41824] Docs for typing.ForwardRef don't state that it was added in 3.7

2021-02-08 Thread Guido van Rossum


Guido van Rossum  added the comment:


New changeset da21f7b6e1fd5bd3e78931a06c5eb694f6335233 by Ken Jin in branch 
'master':
bpo-41824: Add versionadded for typing.ForwardRef docs (#24224)
https://github.com/python/cpython/commit/da21f7b6e1fd5bd3e78931a06c5eb694f6335233


--
nosy: +gvanrossum

___
Python tracker 

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



[issue43171] Counter not supported add in Python 3.x

2021-02-08 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +rhettinger

___
Python tracker 

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



[issue43172] Fix test_readline when compiled using --with-readline=edit

2021-02-08 Thread Gregory P. Smith


Gregory P. Smith  added the comment:

https://github.com/python/buildmaster-config/pull/229 tracks my buildbot config 
update

--

___
Python tracker 

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



[issue13501] Make libedit support more generic; port readline / libedit to FreeBSD

2021-02-08 Thread Gregory P. Smith


Gregory P. Smith  added the comment:

That seems like a good idea to prevent regressions if anyone knows how to do 
that.

For python.org/dev/'s buildbot fleet, the configuration of what configure and 
make flags happens via 
https://github.com/python/buildmaster-config/tree/master/master/custom - note 
the 'def setup' overriding that needs to be done in factories.py so that older 
branches {'3.7', '3.8', '3.9'} are not configured using the flag.

Coordinate with the owner of a particular buildbot to make sure the system has 
the requisite installed libraries and headers.

I manually tested a Linux build against libedit, it builds and works.  But 
test_readline has failures.  tracking those in 
https://bugs.python.org/issue43172

--

___
Python tracker 

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



[issue43162] Enum regression: AttributeError when accessing class variables on instances

2021-02-08 Thread Ethan Furman


Ethan Furman  added the comment:

Dylan, it's not the `from_str()` method, but the `__str__` method that is the 
problem.  Instead of

def __str__(self):
if self is self.EXITCODE: 
return 'exitcode' 

it should be

def __str__(self):

cls = self.__class__

if self is cls.EXITCODE: 
return 'exitcode'

--

___
Python tracker 

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



[issue43172] Fix test_readline when compiled using --with-readline=edit

2021-02-08 Thread Gregory P. Smith


Gregory P. Smith  added the comment:

Motivation: I want to add --with-readline=edit to the configure flags of one of 
my buildbot configs via an edit to 
https://github.com/python/buildmaster-config/tree/master/master/custom

--

___
Python tracker 

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



[issue43172] Fix test_readline when compiled using --with-readline=edit

2021-02-08 Thread Gregory P. Smith

New submission from Gregory P. Smith :

https://bugs.python.org/issue13501 added configure --with-readline=edit support 
so that the readline module can build and link against libedit on any platform 
instead of only using libreadline.

Building Python that way on Debian Linux and running test_readline results in a 
variety of test failure for me:

```
== CPython 3.10.0a5+ (heads/master-dirty:e1f7769513, Feb 9 2021, 01:20:59) [GCC 
10.2.1 20210110]
== cwd: /home/gps/oss/cpython/b/build/test_python_1681021æ
== CPU count: 16
== encodings: locale=UTF-8, FS=utf-8
0:00:00 load avg: 0.47 Run tests sequentially
0:00:00 load avg: 0.47 [1/1] test_readline
readline version: 0x402
readline runtime version: 0x402
readline library version: 'EditLine wrapper'
use libedit emulation? True
testHistoryUpdates (test.test_readline.TestHistoryManipulation) ... ERROR
test_nonascii_history (test.test_readline.TestHistoryManipulation) ... FAIL
test_write_read_append (test.test_readline.TestHistoryManipulation) ... FAIL
test_auto_history_disabled (test.test_readline.TestReadline) ... ok
test_auto_history_enabled (test.test_readline.TestReadline) ... ok
test_history_size (test.test_readline.TestReadline) ... skipped 'this readline 
version does not support history-size'
test_init (test.test_readline.TestReadline) ... ok
test_nonascii (test.test_readline.TestReadline) ... FAIL

==
ERROR: testHistoryUpdates (test.test_readline.TestHistoryManipulation)
--
Traceback (most recent call last):
  File "/home/gps/oss/cpython/gpshead/Lib/test/test_readline.py", line 59, in 
testHistoryUpdates
readline.replace_history_item(0, "replaced line")
ValueError: No history item at position 0

==
FAIL: test_nonascii_history (test.test_readline.TestHistoryManipulation)
--
Traceback (most recent call last):
  File "/home/gps/oss/cpython/gpshead/Lib/test/test_readline.py", line 127, in 
test_nonascii_history
self.assertEqual(readline.get_history_item(1), "entrée 1")
AssertionError: 'entrée 22' != 'entrée 1'
- entrée 22
?^^
+ entrée 1
?^


==
FAIL: test_write_read_append (test.test_readline.TestHistoryManipulation)
--
Traceback (most recent call last):
  File "/home/gps/oss/cpython/gpshead/Lib/test/test_readline.py", line 98, in 
test_write_read_append
self.assertEqual(readline.get_current_history_length(), 3)
AssertionError: 4 != 3

==
FAIL: test_nonascii (test.test_readline.TestReadline)
--
Traceback (most recent call last):
  File "/home/gps/oss/cpython/gpshead/Lib/test/test_readline.py", line 231, in 
test_nonascii
self.assertIn(b"indexes 11 13\r\n", output)
AssertionError: b'indexes 11 13\r\n' not found in 
bytearray(b"^A^B^B^B^B^B^B^B\t\tx\t\r\n[\xc3\xafnserted]|t\xc3\xab[after]\x08\x08\x08\x08\x08\x08\x08text
 \'t\\xeb\'\r\nline \'[\\xefnserted]|t\\xeb[after]\'\r\nindexes 10 
12\r\n\x07\r\x1b[14Gtext \'t\\xeb\'\r\nline 
\'[\\xefnserted]|t\\xeb[after]\'\r\nindexes 10 12\r\n\r\nt\xc3\xabnt 
t\xc3\xabxt\r\n\r\x1b[K[\xc3\xafnserted]|t\xc3\xab[after]\x1b[14G\r\x1b[14G\x1b[1@x[\x08\x07\r\x1b[15G\x1b[1@t[\x08\r\nresult
 \'[\\xefnserted]|t\\xebxt[after]\'\r\nhistory 
\'[\\xefnserted]|t\\xebxt[after]\'\r\n")

--

Ran 8 tests in 0.123s

FAILED (failures=3, errors=1, skipped=1)
```

I suspect these are just behavior differences in the library and some tests 
need to be skipped or test alternate behavior in this situation?

--
assignee: gregory.p.smith
components: Library (Lib), Tests
messages: 386681
nosy: gregory.p.smith
priority: normal
severity: normal
stage: needs patch
status: open
title: Fix test_readline when compiled using --with-readline=edit
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



[issue43162] Enum regression: AttributeError when accessing class variables on instances

2021-02-08 Thread Ethan Furman


Ethan Furman  added the comment:


New changeset d65b9033d6d092552775f6f5e41e7647100f9f2c by Ethan Furman in 
branch 'master':
bpo-43162: [Enum] deprecate enum member.member access (GH-24486)
https://github.com/python/cpython/commit/d65b9033d6d092552775f6f5e41e7647100f9f2c


--

___
Python tracker 

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



[issue13501] Make libedit support more generic; port readline / libedit to FreeBSD

2021-02-08 Thread Kubilay Kocak


Kubilay Kocak  added the comment:

Would we like the freebsd worker CI configurations to be modified to use 
ports/package versions of libedit (or readline, or whatever) to ensure 
converage?

Right now the defaults are used (whatever edit library that entails)

--

___
Python tracker 

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



[issue43068] test_subprocess: test_specific_shell() fails on AMD64 FreeBSD Shared 3.x

2021-02-08 Thread Kubilay Kocak


Kubilay Kocak  added the comment:

Rebuilding bash & gdb now to pickup new/updated ncurses library.

Still suggest picking up "subprocess.CalledProcessError" generically in test 
framework for tests that use subprocess/external commands

--

___
Python tracker 

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



[issue13501] Make libedit support more generic; port readline / libedit to FreeBSD

2021-02-08 Thread Gregory P. Smith


Gregory P. Smith  added the comment:

I'm closing this as I believe everything we need done is done at this point.  
Open new issues if there are remaining libedit vs libreadline things to take 
care of.

Thanks everyone!

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

___
Python tracker 

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



[issue38634] Symbol resolution conflict when embeding python in an application using libedit

2021-02-08 Thread Gregory P. Smith


Gregory P. Smith  added the comment:


New changeset e1f77695132e814728cda982f11342a2e3c7272c by Roland Hieber in 
branch 'master':
bpo-13501: allow choosing between readline and libedit (GH-24189)
https://github.com/python/cpython/commit/e1f77695132e814728cda982f11342a2e3c7272c


--

___
Python tracker 

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



[issue13501] Make libedit support more generic; port readline / libedit to FreeBSD

2021-02-08 Thread Gregory P. Smith


Gregory P. Smith  added the comment:


New changeset e1f77695132e814728cda982f11342a2e3c7272c by Roland Hieber in 
branch 'master':
bpo-13501: allow choosing between readline and libedit (GH-24189)
https://github.com/python/cpython/commit/e1f77695132e814728cda982f11342a2e3c7272c


--

___
Python tracker 

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



RE: Convert MBOX thunderbird to PST outlook

2021-02-08 Thread pjfarley3
I can recommend the commercial product Aid4Mail from my personal experience 
moving from another mbox-based email client (not Thunderbird) to Outlook 
(though that was a few years back, well before Outlook 365 became available).

Very well supported and responsive, very reasonably priced at the time I needed 
it.

HTH

Peter

> -Original Message-
> From: Kr4ck ALI 
> Sent: Monday, February 8, 2021 1:01 AM
> To: python-list@python.org
> Subject: Re: Convert MBOX thunderbird to PST outlook
> 
> I have about 1000 mailbox to migrate and all are store in local on each
> computers.
> I know PST files store contacts, calendar, tasks... So, I think that is
> possible to build a PST file with python to integrate the differents items
> (emails, calendar, tasks,...) from thunderbird files.
> 
> 
> Le lun. 8 févr. 2021 à 00:45, Cameron Simpson  a écrit :
> 
> > On 07Feb2021 15:06, Kr4ck ALI  wrote:
> > >I have to migrate multiple mailbox (emails, contacts, calendar, tasks)
> > >from thunderbird to outlook Office 365.
> >
> > I am also sorry to hear that.
> >
> > Had you considered getting them to enable IMAP access? Then you can
> > migrate just by moving messages inside Thunderbird. And you can keep
> > using your mail reader of choice.
> >
> > >I plan to export all items from thunderbird files (.mbox for email,
> > .sqlite
> > >or .sdb for calendar, .mab to contact) to PST files and import each PST
> > >files to Office 365.
> >
> > The contacts and calendar stuff I have less idea about, alas. CalDAV for
> > the calendar? I know that's a vague and unspecific suggestion.
> >
> > Cheers,
> > Cameron Simpson 
> > --
> > https://mail.python.org/mailman/listinfo/python-list
> >


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


[issue43162] Enum regression: AttributeError when accessing class variables on instances

2021-02-08 Thread Miro Hrončok

Miro Hrončok  added the comment:

Ethan, should the depreciation exist for 2 releases prior to removal?

Dylan, even in that case, I guess the proper way to access the other members is 
supposed to be type(self).FOO or ClassName.FOO, not self.FOO.

--

___
Python tracker 

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



[issue42128] Structural Pattern Matching (PEP 634)

2021-02-08 Thread Guido van Rossum


Guido van Rossum  added the comment:

The PEP has been accepted.

I propose that we use separate PRs for docs (and incremental improvements to 
the code) but tie them all together using the same issue number (this will 
require adding "skip news" to later PRs).

--

___
Python tracker 

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



[issue43162] Enum regression: AttributeError when accessing class variables on instances

2021-02-08 Thread Dylan Baker


Dylan Baker  added the comment:

Author of said meson code here. I use this pattern when the enum names and 
values are implementation details, but the string values are user visible. In 
this case the enum itself is used internally to represent what kind of test 
we're doing, but we're initializing it from user input. There might be reasons 
in the future that the names of the enum members and the string values being 
passed in aren't the same anymore, say because we map two string values to one 
enum value. I guess I could accomplish the same thing with a staticmethod or 
helper function, but the code is effectively an alternate initializer, and 
follows that pattern using a classmethod.

--
nosy: +baker.dylan.c

___
Python tracker 

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



[issue43162] Enum regression: AttributeError when accessing class variables on instances

2021-02-08 Thread Ethan Furman


Change by Ethan Furman :


--
keywords: +patch
pull_requests: +23276
stage: needs patch -> patch review
pull_request: https://github.com/python/cpython/pull/24486

___
Python tracker 

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



Files can only be modified in IDLE, but not via Powershell

2021-02-08 Thread Stefan Ritter



Hi,

It would be highly appreciated if you could offer me some advice to
solve a problem I'm currently facing:

I have a Windows 10 ADM64 desktop and a Windows 10 AMD64 Laptop.

I wrote some code to insert text in a .txt-file. It works perfectly on
my laptop.

On my desktop it works only if i run it in IDLE, the text appears
afterwards in the file . However it does not work if run it in
Powershell (or anything else), there are no changes made in the file.

I do not understand why this is the case. Python version, installation
paths and user are the same on desktop and laptop. I searched a bit and
found out that this issue might be caused by my antivirus software
comodo, but even after I replaced it with antivir, an reinstalled python
this didn't change anything.

As mentionned, any help is highly appreciated. If you need any
additional information please let me know!

Best regards,
Stefan


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


Re: Convert MBOX thunderbird to PST outlook

2021-02-08 Thread J.O. Aho



On 07/02/2021 15.06, Kr4ck ALI wrote:

Hello,

I have to migrate multiple mailbox (emails, contacts, calendar, tasks) from
thunderbird to outlook Office 365.


I'm sorry to hear that.



I plan to export all items from thunderbird files (.mbox for email, .sqlite
or .sdb for calendar, .mab to contact) to PST files and import each PST
files to Office 365.


I think most migrated to use IMAP like 30 years ago, so you tend to do 
the migration from the IMAP to IMAP server and there are usually help to 
get from the provider you move to to get all the data migrated.




My question is : Have you already make a mission like that ?


I kind of doubt this. Once alternative is that you see to enable 
IMAP/SMTP or pay for ExQuilla and let each user have their old mail on 
the computer and the new mail account will store the mail and other 
stuff remotely.


--

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


[issue13508] ctypes' find_library breaks with ARM ABIs

2021-02-08 Thread Trevor Newton


Trevor Newton  added the comment:

I am still encountering this issue when using pyudev on Python 3.8.5.

--
nosy: +trevor.newton

___
Python tracker 

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



[issue43170] wintypes.SIZE is 8bytes on 32 bit machines

2021-02-08 Thread Eryk Sun


Eryk Sun  added the comment:

The SIZE [1] type for a rectangle has nothing to do with SIZE_T [2], the 
integer type that's returned by C sizeof(). SIZE_T isn't defined in wintypes. A 
new issue can be opened to add more of the common data types to wintypes.

Here's an example for defining CreateRemoteThread:

import ctypes
from ctypes import wintypes

kernel32 = ctypes.WinDLL('kernel32', use_last_error=True)

SIZE_T = ctypes.c_size_t
LPSECURITY_ATTRIBUTES = ctypes.c_void_p
LPTHREAD_START_ROUTINE = ctypes.WINFUNCTYPE(wintypes.DWORD, wintypes.LPVOID)

kernel32.CreateRemoteThread.restype = wintypes.HANDLE
kernel32.CreateRemoteThread.argtypes = (
  wintypes.HANDLE,# hProcess
  LPSECURITY_ATTRIBUTES,  # lpThreadAttributes
  SIZE_T, # dwStackSize
  LPTHREAD_START_ROUTINE, # lpStartAddress
  wintypes.LPVOID,# lpParameter
  wintypes.DWORD, # dwCreationFlags
  wintypes.LPDWORD)   # lpThreadId

---

[1] https://docs.microsoft.com/en-us/windows/win32/api/windef/ns-windef-size
[2] 
https://docs.microsoft.com/en-us/windows/win32/winprog/windows-data-types#SIZE_T

--
nosy: +eryksun
resolution:  -> not a bug
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



[issue43156] Python windows installer has a confusing name - add setup to its name

2021-02-08 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

I agree with the idea and Matthew's version. This continuing problem is worth 
doing experiments.  I marked this as 'enhancement' and 3.10 only because this 
might break code that hardcodes the complete name.  This might also, 
unfortunately, be a reason to reject, but we have changed the installer name 
before.  Or the Windows people might decide that backports are OK.

--
nosy: +terry.reedy
type:  -> enhancement

___
Python tracker 

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



[issue43156] Python windows installer has a confusing name - add setup to its name

2021-02-08 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
components: +Installation, Windows
nosy: +paul.moore, steve.dower, tim.golden, zach.ware
stage:  -> needs patch
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



[issue43162] Enum regression: AttributeError when accessing class variables on instances

2021-02-08 Thread Miro Hrončok

Miro Hrončok  added the comment:

Thanks. In the meantime, I've opened 
https://github.com/mesonbuild/meson/issues/8318

--

___
Python tracker 

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



[issue43163] codeop prematurely raises on 2nd line when closer is needed

2021-02-08 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
keywords: +patch
pull_requests: +23275
stage: needs patch -> patch review
pull_request: https://github.com/python/cpython/pull/24483

___
Python tracker 

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



[issue43171] Counter not supported add in Python 3.x

2021-02-08 Thread Frank AK


New submission from Frank AK :

In python 3.10, you couldn't plus two Counter instance, you will got the below 
tip:

```
>>> from collections import Counter
>>> x={1:['a','b','c']}
>>> y={1:['d','e','f'],2:['g']}
>>> Counter(y) + Counter(x)
Traceback (most recent call last):
  File "", line 1, in 
  File "/Users/frank/github.com/cpython/Lib/collections/__init__.py", line 797, 
in __add__
if newcount > 0:
TypeError: '>' not supported between instances of 'list' and 'int'
```

But in Python 2, you got the desire result like :

```
>>> from collections import Counter
>>> x={1:['a','b','c']}
>>> y={1:['d','e','f'],2:['g']}
>>> Counter(x) + Counter(y)
Counter({2: ['g'], 1: ['a', 'b', 'c', 'd', 'e', 'f']})
```

--
messages: 386667
nosy: landpack
priority: normal
severity: normal
status: open
title: Counter not supported add in Python 3.x
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



Re: Python cannot count apparently

2021-02-08 Thread Michael F. Stemper

On 08/02/2021 13.12, Schachner, Joseph wrote:

This code works:
 mystr = "hello"
 for ch in mystr:
 print(ch, end="")

result is: hello

Note that the for loop does not use range.  Strings are iterable, that is they 
support Python's iteration protocol.  So, for ch in mystr: assigns one 
character from mystr to ch each time, each iteration gets the next character.
To prevent each character from appearing on a separate line (in Python 3) you need 
end="".   That is, don't put in the usual end-of-line ending.


Then you agree that the OP:


You must have done something to suppress the newlines after each call to 
print().

So it's quite obvious that the code you posted has very little to do with the 
code you ran. If you really want us to help, please directly copy and paste the 
exact code that you ran. We can't really help you with only guesses as to what 
you did.



--
Michael F. Stemper
Outside of a dog, a book is man's best friend.
Inside of a dog, it's too dark to read.
--
https://mail.python.org/mailman/listinfo/python-list


[issue43170] wintypes.SIZE is 8bytes on 32 bit machines

2021-02-08 Thread Noah Steinberg


New submission from Noah Steinberg :

Noticed while debugging a problem with a test running on Windows 10 x86 that 
sizeof(wintypes.SIZE)==8 when I believe it should be 4. While using 

kernel32.CreateRemoteThread.argtypes = [wintypes.HANDLE, wintypes.LPCVOID, 
wintypes.DWORD, wintypes.LPCVOID, wintypes.LPCVOID, wintypes.DWORD, 
wintypes.LPDWORD] 

and  

kernel32.CreateRemoteThread(h_process, 0, 0, 0xbadadd, 0, 4, byref(thread_id))

It caused CreateRemoteThread to recieve 4 as the last argument, resulting in an 
access denied

--
components: ctypes
messages: 38
nosy: nnstein
priority: normal
severity: normal
status: open
title: wintypes.SIZE is 8bytes on 32 bit machines
type: behavior
versions: Python 3.6

___
Python tracker 

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



[issue43163] codeop prematurely raises on 2nd line when closer is needed

2021-02-08 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

> (I think it would be good if a C expert compared it to the *current* C code.)

That would be very beneficial but is quite a big task, specially given that 
codeop design is quite surprising. I personally find quite confusing the way 
codeop is handling the decisions on continuing or not (is based on compiling 
the code with different levels of new lines and then checking the repr() of the 
exceptions). It would be good if someone familiar with "codeop" design can take 
a look on what's the best way to proceed.

--

___
Python tracker 

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



[issue41100] Support macOS 11 and Apple Silicon Macs

2021-02-08 Thread John Reese


John Reese  added the comment:

Is there an ETA for having Big Sur support backported to the 3.8 branch, or is 
it already there and I'm just not seeing it here?

--
nosy: +jreese

___
Python tracker 

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



[issue43169] argparse: support options similar to find's -exec

2021-02-08 Thread Zachary Ware


Change by Zachary Ware :


--
nosy: +paul.j3, rhettinger

___
Python tracker 

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



[issue43168] macOS python install shares /usr/local with homebrew and can conflict

2021-02-08 Thread Ned Deily


Ned Deily  added the comment:

> I was wondering what the bottom text box was for. [...]

I suggest you take that UX issue up with Apple as we have no control over the 
macOS Installer app and it has worked that way for a long, long time :)

If the proposed solution in Issue43167 of adding some text to the installer 
Welcome or ReadMe windows is sufficient, we can close this as a duplicate 
thereof.

--
components: +macOS
nosy: +ronaldoussoren

___
Python tracker 

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



[issue43169] argparse: support options similar to find's -exec

2021-02-08 Thread pkkm


New submission from pkkm :

This is a feature request for options that would work like the "find" program's 
"-exec" option, which takes the arguments following it unconditionally until it 
encounters a ";" or a "+".

There are multiple ways to achieve this, but I think a good general solution 
would be to let "nargs" take a function. This function would receive a list of 
all arguments following the current one and return the number of arguments that 
the current one should take. An example usage would be:

def command_nargs(args_after):
for i, arg in enumerate(args_after):
if arg in [';', '+']:
return i + 1
raise argparse.ArgumentTypeError(
'Expected a command terminated with `;` or `+`.')

parser = argparse.ArgumentParser()
parser.add_argument('--command', nargs=command_nargs)
parser.add_argument('--option')

parser.parse_args(['--command', 'echo', 'hello', ';', '--option', 'value'])
# => Namespace(command=['echo', 'hello', ';'], option='value')

parser.parse_args(['--command', 'program', '--option', '+'])
# => Namespace(command=['program', '--option', '+'], option=None)

The crucial difference between this and the current behavior of "nargs" is that 
the requested number of arguments would be taken unconditionally, even if the 
arguments looked like options:

parser = argparse.ArgumentParser()
parser.add_argument('--nargs-function', nargs=lambda _: 1)
parser.add_argument('--nargs-number', nargs=1)
parser.add_argument('--option')

parser.parse_args(['--nargs-function', '--option'])
# => Namespace(nargs_function=['--option'], option=None)

parser.parse_args(['--nargs-number', '--option'])
# => error: argument --nargs-number: expected 1 argument

Alternatively, if the difference between the behavior of "nargs=number" and 
"nargs=function" is judged to be too large, an optional argument "greedy" could 
be added to "ArgumentParser" and "add_argument".

With "greedy=False" (the default), argparse would behave like it currently 
does. With "greedy=True", options would be processed left to right and would be 
assigned values unconditionally, even if these values looked like other 
options. An option with "nargs='*', greedy=True" or "nargs='+', greedy=True" 
would take all arguments to its right. An option with "nargs=function, 
greedy=False" would stop taking arguments when it encountered an option, while 
with "greedy=True" it would have the behavior proposed in the previous 
paragraphs.

An example usage would then be:

parser = argparse.ArgumentParser()
parser.add_argument('--nargs-function', nargs=lambda _: 1)
parser.add_argument('--nargs-number', nargs=1)
parser.add_argument('--option')

parser.parse_args(['--nargs-function', '--option'])
# => error: argument --nargs-function: expected 1 argument

parser.parse_args(['--nargs-number', '--option'])
# => error: argument --nargs-number: expected 1 argument



parser = argparse.ArgumentParser()
parser.add_argument('--nargs-function', nargs=lambda _: 1, greedy=True)
parser.add_argument('--nargs-number', nargs=1, greedy=True)
parser.add_argument('--option')

parser.parse_args(['--nargs-function', '--option'])
# => Namespace(nargs_function=['--option'], option=None)

parser.parse_args(['--nargs-number', '--option'])
# => Namespace(nargs_number=['--option'], option=None)

and:

parser = argparse.ArgumentParser()
parser.add_argument('--command', nargs=command_nargs)
parser.add_argument('--option')
parser.add_argument('arg', nargs='?')

parser.parse_args(['--command', 'program', '--option', 'value', '+'])
# => Namespace(arg='+', command=['program'], option='value')



parser = argparse.ArgumentParser(greedy=True)
parser.add_argument('--command', nargs=command_nargs)
parser.add_argument('--option')
parser.add_argument('arg', nargs='?')

parser.parse_args(['--command', 'program', '--option', 'value', '+'])
# => Namespace(arg=None, command=['program', '--option', 'value', '+'], 
option=None)

Both of the alternatives in this feature request have the upside of making the 
behaviors requested in #9334 and #14364 possible.

--
components: Library (Lib)
messages: 386662
nosy: pkkm
priority: normal
severity: normal
status: open
title: argparse: support options similar to find's -exec
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



[issue43168] macOS python install shares /usr/local with homebrew and can conflict

2021-02-08 Thread Barry Alan Scott


Barry Alan Scott  added the comment:

I was wondering what the bottom text box was for.

The usual UX for check boxes is to toggle when the text of the control is 
clicked.

Because of that I avoid clicking on check boxes that I do not know if I want to 
change. Hence I did not get to see the description of the options.

The PKG installer is odd in not having that behaviour.

To check I remember this correctly I use Apple Mail Preferences
and click the text on a check box item.

--

___
Python tracker 

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



[issue43163] codeop prematurely raises on 2nd line when closer is needed

2021-02-08 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
title: codeop prematurely raises SyntaxError when closer is needed -> codeop 
prematurely raises on 2nd line when closer is needed

___
Python tracker 

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



[issue42778] Add follow_symlinks=True parameter to both os.path.samefile() and Path.samefile()

2021-02-08 Thread Ross Rhodes

Ross Rhodes  added the comment:

Thanks for sharing the alternative approach, Serhiy. Sounds like the proposed 
changes aren’t necessary if the combined use of samestat and lstat achieve the 
desired behaviour.

Any objections if I close the open PR?

--

___
Python tracker 

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



[issue43163] codeop prematurely raises SyntaxError when closer is needed

2021-02-08 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

test.test_codeop's test_incomplete is incomplete in that it tests several 
missing-closer single lines, like the above and "[x for x in (", all of which 
pass, but no corresponding multiple line snippets, like the above. The only 
multiple line snippets are for compound statements.  As far as I could see, the 
same is true for test_valid.

Are there similar tests for the REPL?  Are they more complete?  Should not both 
get the same tests?

--
stage:  -> needs patch

___
Python tracker 

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



[issue42916] Support for DICOM image file format in imghdr module

2021-02-08 Thread Ross Rhodes

Ross Rhodes  added the comment:

Looking for input from other contributors here. Naturally with a PR already 
open I’m inclined to keep these changes, but if the majority agree that it is 
too specific a format then I’m happy to hear alternative suggestions?

Ross

--

___
Python tracker 

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



[issue43168] macOS python install shares /usr/local with homebrew and can conflict

2021-02-08 Thread Ned Deily


Ned Deily  added the comment:

On the Installation Type -> Customize window in the installer, there is an 
explanation of a package when you can click on it. For Unix command-line tools 
package, the explanation (at the bottom of the window) is:

"This package installs the unix tools in /usr/local/bin for compatibility with 
older releases of Python. This package is not necessary to use Python."

This also appears in the output from the installer command-line tool.

--

___
Python tracker 

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



[issue43167] Add a note to the macOS installer welcome window about customize options

2021-02-08 Thread Barry Alan Scott


Barry Alan Scott  added the comment:

The readme page is a good 2nd best is PKG install has not option to control the 
text on the INstallation type page.

My guess is that the info would need be in visible without
scrolling for people to notice it. (UX is hard).

--

___
Python tracker 

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



[issue43167] Add a note to the macOS installer welcome window about customize options

2021-02-08 Thread Ned Deily


Change by Ned Deily :


--
assignee:  -> ned.deily
stage:  -> needs patch
title: macOS python install need mechanism to prevent editing shell profile 
files -> Add a note to the macOS installer welcome window about customize 
options

___
Python tracker 

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



[issue43168] macOS python install shares /usr/local with homebrew and can conflict

2021-02-08 Thread Barry Alan Scott


Barry Alan Scott  added the comment:

>From "UNIX command-line tools" its not clear to me that that prevents
symlinks in /usr/local/bin. Maybe word it as "Add python to /usr/local/bin".

Is this documented anywhere?

I just looked at the download page https://www.python.org/downloads/macOS and 
did not seen any linked pages that might explain the options.

--

___
Python tracker 

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



[issue43167] macOS python install need mechanism to prevent editing shell profile files

2021-02-08 Thread Ned Deily


Ned Deily  added the comment:

I'm not sure that the text on the "Installation Type" window can be customized 
but we could add something to either the "Introduction" or "Read Me" windows.

--

___
Python tracker 

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



[issue43167] macOS python install need mechanism to prevent editing shell profile files

2021-02-08 Thread Barry Alan Scott


Barry Alan Scott  added the comment:

It was not obvious that I could do that with Customise.

Indeed I installed 3.10a5 just so that I could remind myself of what the 
installer did.

It would help is the Installation type page told the user why they might want 
to use the Customise for.

--

___
Python tracker 

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



[issue43168] macOS python install shares /usr/local with homebrew and can conflict

2021-02-08 Thread Ned Deily


Ned Deily  added the comment:

Similar to Issue43167, there already is a mechanism to do that: on the 
"Installation Type" window of the macOS installer app sequeence, select 
"Customize" and then deselect the "UNIX command-line tools" package. Another 
option is to use the macOS "installer" command line tool instead and supply it 
with a choice changes file that deselects the package.

Noted in passing: apparently Homebrew has moved to using /opt/homebrew as its 
root for installs on Apple Silicon Macs rather than /usr/local.  And it is 
possible to use other prefixes as long as you are willing to let homebrew build 
the packages from source (admittedly not as convenient).

--
nosy: +ned.deily

___
Python tracker 

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



[issue43163] codeop prematurely raises SyntaxError when closer is needed

2021-02-08 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
title: codeop prematurely raises SyntaxError when ']' is needed -> codeop 
prematurely raises SyntaxError when closer is needed

___
Python tracker 

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



[issue43163] codeop prematurely raises SyntaxError when ']' is needed

2021-02-08 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

IDLE is a Python program that wraps the Python interpreter.  Before blaming 
IDLE for how code is executed, one should first execute the same code directly 
in Python.  The example above shows that one should also try code.interact, 
especially for compilaition issues. (Xie, thank you for this reminder.) IDLE 
and code.interact use the same code and codeop infrastructure. Most relevant 
here is codeop.CommandCompiler, which should act the same as 
codeop.compile_command in the absence of __future__ imports.

The codeop functions, including _maybe_compile, are intended to imitate in 
python the C REPL code that decides whether to execute, get more input, or 
raise.  It doesn't always.  (I think it would be good if a C expert compared it 
to the *current* C code.)

>>> CC = codeop.CommandCompiler
>>> cc("print([1,")  # Returns None, meaning, 'Get more input'.
>>> cc("print([1,\n2,")  
Traceback (most recent call last):
  File "", line 1, in 
  File "F:\dev\3x\lib\codeop.py", line 132, in compile_command
return _maybe_compile(_compile, source, filename, symbol)
  File "F:\dev\3x\lib\codeop.py", line 106, in _maybe_compile
raise err1
  File "F:\dev\3x\lib\codeop.py", line 93, in _maybe_compile
code1 = compiler(source + "\n", filename, symbol)
  File "F:\dev\3x\lib\codeop.py", line 111, in _compile
return compile(source, filename, symbol, PyCF_DONT_IMPLY_DEDENT)
  File "", line 1
print([1,
  ^
SyntaxError: '[' was never closed

If the opening '[' is removed, then ']' is replaced with (.  If '[' is replaced 
with '{' and the items adjusted, ']' is replaced with '}'.  In all three cases, 
CC should return None to ask for more, as the REPL does.

--
components:  -IDLE
nosy: +pablogsal
title: code.interact() unexpectedly raises exception when there may be more 
code -> codeop prematurely raises SyntaxError when ']' is needed

___
Python tracker 

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



[issue43167] macOS python install need mechanism to prevent editing shell profile files

2021-02-08 Thread Ned Deily


Change by Ned Deily :


--
components: +macOS
nosy: +ronaldoussoren

___
Python tracker 

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



[issue43167] macOS python install need mechanism to prevent editing shell profile files

2021-02-08 Thread Ned Deily


Ned Deily  added the comment:

There already is a mechanism to do that: on the "Installation Type" window of 
the macOS installer app sequeence, select "Customize" and then deselect the 
"Shell profile update" package. Another option is to use the macOS "installer" 
command line tool instead and supply it with a choice changes file that 
deselects the package.

--
nosy: +ned.deily

___
Python tracker 

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



[issue43168] macOS python install shares /usr/local with homebrew and can conflict

2021-02-08 Thread Barry Alan Scott


New submission from Barry Alan Scott :

The popular homebrew system installs its binaries into /usr/local/bin.

The macOS python install also defaults to /usr/local/bin where it
puts symlinks to Python like:

% ls -l /usr/local/bin/python3.10
lrwxr-xr-x  1 root  73  8 Feb 19:45:50 2021 /usr/local/bin/python3.10@ -> 
../../../Library/Frameworks/Python.framework/Versions/3.10/bin/python3.10

I understand that there are issues when homebrew installed code requires home 
brew's python but finds the python.org version.

Having installation options to control both where the symlinks are installed or 
not having any symlinks installed would help.

This would make it easier to work with both python.org and homebrew.

>From researching it seems that homebrew cannot be configure to use another 
>folder for its installation.

--
components: Installation
messages: 386649
nosy: barry-scott
priority: normal
severity: normal
status: open
title: macOS python install shares /usr/local with homebrew and can conflict
versions: Python 3.10, Python 3.9

___
Python tracker 

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



[issue42861] ipaddress - add ability to get next closet network of any prefix size

2021-02-08 Thread Faisal Mahmood


Faisal Mahmood  added the comment:

Bump :)

--

___
Python tracker 

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



[issue43166] Unused letters in Windows-specific pragma optimize

2021-02-08 Thread Zachary Ware


Change by Zachary Ware :


--
assignee:  -> steve.dower
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



[issue43167] macOS python install need mechanism to prevent editing shell profile files

2021-02-08 Thread Barry Alan Scott


New submission from Barry Alan Scott :

By default the python macOS installer will edit .bash_profile and .zsh_profile 
to add Python to the path.

For many users this is a problem that requires the added lines to be
removed after each install.

I suggest that there is a mechanism that the user can use to tell the
installer to leave the files as is.

Once option could be to add a marker in the profile files that when present 
turns off the editing.

For example a comment like:

# python: no-path-edit

Another possiblity is for the user to create a marker file that is checked for:

touch ~/Library/Preferences/org.python.no-path.edit

Any reasonable mechinism would be a great help.

--
components: Installation
messages: 386647
nosy: barry-scott
priority: normal
severity: normal
status: open
title: macOS python install need mechanism to prevent editing shell profile 
files
versions: Python 3.10, Python 3.9

___
Python tracker 

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



[issue43166] Unused letters in Windows-specific pragma optimize

2021-02-08 Thread Guido van Rossum

New submission from Guido van Rossum :

A coworker happened to look at our use of #pragma optimize() for Windows (VS 
2017) and noticed:

unless there’s something I’m missing, the ‘a’ and ‘w’ portions of the string 
being passed to the optimize pragma are not doing anything; I’m pretty sure 
they’ve been useless for 10+ years. The ‘g’ means turn on global optimizations 
and the ‘t’ means optimize for “time” (i.e. speed). See the documentation at 
https://docs.microsoft.com/en-us/cpp/preprocessor/optimize?view=msvc-160

--
messages: 386646
nosy: gvanrossum
priority: normal
severity: normal
status: open
title: Unused letters in Windows-specific pragma optimize
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



[issue43060] Convert _decimal C API from pointer array to struct

2021-02-08 Thread Erlend Egeberg Aasland


Erlend Egeberg Aasland  added the comment:

In my opinion, an array of pointers is a bad API; using a struct (like most of 
the other API's) is an improvement.

Ref. discussions on GH-24186 
(https://github.com/python/cpython/pull/24186#discussion_r560834060) and 
bpo-43009.

--

___
Python tracker 

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



RE: Python cannot count apparently

2021-02-08 Thread Schachner, Joseph
This code works:
mystr = "hello"
for ch in mystr:
print(ch, end="")

result is: hello

Note that the for loop does not use range.  Strings are iterable, that is they 
support Python's iteration protocol.  So, for ch in mystr: assigns one 
character from mystr to ch each time, each iteration gets the next character.  
To prevent each character from appearing on a separate line (in Python 3) you 
need end="".   That is, don't put in the usual end-of-line ending.

--- Joseph S.

Teledyne Confidential; Commercially Sensitive Business Data

-Original Message-
From: Michael F. Stemper  
Sent: Monday, February 8, 2021 9:19 AM
To: python-list@python.org
Subject: Re: Python cannot count apparently

On 07/02/2021 13.34, Philipp Daher wrote:
> Hello,
> 
> I recently coded this snippet of code:
> myString=„hello“
> for i in range(len(myString):
>   print(string[i])
> 
> And now for the weird part:
> 
> SOMETIMES, the output is this:
> 
> hello

Strange. When I fix the errors in what you posted:
- wrong character to start the string
- wrong variable name in the call to print()

I get[1]:


... myString="hello"
... for i in range(len(myString)):
...   print( myString[i] )
...
h
e
l
l
o
...

You must have done something to suppress the newlines after each call to 
print().

So it's quite obvious that the code you posted has very little to do with the 
code you ran. If you really want us to help, please directly copy and paste the 
exact code that you ran. We can't really help you with only guesses as to what 
you did.



[1] (leading > replaced with . to fool news clients)
--
Michael F. Stemper
Galatians 3:28
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue43101] Add deprecation of float limits for resource to documentation

2021-02-08 Thread Mark Dickinson


Mark Dickinson  added the comment:

Maybe the better fix is to have better reporting of the `preexec_fn` error, so 
that it's not entirely hidden by the `SubprocessError`? On the other hand, 
given that `preexec_fn` may be going away entirely soon (see #38435), that may 
not be worth it.

--

___
Python tracker 

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



[issue43101] Add deprecation of float limits for resource to documentation

2021-02-08 Thread Gereon Kremer


Gereon Kremer  added the comment:

Hm, I see.

For methods that do not intercept exceptions or run code in a different process 
or alike, the deprecation warning and the TypeError should be sufficient.

Given that identifying this issue can be particularly nasty for setrlimit (if 
used within preexec_fn), could we document this particular affected function 
anyway?

--

___
Python tracker 

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



[issue43162] Enum regression: AttributeError when accessing class variables on instances

2021-02-08 Thread Ethan Furman


Ethan Furman  added the comment:

The code for that `__str__` seems very inefficient -- why doesn't it just do:

return self.name

?

-

The issue is not being able to access class attributes, the issue is whether 
one enum member should be seen as an attribute of another:

  EnumClass.RED.BLUE

and the answer is no.  That wasn't possible when Enum was first introduced in 
3.4, and was an unfortunate side-effect of speeding up member access in 3.5 (or 
3.6).  The docs have always warned against it.

A deprecation warning is an easier transition, though, so I'll do that for 
3.10, and in 3.11 it will become an error.

Thank you for reporting! :-)

--
assignee:  -> ethan.furman
stage:  -> needs patch

___
Python tracker 

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



[issue43165] Support the same files with new param in shutil.copyfile

2021-02-08 Thread Milan Balazs


Milan Balazs  added the comment:

Sure, you can use try/except but it would be nice if the "shutil.copyfile" 
function supports the same files.

If I have many files (more thousand), I don't want to check them with a 
try/except.

Furthermore if I want to cover the unexpected exceptions as well I need to use 
nested try/except (I guess it's not the most elegant way).

Eg.:

try:
shutil.copyfile("test.txt", "test.txt")
except SameFileError:
pass
except Exception as unexpected_exception:
raise unexpected_exception

--

___
Python tracker 

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



[issue43161] Taking sum of massive list comprehension results in total system crash.

2021-02-08 Thread Mark Dickinson


Mark Dickinson  added the comment:

> 28 bytes for the actual object

Gah. I should proof-read before hitting "Submit Changes". That should say "28 
bytes for each int object".

--

___
Python tracker 

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



[issue43161] Taking sum of massive list comprehension results in total system crash.

2021-02-08 Thread Mark Dickinson


Mark Dickinson  added the comment:

The list you're attempting to create needs around 41GB of RAM (28 bytes for the 
actual object, rounded up to 32 bytes per object for alignment reasons, plus 8 
bytes for each pointer in the list). Assuming you don't have that much memory 
on your system, it'll likely start swapping at that point.

> Should I submit this as a bug to the kernel project then?

That's up to you. The effect is well known and well documented - see for 
example https://bugzilla.redhat.com/show_bug.cgi?id=1577528 .

You may want to consider using `ulimit` to limit the amount of RAM that the 
Python process can use.

In any case, closing here, since this isn't a Python bug.

--
nosy: +mark.dickinson
resolution:  -> not a bug
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



[issue43165] Support the same files with new param in shutil.copyfile

2021-02-08 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

You can use try/except.

try:
shutil.copyfile("test.txt", "test.txt")
except SameFileError:
pass

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue43165] Support the same files with new param in shutil.copyfile

2021-02-08 Thread Milan Balazs


Change by Milan Balazs :


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

___
Python tracker 

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



[issue43101] Add deprecation of float limits for resource to documentation

2021-02-08 Thread Mark Dickinson


Mark Dickinson  added the comment:

Agreed with Serhiy that it's not practical to document all the affected 
functions.

--

___
Python tracker 

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



[issue43101] Add deprecation of float limits for resource to documentation

2021-02-08 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

This change was indirectly documented in What's New for 3.8 (deprecation) 
https://docs.python.org/3.8/whatsnew/3.8.html#build-and-c-api-changes:

"""
Functions that convert Python number to C integer like PyLong_AsLong() and 
argument parsing functions like PyArg_ParseTuple() with integer converting 
format units like 'i' will now use the __index__() special method instead of 
__int__(), if available. The deprecation warning will be emitted for objects 
with the __int__() method but without the __index__() method (like Decimal and 
Fraction). PyNumber_Check() will now return 1 for objects implementing 
__index__(). PyNumber_Long(), PyNumber_Float() and PyFloat_AsDouble() also now 
use the __index__() method if available.
"""

and for 3.10 (removing) 
https://docs.python.org/3.10/whatsnew/3.10.html#other-language-changes:

"""
Builtin and extension functions that take integer arguments no longer accept 
Decimals, Fractions and other objects that can be converted to integers only 
with a loss (e.g. that have the __int__() method but do not have the 
__index__() method).
"""

It was impractical to document it for every affected function, because there 
may be many tens of such functions in the stdlib, and it is difficult to find 
all functions which directly or indirectly use PyLong_AsLong() and similar C 
API. In any case accepting non-integer numbers was not intentional.

--
nosy: +mark.dickinson

___
Python tracker 

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



[issue43060] Convert _decimal C API from pointer array to struct

2021-02-08 Thread Mark Dickinson


Mark Dickinson  added the comment:

Can you explain what problem this would be solving?

--

___
Python tracker 

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



[issue43165] Support the same files with new param in shutil.copyfile

2021-02-08 Thread Milan Balazs


New submission from Milan Balazs :

The "shutil.copyfile" raises a "SameFileError" exception if the src and dts 
files are the same.

There is no option to allow the same files(like in case of 
shutil.copytree(dirs_exist_ok=False)).

For example:

import shutil

shutil.copyfile("test.txt", "test.txt")

Output:

>>> python3 test.py 
Traceback (most recent call last):
  File "test.py", line 3, in 
shutil.copyfile("test.txt", "test.txt")
  File "/usr/lib/python3.6/shutil.py", line 104, in copyfile
raise SameFileError("{!r} and {!r} are the same file".format(src, dst))
shutil.SameFileError: 'test.txt' and 'test.txt' are the same file

--
components: Library (Lib)
messages: 386634
nosy: milanbalazs
priority: normal
severity: normal
status: open
title: Support the same files with new param in shutil.copyfile
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



[issue43134] (list have item) instate (item in list)

2021-02-08 Thread Mark Dickinson


Mark Dickinson  added the comment:

@Masoud: There's a significant cost to introducing new syntax into Python; 
there need to be really significant benefits to justify that cost. In this 
case, the benefits are slight, and nowhere near the threshold needed to justify 
introducing a new keyword into the language.

Closing again; free free to comment further, but please don't re-open the issue.

--
nosy: +mark.dickinson
status: open -> closed

___
Python tracker 

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



[issue40361] Darwin systems using win settings for webbrowser.py

2021-02-08 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
status: open -> closed

___
Python tracker 

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



[issue41754] Webbrowser Module Cannot Find xdg-settings on OSX

2021-02-08 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Is it possible that your PATH contains a non-directory? Because it can give 
results a NotADirectoryError:

>>> subprocess.check_output(['xdg-settings', 'get', 'default-web-browser'], 
>>> env={'PATH': '/etc/hosts'})
Traceback (most recent call last):
  File "", line 1, in 
  File "/home/serhiy/py/cpython/Lib/subprocess.py", line 429, in check_output
return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
  File "/home/serhiy/py/cpython/Lib/subprocess.py", line 510, in run
with Popen(*popenargs, **kwargs) as process:
  File "/home/serhiy/py/cpython/Lib/subprocess.py", line 962, in __init__
self._execute_child(args, executable, preexec_fn, close_fds,
  File "/home/serhiy/py/cpython/Lib/subprocess.py", line 1840, in _execute_child
raise child_exception_type(errno_num, err_msg, err_filename)
NotADirectoryError: [Errno 20] Not a directory: 'xdg-settings'

Reopened because I afraid that there may be a severe configuration error hidden 
by silencing NotADirectoryError.

Could you please show os.environ['PATH'] on your computer?

--
nosy: +serhiy.storchaka
status: closed -> open

___
Python tracker 

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



[issue43164] test_nntplib.NetworkedNNTP_SSLTests fails on "AMD64 RHEL8 FIPS Only Blake2 Builtin Hash" buildbot

2021-02-08 Thread Charalampos Stratakis


New submission from Charalampos Stratakis :

This is one of the unstable buildbots, running under FIPS mode. One of the 
tests is failing at the moment.

==
ERROR: setUpClass (test.test_nntplib.NetworkedNNTP_SSLTests)
--
Traceback (most recent call last):
  File 
"/home/buildbot/buildarea/3.x.cstratak-RHEL8-fips-x86_64.no-builtin-hashes-except-blake2/build/Lib/test/test_nntplib.py",
 line 321, in setUpClass
cls.server = cls.NNTP_CLASS(cls.NNTP_HOST,
  File 
"/home/buildbot/buildarea/3.x.cstratak-RHEL8-fips-x86_64.no-builtin-hashes-except-blake2/build/Lib/nntplib.py",
 line 1025, in __init__
super().__init__(host, port, user, password, readermode,
  File 
"/home/buildbot/buildarea/3.x.cstratak-RHEL8-fips-x86_64.no-builtin-hashes-except-blake2/build/Lib/nntplib.py",
 line 334, in __init__
self.sock = self._create_socket(timeout)
  File 
"/home/buildbot/buildarea/3.x.cstratak-RHEL8-fips-x86_64.no-builtin-hashes-except-blake2/build/Lib/nntplib.py",
 line 1031, in _create_socket
sock = _encrypt_on(sock, self.ssl_context, self.host)
  File 
"/home/buildbot/buildarea/3.x.cstratak-RHEL8-fips-x86_64.no-builtin-hashes-except-blake2/build/Lib/nntplib.py",
 line 292, in _encrypt_on
return context.wrap_socket(sock, server_hostname=hostname)
  File 
"/home/buildbot/buildarea/3.x.cstratak-RHEL8-fips-x86_64.no-builtin-hashes-except-blake2/build/Lib/ssl.py",
 line 500, in wrap_socket
return self.sslsocket_class._create(
  File 
"/home/buildbot/buildarea/3.x.cstratak-RHEL8-fips-x86_64.no-builtin-hashes-except-blake2/build/Lib/ssl.py",
 line 1040, in _create
self.do_handshake()
  File 
"/home/buildbot/buildarea/3.x.cstratak-RHEL8-fips-x86_64.no-builtin-hashes-except-blake2/build/Lib/ssl.py",
 line 1309, in do_handshake
self._sslobj.do_handshake()
ssl.SSLError: [SSL: BAD_DH_VALUE] bad dh value (_ssl.c:1122)
--

--
assignee: christian.heimes
components: SSL, Tests
messages: 386631
nosy: christian.heimes, cstratak
priority: normal
severity: normal
status: open
title: test_nntplib.NetworkedNNTP_SSLTests fails on "AMD64 RHEL8 FIPS Only 
Blake2 Builtin Hash" buildbot
versions: Python 3.10, Python 3.9

___
Python tracker 

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



[issue43163] code.interact() unexpectedly raises exception when there may be more code

2021-02-08 Thread Andre Roberge


Change by Andre Roberge :


--
nosy: +aroberge

___
Python tracker 

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



[issue43163] code.interact() unexpectedly raises exception when there may be more code

2021-02-08 Thread Xie Jingyi


Change by Xie Jingyi :


--
title: code.interact() unexpected raises exception when there may be more code 
-> code.interact() unexpectedly raises exception when there may be more code

___
Python tracker 

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



[issue40168] import pandas error[python 3.8.]

2021-02-08 Thread Ronald Oussoren


Change by Ronald Oussoren :


--
resolution:  -> third party
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



[issue43163] code.interact() unexpected raises exception when there may be more code

2021-02-08 Thread Xie Jingyi


Change by Xie Jingyi :


--
assignee:  -> terry.reedy
components: +IDLE, Library (Lib)
nosy: +terry.reedy

___
Python tracker 

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



[issue43163] code.interact() unexpected raises exception when there may be more code

2021-02-08 Thread Xie Jingyi


New submission from Xie Jingyi :

In Python3.10.0a5, `code.interact()` will raise unexpected SyntaxError even if 
there should be more code.

```
Python 3.10.0a5 (default, Feb  7 2021, 20:14:10) 
[GCC 9.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import code
>>> code.interact()
Python 3.10.0a5 (default, Feb  7 2021, 20:14:10) 
[GCC 9.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
(InteractiveConsole)
>>> print([1,
... 2,
  File "", line 1
print([1,
  ^
SyntaxError: '[' was never closed
>>> 
```

Similar things also happen in IDLE.

--

___
Python tracker 

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



[issue43163] code.interact() unexpected raises exception when there may be more code

2021-02-08 Thread Xie Jingyi


Change by Xie Jingyi :


--
nosy: hsfzxjy
priority: normal
severity: normal
status: open
title: code.interact() unexpected raises exception when there may be more code
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



Re: Python cannot count apparently

2021-02-08 Thread Michael F. Stemper

On 07/02/2021 13.34, Philipp Daher wrote:

Hello,

I recently coded this snippet of code:
myString=„hello“
for i in range(len(myString):
  print(string[i])

And now for the weird part:

SOMETIMES, the output is this:

hello


Strange. When I fix the errors in what you posted:
- wrong character to start the string
- wrong variable name in the call to print()

I get[1]:


... myString="hello"
... for i in range(len(myString)):
...   print( myString[i] )
...
h
e
l
l
o
...

You must have done something to suppress the newlines after
each call to print().

So it's quite obvious that the code you posted has very little
to do with the code you ran. If you really want us to help, please
directly copy and paste the exact code that you ran. We can't
really help you with only guesses as to what you did.



[1] (leading > replaced with . to fool news clients)
--
Michael F. Stemper
Galatians 3:28
--
https://mail.python.org/mailman/listinfo/python-list


[issue42683] asyncio should handle keyboard interrupt while the event loop is running

2021-02-08 Thread Gianni Tedesco


Change by Gianni Tedesco :


--
nosy: +scaramanga

___
Python tracker 

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



[issue42901] [Enum] move member creation to __set_name__ in order to support __init_subclass__

2021-02-08 Thread Miro Hrončok

Miro Hrončok  added the comment:

I found a possible regression: https://bugs.python.org/issue43162

--
nosy: +hroncok

___
Python tracker 

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



[issue43162] Enum regression: AttributeError when accessing class variables on instances

2021-02-08 Thread Miro Hrončok

Miro Hrončok  added the comment:

Git bisect:

c314e60388282d9829762fb6c30b12e2807caa19 is the first new commit
commit c314e60388282d9829762fb6c30b12e2807caa19
Author: Ethan Furman 
Date:   Tue Jan 12 23:47:57 2021 -0800

bpo-42901: [Enum] move member creation to `__set_name__` (GH-24196)

`type.__new__` calls `__set_name__` and `__init_subclass__`, which means
that any work metaclasses do after calling `super().__new__()` will not
be available to those two methods.  In particular, `Enum` classes that
want to make use of `__init_subclass__` will not see any members.

Almost all customization is therefore moved to before the
`type.__new__()` call, including changing all members to a proto member
descriptor with a `__set_name__` that will do the final conversion of a
member to be an instance of the `Enum` class.

 Lib/enum.py| 297 +
 Lib/inspect.py |   2 +-
 Lib/test/test_enum.py  |  15 +-
 .../2021-01-11-17-36-59.bpo-42901.gFd-ta.rst   |   3 +
 4 files changed, 207 insertions(+), 110 deletions(-)
 create mode 100644 
Misc/NEWS.d/next/Library/2021-01-11-17-36-59.bpo-42901.gFd-ta.rst

--
nosy: +ethan.furman

___
Python tracker 

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



  1   2   >