[issue42818] AttributeError: 'zipimporter' object has no attribute 'find_spec'

2021-01-07 Thread Klaus Ethgen


Klaus Ethgen  added the comment:

I also tested the original bug and it seems to be gone.

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



[issue42818] AttributeError: 'zipimporter' object has no attribute 'find_spec'

2021-01-07 Thread Klaus Ethgen


Klaus Ethgen  added the comment:

You are right.

Generally I have the installation on devuan Linux, the unstable tree.

But... In 2019-03-13 I started to patch this file as many python scripts 
started to fail due to the fact that they had the find_spec implemented. This 
was still true in Apr 2020, when I had to renew the patch. And let me say, many 
failed; not only the egg part.

I don't know where I found the patch at first but it worked now for nearly two 
years. I did revert it now and for the moment, the scripts that I remember was 
failing, seems to work now.

Let me say that this find_spec/find_module stuff is (or was) a bit of a mess.

--

___
Python tracker 

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



[issue42851] Subclassing Enum with ipaddress.IPv4Network/IPv6Network raises TypeError.

2021-01-07 Thread Mariusz Felisiak


Mariusz Felisiak  added the comment:

Ethan, Thanks for the patch.

--

___
Python tracker 

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



[issue42836] docs: struct: clarify struct caching behaviour

2021-01-07 Thread Roundup Robot


Change by Roundup Robot :


--
keywords: +patch
nosy: +python-dev
nosy_count: 2.0 -> 3.0
pull_requests: +22992
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/24164

___
Python tracker 

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



[issue42725] PEP 563: Should the behavior change for yield/yield from's

2021-01-07 Thread Guido van Rossum

Guido van Rossum  added the comment:

Oh, you’re right about walrus. And I don’t actually understand async generator 
expressions.

This suggests that we definitely need a PEP. :-)

--

___
Python tracker 

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



[issue42798] pip search fails

2021-01-07 Thread Desmond Cheong


Desmond Cheong  added the comment:

Seems that this is due to PyPI's search API being disabled.

https://github.com/pypa/pip/issues/5216#issuecomment-744605466

--
nosy: +desmondcheongzx

___
Python tracker 

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



[issue42818] AttributeError: 'zipimporter' object has no attribute 'find_spec'

2021-01-07 Thread Desmond Cheong


Desmond Cheong  added the comment:

Could you provide some information about the system you're running this on? I 
might be wrong, but this does seem like an issue with this copy of setuptools. 
From the Traceback, it seems that line 2196 of 
/usr/lib/python3/dist-packages/pkg_resources/__init__.py runs `loader = 
importer.find_spec(packageName)` when trying to handle the AttributeError 
exception. However, this line should instead have run `loader = 
importer.find_module(packageName)` based on the source code 
https://github.com/pypa/setuptools/blob/95a9c474d30acc729b536f9ad88ead7efab62c5d/pkg_resources/__init__.py#L2190-L2197

Git blame also tells me that this fall-back has been implemented for a few 
years now.

It also appears that the zipimporter.find_spec method is not implemented in 
Python3.9 and earlier. However, zipimporter.find_module has been implemented 
for at least Python3.8 onwards, if not earlier 
(https://github.com/python/cpython/blob/ca8e96d1edbeb536f58da91e607082463398fce1/Lib/zipimport.py#L139-L150).

--
nosy: +desmondcheongzx

___
Python tracker 

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



[issue25457] json dump fails for mixed-type keys when sort_keys is specified

2021-01-07 Thread naught101


naught101  added the comment:

I want to do something like this:

hashlib.md5(json.dumps(d, sort_keys=True))

So I can check if a dict's contents are the same as a DB version, but I can't 
guarantee that all the keys are strings, so it breaks, annoyingly. I would very 
much like the apply-default-function-then-sort approach. Until then, my 
work-around is this:

def deep_stringize_dict_keys(item):
"""Converts all keys to strings in a nested dictionary"""
if isinstance(item, dict):
return {str(k): deep_stringize_dict_keys(v) for k, v in 
item.items()}

if isinstance(item, list):
# This will check only ONE layer deep for nested dictionaries 
inside lists.
# If you need deeper than that, you're probably doing something 
stupid.
if any(isinstance(v, dict) for v in item):
return [deep_stringize_dict_keys(v) if isinstance(v, dict) else 
v
for v in item]

# I don't care about tuples, since they don't exist in JSON

return item

Maybe it can be of some use for others.

--
nosy: +naught101

___
Python tracker 

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



[issue42865] sysconfig appends CFLAGS to LD

2021-01-07 Thread Victor Lopez


Victor Lopez  added the comment:

I'm updating this to comply with the GitHub PR policies

--
keywords: +patch
message_count: 1.0 -> 2.0
pull_requests: +22991
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/24163

___
Python tracker 

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



[issue42865] sysconfig appends CFLAGS to LD

2021-01-07 Thread Victor Lopez


New submission from Victor Lopez :

This should not happen as some CFLAGS are exclusive to the compiler and it will 
break cross-compiling linkers

The proposed sysconfig is attached

--
components: Distutils
files: sysconfig.py
messages: 384632
nosy: Greentwip, dstufft, eric.araujo
priority: normal
pull_requests: 22989
severity: normal
status: open
title: sysconfig appends CFLAGS to LD
versions: Python 3.9
Added file: https://bugs.python.org/file49728/sysconfig.py

___
Python tracker 

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



[issue42762] infinite loop resulted by "yield"

2021-01-07 Thread Xinmeng Xia


Xinmeng Xia  added the comment:

I get a little confused. So is it a bug in Python 3.5 and 3.6?

--

___
Python tracker 

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



[issue42864] Improve error messages regarding unclosed parentheses

2021-01-07 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
nosy: +lys.nikolaou
stage: patch review -> 

___
Python tracker 

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



[issue42864] Improve error messages regarding unclosed parentheses

2021-01-07 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


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

___
Python tracker 

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



[issue42864] Improve error messages regarding unclosed parentheses

2021-01-07 Thread Pablo Galindo Salgado

New submission from Pablo Galindo Salgado :

Consider this file:

```
x = (


```

The error that we get is:

❯ python ../a.py
  File "/home/pablogsal/github/python/master/../a.py", line 6

^
SyntaxError: unexpected EOF while parsin

This is quite uninformative of the actual problem, which is the closed 
parentheses.

The same happens with something like this:

( 1+2

  File "/home/pablogsal/github/python/master/lel.py", line 3

^
SyntaxError: unexpected EOF while parsing

With some effort, we can include the location of the unclosed parentheses.

--
messages: 384630
nosy: pablogsal
priority: normal
severity: normal
status: open
title: Improve error messages regarding unclosed parentheses
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



[issue42850] Process hangs when calling urllib.request in a multiprocessing.Process with import of sounddevice package

2021-01-07 Thread Robin Scheibler


Robin Scheibler  added the comment:

Thank you very much for the reply! I was indeed hesitating where to post the 
issue. I have now cross-posted in the sounddevice issue tracker.

https://github.com/spatialaudio/python-sounddevice/issues/302

I'll update the issue if things progress on that side.

The sounddevice is essentially a wrapper around the portaudio library, similar 
to pyaudio. I have tried the test code with an import of pyaudio rather than 
sounddevice, but the issue does not happen in that case.

--

___
Python tracker 

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



[issue14678] Update zipimport to support importlib.invalidate_caches()

2021-01-07 Thread Desmond Cheong


Change by Desmond Cheong :


--
keywords: +patch
nosy: +desmondcheongzx
nosy_count: 9.0 -> 10.0
pull_requests: +22987
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/24159

___
Python tracker 

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



Re: Class and tkinter problem

2021-01-07 Thread Paulo da Silva
Às 20:35 de 07/01/21, Terry Reedy escreveu:
> On 1/7/2021 4:20 AM, Terry Reedy wrote:
>> On 1/7/2021 2:42 AM, Christian Gollwitzer wrote:
>>> Am 07.01.21 um 08:29 schrieb Paulo da Silva:
>>>
 Does anybody know why cmd method isn't called when I change the button
 state (clicking on it) in this example?
 I know that this seems a weird class use. But why doesn't it work?
 Thanks.

 class C:
  from tkinter import Checkbutton
  import tkinter

  @staticmethod
>>> ^^it works if you remove the staticmethod here
>>
>> staticmethods are essentially useless in Python.  What little was
>> gained by their addition is partly offset by the introduced confusion.
> 
  def cmd():
  print("Test")
> 
> The confusion is that methods are callable, whereas 'staticmethods' are
> not.  I was not completely aware of this until pointed out by Peter
> Otten with example
> 
> "    cmd()
> 
> Traceback (most recent call last):
>   File "", line 1, in 
>     class C:
>   File "", line 4, in C
>     cmd()
> TypeError: 'staticmethod' object is not callable
> 
> You have to go through the descriptor protocol:"
> 
> Indeed, dir(cmd) shows that it does not have a .__call__ attribute.
> 
>>  top=tkinter.Tk()
>>  cb=Checkbutton(command=cmd)
> 
>> Button commands have to be tcl functions.  Tkinter wraps Python
>> functions as tcl function.  Static methods also wrap python functions,
>> as a .__func__ attribute.  So the code if one passes cmd.__func__.
> 
> "So the code works if one passes the callable cmd.__func__."
> 
>>> Maybe there is a bug in tkinter, that it doesn't work with static
>>> methods?
>>
>> One could propose that tkinter test whether callables are staticmethods 
> 
> Command options, as documented, must be callables. Neither staticmethods
> nor classmethods are callable.
> 
>> and unwrap them when they are.
> 
>  I would propose instead that if possible tkinter raise TypeError when
> passed a non-callable as a command.
> 
Yes, that would be much better.
Thanks.
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue42863] Python venv inconsistent folder structure on windows

2021-01-07 Thread Jeff Moguillansky


New submission from Jeff Moguillansky :

When creating a virtual environment on windows using venv, the folder 
structure: "Scripts", "Include", "Lib", is inconsistent with other platforms 
(e.g. "include", "lib", "bin", etc).  

This causes various integration issues.  

For example, suppose we want to build a native C library, and install it to the 
folder structure generated by the virtual environment.  
The pkg-config file assumes a folder structure of "include", "lib", "bin", and 
the generated pkg-config files are inconsistent with the python virtual 
environment folder structure.  

Can we have a consistent folder structure across platforms?

--
components: Windows
messages: 384628
nosy: jmoguill2, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: Python venv inconsistent folder structure on windows
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



[issue42862] Use functools.lru_cache iso. _sqlite.Cache in sqlite3 module

2021-01-07 Thread Erlend Egeberg Aasland


Erlend Egeberg Aasland  added the comment:

Short diffstat: 8 files changed, 85 insertions(+), 406 deletions(-)

--

___
Python tracker 

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



[issue42848] asyncio produces an unexpected traceback with recursive __getattribute__

2021-01-07 Thread Irit Katriel


Irit Katriel  added the comment:

So, we have a contact chain of length almost equal to the recursion limit, 
which is too much to process recursively in python (in c it does work, hence 
the difference between the outputs of the OP's two scripts).

The PR removes recursion from TracebackException (in constructor as well as in 
format()).  The code is less readable and I'm not sure this case is worth that. 
Should we instead truncate the output, ie add a limit on the recursion depth?  
(note that in this case this would remove the last "recursion depth exceeded" 
exception and show only some of the repetitive ones).

--

___
Python tracker 

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



[issue42848] asyncio produces an unexpected traceback with recursive __getattribute__

2021-01-07 Thread Irit Katriel


Change by Irit Katriel :


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

___
Python tracker 

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



Re: primitive password cracker

2021-01-07 Thread Chris Angelico
On Fri, Jan 8, 2021 at 11:31 AM Greg Ewing  wrote:
>
> Another way to approach this problem is using recursion, e.g.
>
> def find_combinations(items, n, comb, result):
>if n == 0:
>  result.append(comb)
>else:
>  for item in items:
>find_combinations(items, n - 1, comb + [item], result)
>
> words = []
> find_combinations(['a', 'b', 'c'], 3, [], words)
> print(words)
>

True, but I'd much rather write it as a generator:

def permute(items, n):
if not n:
yield ""
return
# Optional performance enhancement:
if n == 1: return (yield from items)
for item in items:
for rest in permute(items, n - 1):
yield item + rest

words = list(permute("abc", 3))

I'm not sure how performance would go, but this is a lot cleaner.

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


[issue42862] Use functools.lru_cache iso. _sqlite.Cache in sqlite3 module

2021-01-07 Thread Erlend Egeberg Aasland


New submission from Erlend Egeberg Aasland :

Pro: less code, less complexity, improved maintainability
Con: minor performance hit

PoC here: https://github.com/erlend-aasland/cpython/commits/sqlite-cache

$ ./python.exe
>>> import sqlite3
>>> con = sqlite3.connect(":memory:")
>>> con.execute("select * from sqlite_master")
>>> con.execute("select * from sqlite_master")
>>> c = con.cache()
>>> c.cache_info()
CacheInfo(hits=1, misses=1, maxsize=128, currsize=1)

The test suite runs approx. 10-20 ms slower with this change. Using 
_functools._lru_cache_wrapper iso. functools.lru_cache almost removes this 
performance regression.


Berker, is it worth pursuing?

--
components: Library (Lib)
messages: 384625
nosy: berker.peksag, erlendaasland, serhiy.storchaka
priority: normal
severity: normal
status: open
title: Use functools.lru_cache iso. _sqlite.Cache in sqlite3 module
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



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

2021-01-07 Thread Faisal Mahmood


Faisal Mahmood  added the comment:

Not sure how to edit an issue, but I made a mistake, where I said:
"...Calling this method would return an IPv4/v6 address that is the closest 
possible match..."

I meant to say:
"...Calling this method would return an IPv4/v6 -NETWORK- that is the closest 
possible match..."

--

___
Python tracker 

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



Re: primitive password cracker

2021-01-07 Thread Greg Ewing

Another way to approach this problem is using recursion, e.g.

def find_combinations(items, n, comb, result):
  if n == 0:
result.append(comb)
  else:
for item in items:
  find_combinations(items, n - 1, comb + [item], result)

words = []
find_combinations(['a', 'b', 'c'], 3, [], words)
print(words)

For this particular problem it's less efficient than the
technique used by itertools.product, because it generates
sub-combinations multiple times. However, it's a useful
technique to keep in mind whenever you have a "variable
number of nested for-loops" kind of problem.

--
Greg

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


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

2021-01-07 Thread Faisal Mahmood


New submission from Faisal Mahmood :

The ipaddress module in Python is an excellent tool, but I noticed it is 
missing a feature that I needed several months ago, which is the ability to 
find the next closest subnet with a specific prefix length.

For example, imagine I had a IPv4Network("10.10.0.72/30"), how would I find the 
next possible /25 address? It is not the most straightforward thing to do, so 
think it would be a great enhancement to the ipaddress library.

I think this can be achieved by adding in a new method to the BaseNetwork 
class, the method could be defined like "next_prefix(next_prefix=None)".  
Calling this method would return an IPv4/v6 address that is the closest 
possible match with the new prefix (defined as next_prefix).

Example calls:
v4 = IPv4Network("10.10.0.72/30")
next_network = v4.next_subnet(next_prefix=25)
# Output: next_network = IPv4Network("10.10.0.128/25")

v4 = IPv4Network("10.10.0.72/30")
next_network = v4.next_subnet(next_prefix=30)
# Output: next_network = IPv4Network("10.10.0.76/30")

v4 = IPv4Network("10.10.0.72/30")
next_network = v4.next_subnet() # if next_prefix is not defined it will use the 
existing prefix of /30, so this call is exactly the same as the previous
# Output: next_network = IPv4Network("10.10.0.76/30")

v6 = IPv6Network("2001:db8::::::/112")
next_network = v6.next_subnet()
# Output: next_network = IPv6Network("2001:db8:::::aaab:0/112")

v6 = IPv6Network("2001:db8::::::/112")
next_network = v6.next_subnet(next_prefix=64)
# Output: next_network = IPv6Network("2001:db8::aaab::/64")

I am going to be working on this and plan to raise a PR soon.  This is my first 
time contributing to Python, so I appreciate your help / comments / suggestions 
/ guidance as I go along.

--
components: Library (Lib)
messages: 384623
nosy: fasial.mahmood94
priority: normal
severity: normal
status: open
title: ipaddress - add ability to get next closet subnet of any prefix size
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



[issue42846] Using _multibytecodec module on Windows, test_threading/embed get failure

2021-01-07 Thread STINNER Victor


STINNER Victor  added the comment:

> 1) python -m test --verbose test_threading
> 2) python -m test --verbose test_embed

I ran manually these two tests with cp932 ANSI code page: they now pass with my 
fix.

I also added a regression test to test_multibytecodec.py.

Thanks for your quick bug report neonene! It's now fixed.

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



[issue42846] Using _multibytecodec module on Windows, test_threading/embed get failure

2021-01-07 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 07f2cee93f1b619650403981c455f47bfed8d818 by Victor Stinner in 
branch 'master':
bpo-42846: Convert CJK codec extensions to multiphase init (GH-24157)
https://github.com/python/cpython/commit/07f2cee93f1b619650403981c455f47bfed8d818


--

___
Python tracker 

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



[issue42846] Using _multibytecodec module on Windows, test_threading/embed get failure

2021-01-07 Thread STINNER Victor


STINNER Victor  added the comment:

Ah, if you don't want to change the ANSI code page to cp932 (Japanese language) 
just to reproduce the issue, you can just set the stdio encoding:
-
C:\> set PYTHONIOENCODING=cp932
C:\> python t.py|more
sys.stdout.encoding='cp1250'

TypeError: codec is unexpected type
(...)
-

--

___
Python tracker 

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



[issue42846] Using _multibytecodec module on Windows, test_threading/embed get failure

2021-01-07 Thread STINNER Victor


STINNER Victor  added the comment:

Simpler way to reproduce the issue with t.py script:
---
import test.support
import sys

import _testcapi

print(f"{sys.stdout.encoding=}", file=sys.stderr)

with test.support.SuppressCrashReport():
_testcapi.run_in_subinterp("pass")
---

By default, UTF-8 is used, everything is fine:
-
C:\> python t.py
sys.stdout.encoding='utf-8'
-

Disable _WindowsConsoleIO with PYTHONLEGACYWINDOWSSTDIO env var, we get the 
issue:
-
C:\> set PYTHONLEGACYWINDOWSSTDIO=1

C:\> python t.py
Running Debug|x64 interpreter...
sys.stdout.encoding='cp932'
TypeError: codec is unexpected type
Fatal Python error: (...)
-

Or redirect the output into a program or a file to disable _WindowsConsoleIO to 
also reproduce the issue:
-
C:\> python t.py|more
sys.stdout.encoding='cp932'
TypeError: codec is unexpected type
(...)
-

--

___
Python tracker 

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



[issue42846] Using _multibytecodec module on Windows, test_threading/embed get failure

2021-01-07 Thread STINNER Victor


STINNER Victor  added the comment:

Attached PR 24157 should fix the issue.

> FAIL: test_daemon_threads_fatal_error 
> (test.test_threading.SubinterpThreadingTests)

This test runs code in a subinterpreter which is run in a subprocess. The 
problem is not in the code run in the subinterpreter, but the creation of 
sys.stdout in the subprocess.

The test creates a subprocess and redirects its stdout and stderr. In this 
case, Python doesn't create a _io._WindowsConsoleIO for sys.stdout.buffer.raw, 
but a regular _io.FileIO object. When the raw I/O is a _WindowsConsoleIO 
instance, create_stdio() of Python/pylifecycle.c forces the usage of the UTF-8 
encoding. But for FileIO, it keeps the locale encoding.

If the locale encoding is "cp932", a CJK multicodec is used. In the main 
interpreter, it's fine. In a subinterpreter, we hit the bug of the _codecs_jp 
which doesn't use the new multi-phase initialization API.

--

___
Python tracker 

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



[issue42846] Using _multibytecodec module on Windows, test_threading/embed get failure

2021-01-07 Thread STINNER Victor


Change by STINNER Victor :


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

___
Python tracker 

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



[issue42725] PEP 563: Should the behavior change for yield/yield from's

2021-01-07 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Does not walrus affect the meaning of variable? And await affects the meaning 
of generator expression.

--

___
Python tracker 

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



[issue42846] Using _multibytecodec module on Windows, test_threading/embed get failure

2021-01-07 Thread STINNER Victor


STINNER Victor  added the comment:

I'm working on a fix.

--

___
Python tracker 

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



[issue42860] Incompatible types in Python grammar

2021-01-07 Thread Lysandros Nikolaou


Lysandros Nikolaou  added the comment:

This is now fixed, Tobias!

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



[issue42860] Incompatible types in Python grammar

2021-01-07 Thread miss-islington


miss-islington  added the comment:


New changeset 07dcd86ceed0bd88d1e96dcf53b1de2fea024385 by Lysandros Nikolaou in 
branch 'master':
bpo-42860: Remove type error from grammar (GH-24156)
https://github.com/python/cpython/commit/07dcd86ceed0bd88d1e96dcf53b1de2fea024385


--
nosy: +miss-islington

___
Python tracker 

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



[issue42846] Using _multibytecodec module on Windows, test_threading/embed get failure

2021-01-07 Thread Erlend Egeberg Aasland


Erlend Egeberg Aasland  added the comment:

It should be sufficient to convert cjkcodecs.h to multi-phase init then? From 
what I can see, the support modules are state less, right?

--

___
Python tracker 

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



[issue42837] Symbol table incorrectly identifies code as a generator, when 'yield' occurs in an annotation

2021-01-07 Thread Batuhan Taskaya


Batuhan Taskaya  added the comment:

Well even though I still don't understand 'how this issue is different than 
issue42725', I don't think you actually fix the symbol table;
see this one: https://bugs.python.org/msg383659

Annotations still have side effects on the symbol table (even though they 
shouldn't have). and I already had a fix but decided not to go for it until 
issue42737 is resolved since it would make the language inconsistent. Just FYI.

--

___
Python tracker 

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



[issue42846] Using _multibytecodec module on Windows, test_threading/embed get failure

2021-01-07 Thread STINNER Victor


STINNER Victor  added the comment:

It took me a while to understand it, the _multibytecodec module itself is fine. 
The issue comes from the _codecs_jp module which uses the legacy module API:

codec = _codecs_jp.getcodec('cp932')

--

___
Python tracker 

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



[issue42846] Using _multibytecodec module on Windows, test_threading/embed get failure

2021-01-07 Thread STINNER Victor


STINNER Victor  added the comment:

I can reproduce the issue on Windows configured in Japanese language: ANSI code 
page cp932.

I managed to reproduce the bug on Linux with attached bug.py

--
Added file: https://bugs.python.org/file49727/bug.py

___
Python tracker 

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



[issue42837] Symbol table incorrectly identifies code as a generator, when 'yield' occurs in an annotation

2021-01-07 Thread Batuhan Taskaya


Change by Batuhan Taskaya :


--
nosy: +BTaskaya

___
Python tracker 

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



[issue42860] Incompatible types in Python grammar

2021-01-07 Thread Lysandros Nikolaou


Change by Lysandros Nikolaou :


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

___
Python tracker 

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



[issue42860] Incompatible types in Python grammar

2021-01-07 Thread Lysandros Nikolaou


Change by Lysandros Nikolaou :


--
nosy: +lys.nikolaou

___
Python tracker 

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



[issue42859] smtplib: recipe for certifying message delivery

2021-01-07 Thread Dmitry Goldenberg


Dmitry Goldenberg  added the comment:

Yes, it's a question which could lend itself well to a documentation issue.

I've looked at things like:
https://stackoverflow.com/questions/54047021/python-smtplib-how-to-use-disposition-notification-to
https://stackoverflow.com/questions/40369645/detect-bounced-emails-in-python-smtplib

But I'm not seeing a generic approach which would let me prove messages got to 
the destination. It seems Disposition-Notification-To is not always available.

--

___
Python tracker 

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



[issue42851] Subclassing Enum with ipaddress.IPv4Network/IPv6Network raises TypeError.

2021-01-07 Thread Ethan Furman


Ethan Furman  added the comment:


New changeset 9ab4dd452287169f08a8cf4d4c68c2139f8de714 by Ethan Furman in 
branch '3.9':
[3.9] bpo-42851: [Enum] remove brittle __init_subclass__ support (GH-24154) 
(GH-24155)
https://github.com/python/cpython/commit/9ab4dd452287169f08a8cf4d4c68c2139f8de714


--

___
Python tracker 

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



[issue42846] Using _multibytecodec module on Windows, test_threading/embed get failure

2021-01-07 Thread Erlend Egeberg Aasland


Erlend Egeberg Aasland  added the comment:

I'm unable to reproduce this on Windows 10 (amd64). What's your exact locale 
setting? Are you compiling with HEAD at 
0b858cdd5d114f0890b11b6c4d6559d0ceb468ab?

--

___
Python tracker 

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



[issue42850] Process hangs when calling urllib.request in a multiprocessing.Process with import of sounddevice package

2021-01-07 Thread Guido van Rossum

Guido van Rossum  added the comment:

I would assume it’s some interaction between threads and fork. Have you asked 
the authors of sound device about this?

--
nosy: +gvanrossum

___
Python tracker 

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



[issue42851] Subclassing Enum with ipaddress.IPv4Network/IPv6Network raises TypeError.

2021-01-07 Thread Ethan Furman


Change by Ethan Furman :


--
pull_requests: +22983
pull_request: https://github.com/python/cpython/pull/24155

___
Python tracker 

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



This is a test

2021-01-07 Thread Craig Hatch
I have added you to the EMAIL  list, so when I have questions.

Just learn for fun.


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


Re: Class and tkinter problem

2021-01-07 Thread Terry Reedy

On 1/7/2021 4:20 AM, Terry Reedy wrote:

On 1/7/2021 2:42 AM, Christian Gollwitzer wrote:

Am 07.01.21 um 08:29 schrieb Paulo da Silva:


Does anybody know why cmd method isn't called when I change the button
state (clicking on it) in this example?
I know that this seems a weird class use. But why doesn't it work?
Thanks.

class C:
 from tkinter import Checkbutton
 import tkinter

 @staticmethod

^^it works if you remove the staticmethod here


staticmethods are essentially useless in Python.  What little was gained 
by their addition is partly offset by the introduced confusion.



 def cmd():
 print("Test")


The confusion is that methods are callable, whereas 'staticmethods' are 
not.  I was not completely aware of this until pointed out by Peter 
Otten with example


"cmd()

Traceback (most recent call last):
  File "", line 1, in 
class C:
  File "", line 4, in C
cmd()
TypeError: 'staticmethod' object is not callable

You have to go through the descriptor protocol:"

Indeed, dir(cmd) shows that it does not have a .__call__ attribute.


     top=tkinter.Tk()
     cb=Checkbutton(command=cmd)


Button commands have to be tcl functions.  Tkinter wraps Python 
functions as tcl function.  Static methods also wrap python functions, 
as a .__func__ attribute.  So the code if one passes cmd.__func__.


"So the code works if one passes the callable cmd.__func__."

Maybe there is a bug in tkinter, that it doesn't work with static 
methods?


One could propose that tkinter test whether callables are staticmethods 


Command options, as documented, must be callables. Neither staticmethods 
nor classmethods are callable.



and unwrap them when they are.


 I would propose instead that if possible tkinter raise TypeError when 
passed a non-callable as a command.



Classmethods also do not work as is.  By experiment, the following works.
     cb=Checkbutton(command=lambda: C.cmd.__func__(C))
But if the class were nested, it would be more complicated.



--
Terry Jan Reedy


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


[issue42851] Subclassing Enum with ipaddress.IPv4Network/IPv6Network raises TypeError.

2021-01-07 Thread Ethan Furman


Ethan Furman  added the comment:


New changeset a581a868d97f649aedf868a1d27865a10925c73a by Ethan Furman in 
branch 'master':
bpo-42851: [Enum] remove brittle __init_subclass__ support (GH-24154)
https://github.com/python/cpython/commit/a581a868d97f649aedf868a1d27865a10925c73a


--

___
Python tracker 

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



[issue42857] Fails to construct paths lead to "python is likely shutting down"

2021-01-07 Thread Guido van Rossum

Guido van Rossum  added the comment:

You are doing something very evil during finalization here. There’s nothing 
that can be done reasonably.

--
nosy: +gvanrossum
resolution:  -> wont fix
stage:  -> resolved
status: open -> closed

___
Python tracker 

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



[issue42858] Incorrect return value for os.system() in recognizing import error

2021-01-07 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



[issue42860] Incompatible types in Python grammar

2021-01-07 Thread Tobias Kohn


New submission from Tobias Kohn :

There seems to be a small type error in the Python grammar in the rule 
`invalid_parameters`:
```
invalid_parameters:
| param_no_default* (slash_with_default | param_with_default+) 
param_no_default
```
While the `slash_with_default` returns a single element, the 
`param_with_default` returns a list/sequence.

--
messages: 384603
nosy: tobias.kohn
priority: normal
severity: normal
status: open
title: Incompatible types in Python grammar
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



[issue42725] PEP 563: Should the behavior change for yield/yield from's

2021-01-07 Thread Guido van Rossum

Guido van Rossum  added the comment:

I wouldn’t have thought you’d need a PEP for this but if you want to write one 
that sounds like the right thing.

Re: async and walrus: I think those are different, their presence doesn’t 
affect the meaning of the function like yield. We can’t hope to prevent side 
effects syntactically.

--

___
Python tracker 

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



[issue42859] smtplib: recipe for certifying message delivery

2021-01-07 Thread Guido van Rossum


Guido van Rossum  added the comment:

This looks more like a question than an issue.  Have you tried stackoverflow or 
a user forum?

--
nosy: +gvanrossum

___
Python tracker 

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



[issue42851] Subclassing Enum with ipaddress.IPv4Network/IPv6Network raises TypeError.

2021-01-07 Thread Ethan Furman


Change by Ethan Furman :


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

___
Python tracker 

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



[issue42859] smtplib: recipe for certifying message delivery

2021-01-07 Thread Dmitry Goldenberg


New submission from Dmitry Goldenberg :

Is there a reliable way to certify (ensure, track) the delivery of an email 
message when using smtplib?

For example:
Disposition-Notification-To message header which enables the e-mail reader of 
the recipient to send confirmation e-mail when the recipient opens the message 
for the first time. That e-mail reader program must support this functionality.

Return-Receipt-To message header which enables the e-mail server of the 
recipient to send confirmation e-mail when the original e-mail gets received by 
that server. However, most newer e-mail servers do not support 
Return-Receipt-To header.

Are these message headers at all reliable?

The request is to enhance the documentation to provide an example of how to 
track a message delivery. Conversely, if it's plain not possible, the request 
is to state that explicitly in the docs.

--
assignee: docs@python
components: Documentation
messages: 384600
nosy: dgoldenberg123, docs@python
priority: normal
severity: normal
status: open
title: smtplib: recipe for certifying message delivery
type: enhancement
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



Re: primitive password cracker

2021-01-07 Thread dn via Python-list
On 08/01/2021 05.52, Bischoop wrote:
> On 2021-01-07, Chris Angelico  wrote:
>>
>> True. Unfortunately, it doesn't work, so what you'd have is something
>> that can be easily parameterized to not work on other numbers of
>> characters too. :)
>>
> 
> My bad is I'm kinda maniac and have to know how to, I know best solution
> itertool but... I just must know, was thinking that studing the itertool
> code would give me an answer but found it's in C.
> Now I try list comprehension for it, so it's another day on it for me.


BTW have you realised a second 'typo' - that there are only 24 letters
in this 'alphabet'?


It is not difficult to parametrise the building of a "password cracking
dictionary"! (NB not same definition as a Python dictionary) Take it one
step (one character) at a time...

We start from our list of "letters". This is every permutation of the
alphabet, taken one at a time. Call it the one_character_list.
[Let's not distract from the problem by arguing about the definition of
"permutation"!]

Next, we'll take the one_character_list and permute that, with each of
our letter[s]. Thus 'a, b, c' expands to 'aa, ab, ac, ... ba, bb, bc,
... ca, cb, cc, ...'.

For every one of the 24 elements of the one_character_list we now have
24 elements in the two_character_list, ie len( two_character_list )
should be 24*24 (== 24**2) and each element should be unique (ie same
rule as a set).
NB above equation varies if the rule for what may be the first character
of a password differs for the rule of which letters/characters may follow!

Similarly, if we take the two_character_list, we can permute that
(again/further) with each letter. Thus 'aaa, aab, aac, ...baa, bab, bac,
...'. Thus, len( three_character_list ) == 24 * 24 * 24 == 24 ** 3 ==
len( two_character_list ) * 24 == len( one_character_list ) * 24 * 24

Carrying-on we can build a "password cracking dictionary" of any length.
NB the three-character_list contains exactly 'what it says on the tin'
(English-English expression meaning that the label is entirely correct).
Thus if the password rules say 'up to three characters in length', then
the password-cracker would have to test each of the three lists in-turn
too look for one-character passwords, then two-character passwords, and
finally three...!


Disclaimers:

Permutations and combinations are an interesting [learning] exercise,
and we're getting used to your preference for step-by-step
experimentation and learning-mastery.

That said, @David is correct - once understood, use the tool! Because
these multiple loops are "expensive" (in terms of execution-time).

Per @Chris and comments above, consider when and where to use
character-strings, tuples, lists, and/or sets - for 'best results'
and/or 'best practice'.

Per @yourself, once you have coded, tested, and debugged a solution
featuring explicit for-loops, it will be a valuable exercise to upgrade
(the code and quite probably the execution speed) using
comprehensions/expressions...



Sample code:

def permute_lists( existing_list:list, expansion_list:list )->list:
'''Expand each of the existing list's elements
with every element of a provided list.
'''
permuted_list = list()
for existing_element in existing_list:
for expansion_element in expansion_list:
permuted_list.append( existing_element + expansion_element )
return permuted_list


# establish character-set to be used
letters = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l',
'm', 'n', 'o', 'p', 'r',
   's', 't', 'u', 'w', 'q', 'y', 'z']

# taking each of the letters once is the character-set
one_character_list = letters
print( len( one_character_list ) )
print( one_character_list, end="\n" )

# taking the letters two at a time
two_character_list = permute_lists( one_character_list, letters )
print( len( two_character_list ), len( one_character_list ) * len(
letters ) )
print( two_character_list, end="\n" )

# taking the letters three at a time
three_character_list = permute_lists( two_character_list, letters )
print( len( three_character_list ), len( two_character_list ) * len(
letters ) )
print( three_character_list, end="\n" )

-- 
Regards =dn
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue42811] Update docs for importlib.util.resolve_name() to use __spec__.parent instead of __package__

2021-01-07 Thread Brett Cannon


Brett Cannon  added the comment:


New changeset ca8e96d1edbeb536f58da91e607082463398fce1 by Miss Islington (bot) 
in branch '3.8':
bpo-42811: Update importlib.utils.resolve_name() docs to use __spec__.parent 
(GH-24100) (GH-24144)
https://github.com/python/cpython/commit/ca8e96d1edbeb536f58da91e607082463398fce1


--

___
Python tracker 

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



Re: primitive password cracker

2021-01-07 Thread David Kolovratník
I find a parallel to counting useful. Let letters be '0' to '9'
and think of manual (in contrast to formatting range(0, 10))
construction of list of strings "" to "" 

Let's start with . How do you compute the next item? Start
looking from its end. I stop here in order to leave space for 
Bischoop's deliberation.

To sum up in order words, the clue is to stop thinking of inner
loops for each letter and find a way to get the next combination.

Best,
David

On Thu, Jan 07, 2021 at 04:52:56PM -, Bischoop wrote:
> On 2021-01-07, Chris Angelico  wrote:
> >
> > True. Unfortunately, it doesn't work, so what you'd have is something
> > that can be easily parameterized to not work on other numbers of
> > characters too. :)
> >
> 
> My bad is I'm kinda maniac and have to know how to, I know best solution
> itertool but... I just must know, was thinking that studing the itertool
> code would give me an answer but found it's in C.
> Now I try list comprehension for it, so it's another day on it for me.
> 
> 
> --
> Thanks
> -- 
> https://mail.python.org/mailman/listinfo/python-list
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue42811] Update docs for importlib.util.resolve_name() to use __spec__.parent instead of __package__

2021-01-07 Thread miss-islington


miss-islington  added the comment:


New changeset 8c3914aef47e6e5a31b48a0b1f165ec3f4dc4c98 by Yair Frid in branch 
'3.9':
[3.9] bpo-42811: Update importlib.utils.resolve_name() docs to use 
__spec__.parent (GH-24100) (GH-24149)
https://github.com/python/cpython/commit/8c3914aef47e6e5a31b48a0b1f165ec3f4dc4c98


--

___
Python tracker 

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



Re: primitive password cracker

2021-01-07 Thread Bischoop
On 2021-01-07, Bischoop  wrote:
> On 2021-01-07, Chris Angelico  wrote:
>>
>> True. Unfortunately, it doesn't work, so what you'd have is something
>> that can be easily parameterized to not work on other numbers of
>> characters too. :)
>>
>
> My bad is I'm kinda maniac and have to know how to, I know best solution
> itertool but... I just must know, was thinking that studing the itertool
> code would give me an answer but found it's in C.
> Now I try list comprehension for it, so it's another day on it for me.
>
>

So after checking itertools doc I found what itertools.product is
quivalent for on: 
https://docs.python.org/3/library/itertools.html#itertools.product

Now I'll sleep.

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


Re: Class and tkinter problem

2021-01-07 Thread Paulo da Silva
Às 07:29 de 07/01/21, Paulo da Silva escreveu:
> Hi!
> 
> Does anybody know why cmd method isn't called when I change the button
> state (clicking on it) in this example?
> I know that this seems a weird class use. But why doesn't it work?
> Thanks.
> 
> class C:
> from tkinter import Checkbutton
> import tkinter
> 
> @staticmethod
> def cmd():
> print("Test")
> 
> top=tkinter.Tk()
> cb=Checkbutton(command=cmd)
> cb.pack()
> 
> @staticmethod
> def loop():
> C.top.mainloop()
> 
> c=C()
> c.loop()
> 

After some experiments I found two solutions:

1)

class C:
@staticmethod
def cmd():
print("Test")
class C: #@DuplicatedSignature
from tkinter import Checkbutton
import tkinter

top=tkinter.Tk()
cb=Checkbutton(command=C.cmd)
cb.pack()

@staticmethod
def loop():
C.top.mainloop()

c=C()
c.loop()

2)

class C:
from tkinter import Checkbutton
import tkinter

@staticmethod
def cmd():
print("Test")

top=tkinter.Tk()
cb=Checkbutton(command=lambda : C.cmd())
cb.pack()

@staticmethod
def loop():
C.top.mainloop()

c=C()
c.loop()

This one as a sequence of the answer of Terry - thanks.

BTW, does anyone know I can I get the arguments eventually passed by the
Checkbutton event, or any other widget callback (*pargs, **kargs) using
this "solution"?
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: primitive password cracker

2021-01-07 Thread Bischoop
On 2021-01-07, David Raymond  wrote:
> I think you might want to check out itertools.product()
> https://docs.python.org/3.9/library/itertools.html#itertools.product


Thanks David for contribution I find it very convenient but not knowing
how to solve solution without itertools for:
for a i :
for b in :
for c in :
for d in :


doesn't give me a peace.

--
Thanks



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


Re: primitive password cracker

2021-01-07 Thread Bischoop
On 2021-01-07, Chris Angelico  wrote:
>
> True. Unfortunately, it doesn't work, so what you'd have is something
> that can be easily parameterized to not work on other numbers of
> characters too. :)
>

My bad is I'm kinda maniac and have to know how to, I know best solution
itertool but... I just must know, was thinking that studing the itertool
code would give me an answer but found it's in C.
Now I try list comprehension for it, so it's another day on it for me.


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


Re: Class and tkinter problem

2021-01-07 Thread Paulo da Silva
Às 16:02 de 07/01/21, Peter Otten escreveu:
> On 07/01/2021 08:42, Christian Gollwitzer wrote:
>> Am 07.01.21 um 08:29 schrieb Paulo da Silva:
>>
...

> 
> I recommend that the OP use a more conventional stye and do the setup
> outside the class or, better, in an instance of the class.
> 
There are lots of possible more conventional ways, of course.
My purpose was only to understand what was wrong.

Thanks anyway.


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


[issue42855] pathlib.exists on Windows raises an exception on URL like/bad input

2021-01-07 Thread Eryk Sun


Eryk Sun  added the comment:

An alternative would be to add a "strict" parameter that defaults to False. In 
non-strict mode, map all OSError exceptions to a False return value. In strict 
mode, use _ignore_error(e) to determine whether to return False or propagate 
the exception. The question then is whether to add ERROR_INVALID_NAME (123) to 
_IGNORED_WINERRORS since the error means the name can never exist. On the other 
hand, ERROR_ACCESS_DENIED due to a permission error would be propagated in 
strict mode -- because the path's existence is unknown.

--

___
Python tracker 

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



Re: Class and tkinter problem

2021-01-07 Thread Paulo da Silva
Às 09:20 de 07/01/21, Terry Reedy escreveu:
> On 1/7/2021 2:42 AM, Christian Gollwitzer wrote:
>> Am 07.01.21 um 08:29 schrieb Paulo da Silva:
>>
>>> Does anybody know why cmd method isn't called when I change the button
>>> state (clicking on it) in this example?
>>> I know that this seems a weird class use. But why doesn't it work?
>>> Thanks.
>>>
>>> class C:
>>>  from tkinter import Checkbutton
>>>  import tkinter
>>>
>>>  @staticmethod
>> ^^it works if you remove the staticmethod here
> 
> staticmethods are essentially useless in Python.  What little was gained
> by their addition is partly offset by the introduced confusion.
It depends on what the classes are being used for.
Sometimes I just want to use them as static wrappers.
Of course I could use them in the conventional way for this purpose, but
it's not so clean :-)
...

> 
> Classmethods also do not work as is.  By experiment, the following works.
>     cb=Checkbutton(command=lambda: C.cmd.__func__(C))
Why not just
cb=Checkbutton(command=lambda : C.cmd()) ?
Also works.
BTW, just for curiosity, and for my personal learning ... What does
"__func__" does?

Thank you.


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


Re: Class and tkinter problem

2021-01-07 Thread Paulo da Silva
Às 07:42 de 07/01/21, Christian Gollwitzer escreveu:
> Am 07.01.21 um 08:29 schrieb Paulo da Silva:
> 
>> Does anybody know why cmd method isn't called when I change the button
>> state (clicking on it) in this example?
>> I know that this seems a weird class use. But why doesn't it work?
>> Thanks.
>>
>> class C:
>>  from tkinter import Checkbutton
>>  import tkinter
>>
>>  @staticmethod
> ^^it works if you remove the staticmethod here

Yes, that's the coventional way.
Thanks

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


Re: Some problem in code execution in python

2021-01-07 Thread Bischoop
On 2021-01-07, Dario Dario  wrote:
> Sir, I am one of the user of your python program, that is after completion
> of installation I got some statement like "you got code execution problem
> ". I don't know how to rectify this problem.so please help me to rectify
> this problem .
> You send me the solution in this email ID itself .

I'm not Window OS user but doesn't running program in Windows Command Shell
tells also what's wrong?


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


Re: Some problem in code execution in python

2021-01-07 Thread David L Neil via Python-list
On 07/01/2021 22.44, Dario Dario wrote:
> Sir, I am one of the user of your python program, that is after completion
> of installation I got some statement like "you got code execution problem
> ". I don't know how to rectify this problem.so please help me to rectify
> this problem .
> You send me the solution in this email ID itself .


Welcome to the list, where Python users help each other.

Please send more information:
- which Operating System
- which version of Python
- from where Python was downloaded
- copy-paste all of the error messages
-- 
Regards =dn
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue42513] Socket.recv hangs

2021-01-07 Thread Barney Stratford


Barney Stratford  added the comment:

Sure. So, I'm using STOMP to connect to a messaging server. STOMP uses 
heartbeats to detect and close failed connections. The problem was that if the 
connection fails before the protocol has set up its heartbeats then there's 
nothing to stop the whole thing hanging. I had a timeout on the 
socket.create_connection, thinking this would protect against this edge-case, 
but it wasn't sufficient.

STOMP is such a simple protocol that it's often worth writing your own code to 
handle it. Indeed, this is actively encouraged. My own STOMP code is about 250 
lines in a single source file, compared to nearly 3500 lines in 13 files for 
stomp.py. I very much prefer to simplify things as much as possible, and 
smaller is almost always better in my view. Simplify!

So, I kept seeing this very occasional hang-up in my code, and probing it with 
gdb showed that the execution was always stuck inside the poll. Of course it 
was, as that's where it sits to wait for something to happen. Then I was lead 
astray by finding that website, so I saddled up to save the world, as one does 
in such situations.

--

___
Python tracker 

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



[issue42855] pathlib.exists on Windows raises an exception on URL like/bad input

2021-01-07 Thread Steve Dower


Steve Dower  added the comment:

Yeah, I think saying "return True if it provably exists and False if existence 
cannot be proven (and never raise)" is a good general rule for 
boolean-returning functions.

This definitely raises some edge cases where we can infer from certain error 
codes that a path exists, but I don't think it obliges us to prioritise fixing 
those in order to handle more obvious cases.

--

___
Python tracker 

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



[issue42513] Socket.recv hangs

2021-01-07 Thread Jakub Stasiak


Jakub Stasiak  added the comment:

If the edge-case is vaguely socket/file descriptor-related and not 
application-specific or otherwise secret do you mind sharing what is it? (I'm 
just curious)

--

___
Python tracker 

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



[issue42513] Socket.recv hangs

2021-01-07 Thread Barney Stratford


Barney Stratford  added the comment:

Instrumented code shows that the poll is in fact working completely correctly, 
and I've run into a documented edge-case in an unrelated area. Hence, closing 
the bug report and cancelling the pull request.

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



Re: Class and tkinter problem

2021-01-07 Thread Peter Otten

On 07/01/2021 08:42, Christian Gollwitzer wrote:

Am 07.01.21 um 08:29 schrieb Paulo da Silva:


Does anybody know why cmd method isn't called when I change the button
state (clicking on it) in this example?
I know that this seems a weird class use. But why doesn't it work?
Thanks.

class C:
 from tkinter import Checkbutton
 import tkinter

 @staticmethod

^^it works if you remove the staticmethod here


 def cmd():
 print("Test")



Maybe there is a bug in tkinter, that it doesn't work with static methods?


It has nothing to do with tkinter, a staticmethod object cannot be
called directly:

>>> class C:
@staticmethod
def cmd(): print("Hello")
cmd()


Traceback (most recent call last):
  File "", line 1, in 
class C:
  File "", line 4, in C
cmd()
TypeError: 'staticmethod' object is not callable

You have to go through the descriptor protocol:

>>> class C:
@staticmethod
def cmd(): print("Hello")


>>> C.cmd()
Hello

I recommend that the OP use a more conventional stye and do the setup
outside the class or, better, in an instance of the class.

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


Re: Tkinter menu item underline syntax [RESOLVED]

2021-01-07 Thread Rich Shepard

On Wed, 6 Jan 2021, Terry Reedy wrote:


'underline' has nothing to do with looking up the command in
self.callbacks. It is a keyword parameter for the add_command method, and
is handled like all other values passed by name, and as you did for the
other arguments

 file_menu.add_command(
 label='New',
 underline=0,
 command=self.callbacks['file->new],
 accelerator='Ctrl+N'
 )

Note: PEP 8 style is no spaces around '=' used for keyword  arguments. Here 
is an example from idlelib.editor, 978.


   menu.add_command(label=ulchars[i] + " " + file_name,
command=callback,
underline=0)


Thank you for the clarification.

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


[issue41837] Upgrade installers to OpenSSL 1.1.1i

2021-01-07 Thread Christian Heimes


Christian Heimes  added the comment:

They are impacted. However 3.7.9 and 3.6.8 were the last releases with binaries 
for Windows and macOS. All subsequent releases are source-only releases. Since 
we don't release binaries for 3.6 and 3.7 any more, we typically don't update 
them.

--

___
Python tracker 

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



Re: primitive password cracker

2021-01-07 Thread Chris Angelico
On Fri, Jan 8, 2021 at 2:12 AM Bischoop  wrote:
>
> On 2021-01-07, Chris Angelico  wrote:
>
> This could allow easy to change the number of  characters in
> combination, just pass n argument to range where n is how many characters.
>

True. Unfortunately, it doesn't work, so what you'd have is something
that can be easily parameterized to not work on other numbers of
characters too. :)

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


RE: primitive password cracker

2021-01-07 Thread David Raymond
I think you might want to check out itertools.product()
https://docs.python.org/3.9/library/itertools.html#itertools.product

import itertools
import string
passe = 'pass'
for p in itertools.product(string.ascii_lowercase, repeat = 4):
p = "".join(p)
if p == passe:
print("Found it:", p)
break
else:
print("Didn't find it.")

Or for different lengths:

foundIt = False
for repeat in range(1, 6):
for p in itertools.product(string.ascii_lowercase, repeat = repeat):
p = "".join(p)
if p == passe:
print("Found it:", p)
foundIt = True
break
if foundIt:
break
else:
print("Didn't find it.")
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: primitive password cracker

2021-01-07 Thread Bischoop
On 2021-01-07, Chris Angelico  wrote:

This could allow easy to change the number of  characters in
combination, just pass n argument to range where n is how many characters.


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


Re: Class and tkinter problem

2021-01-07 Thread Terry Reedy

On 1/7/2021 2:42 AM, Christian Gollwitzer wrote:

Am 07.01.21 um 08:29 schrieb Paulo da Silva:


Does anybody know why cmd method isn't called when I change the button
state (clicking on it) in this example?
I know that this seems a weird class use. But why doesn't it work?
Thanks.

class C:
 from tkinter import Checkbutton
 import tkinter

 @staticmethod

^^it works if you remove the staticmethod here


staticmethods are essentially useless in Python.  What little was gained 
by their addition is partly offset by the introduced confusion.


I am not sure is removing @staticmethod would have been sufficient in 2.x.


 def cmd():
 print("Test")



top=tkinter.Tk()
cb=Checkbutton(command=cmd)
cb.pack()

Button commands have to be tcl functions.  Tkinter wraps Python 
functions as tcl function.  Static methods also wrap python functions, 
as a .__func__ attribute.  So the code if one passes cmd.__func__.



Maybe there is a bug in tkinter, that it doesn't work with static methods?


One could propose that tkinter test whether callables are staticmethods 
and unwrap them when they are.


Classmethods also do not work as is.  By experiment, the following works.
cb=Checkbutton(command=lambda: C.cmd.__func__(C))
But if the class were nested, it would be more complicated.

--
Terry Jan Reedy


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


Some problem in code execution in python

2021-01-07 Thread Dario Dario
Sir, I am one of the user of your python program, that is after completion
of installation I got some statement like "you got code execution problem
". I don't know how to rectify this problem.so please help me to rectify
this problem .
You send me the solution in this email ID itself .
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Tkinter menu item underline syntax [RESOLVED]

2021-01-07 Thread Terry Reedy

On 1/6/2021 4:17 PM, Terry Reedy wrote:

On 1/6/2021 4:03 PM, Rich Shepard wrote:

On Thu, 7 Jan 2021, Chris Angelico wrote:


Are you sure that this works? It's syntactically valid, but I don't
think it means what you think it does.


ChrisA,

I'm always open to learning. There's no error generated ... yet the
application doesn' open so it's time to run it through pdb.


See my response, sent an hour ago, for how to use 'underline.


Reposting:

'underline' has nothing to do with looking up the command in 
self.callbacks.  It is a keyword parameter for the add_command method, 
and is handled like all other values passed by name, and as you did for 
the other arguments


  file_menu.add_command(
  label='New',
  underline=0,
  command=self.callbacks['file->new],
  accelerator='Ctrl+N'
  )

Note: PEP 8 style is no spaces around '=' used for keyword  arguments. 
Here is an example from idlelib.editor, 978.


menu.add_command(label=ulchars[i] + " " + file_name,
 command=callback,
 underline=0)




--
Terry Jan Reedy

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


[issue42851] Subclassing Enum with ipaddress.IPv4Network/IPv6Network raises TypeError.

2021-01-07 Thread Ethan Furman


Ethan Furman  added the comment:

That would be due to some changes to try and get `Enum` and `__init_subclass__` 
to work together.

I'll revert those changes.  Thank you for the report.

--
assignee:  -> ethan.furman
priority: normal -> high

___
Python tracker 

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



[issue42783] asyncio.sleep(0) idiom is not documented

2021-01-07 Thread Ken Jin


Change by Ken Jin :


--
nosy: +kj
nosy_count: 5.0 -> 6.0
pull_requests: +22981
stage: backport needed -> patch review
pull_request: https://github.com/python/cpython/pull/24153

___
Python tracker 

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



[issue41837] Upgrade installers to OpenSSL 1.1.1i

2021-01-07 Thread Sebastian Voigt


Sebastian Voigt  added the comment:

The fix has only be done for 3.8, 3.9 and 3.10. Are 3.7 and 3.6 are not 
impacted?

--
nosy: +squear

___
Python tracker 

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



[issue42725] PEP 563: Should the behavior change for yield/yield from's

2021-01-07 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Should not "await" and "async for" (in comprehesions) and ":=" be forbidden too?

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue42852] pprint fails in transformming non-breaking space

2021-01-07 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
resolution: fixed -> not a bug

___
Python tracker 

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



[issue42852] pprint fails in transformming non-breaking space

2021-01-07 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
resolution:  -> fixed
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: primitive password cracker

2021-01-07 Thread Bischoop
On 2021-01-07, Chris Angelico  wrote:
>
> I'd recommend having just a string, rather than a list; it'll behave
> identically for what you're doing, and it'll be a lot easier to see
> when you have all the right letters.
>

Yes that's definitely better, I've done so.
>> mineset= set()
>> for a in letters:
>> for b in letters:
>> for c in letters:
>> for d in letters:
>> s = a + b + c + b
>
> Why is b at the end? :) That's why "zulu" could be found, but "pass" couldn't.
>

ha, that's typo I was working so long on it that got mixed up.
and yes with 'd' it works :-)

>> k = sorted(mineset)
>> print(k)
>> for i in k:
>> if i == passe:
>> print('got it: ', i )
>> print(passe in k)
>> --
>> It works in someway but the problems are:
>> Not all combination are made, I change password to: 'pass' and that 
>> combination is not in results.
>> Another thing is, I had to made a set from list because combinations
>> were repeated.
>
> Yep. I'd recommend looking at the original list rather than setting
> and sorting, and you might notice patterns that hint at problems.
>
The problem was with that 'b' at the end, now it solved.


>> for x in range(4):  
>> for y in letters:
>> combin +=y
>> lista.append(combin)
>> combin=''
>
> Not entirely sure what your intended logic is here, but I'd advise
> planning things out in pseudocode and knowing what you're actually
> building.
>
Well :-) I tried to do shorter version of the previous code to do not do
for loop for every character, range
supposed to be for how long the password is, in this case four
characters, once the 4character combination is made add it to the list,
similarly to the previous code but my logic is wrong here.
I don't have clue hot to tell: get a letter for 1 get for 2 get for 3
and get for 4.




> Debugging code can be very hard, especially if you don't know what
> it's doing. Fortunately, Python comes with a number of tools to help
> you figure out your code; the simplest is the print function - just
> add a few useful print calls to your code and trace through things
> that way. You can also look at the pdb module, and various other
> techniques. Explore your code, get to know how it works at each point,
> and you should be able to figure things out.
>
> Good luck, have fun! And remember IIDPIO: If In Doubt, Print It Out!
>

For me is even not debbuging code is important but to do
what I want and in that case is that what I mention earlier four
letters picked and add them to the list, and today again I seat on it
and just nothing lol.

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


[issue42858] Incorrect return value for os.system() in recognizing import error

2021-01-07 Thread STINNER Victor


STINNER Victor  added the comment:

See also https://docs.python.org/dev/library/sys.html#sys.unraisablehook

--
nosy: +vstinner

___
Python tracker 

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



[issue19683] test_minidom has many empty tests

2021-01-07 Thread karl


Change by karl :


--
pull_requests: +22980
stage: needs patch -> patch review
pull_request: https://github.com/python/cpython/pull/24152

___
Python tracker 

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



[issue42858] Incorrect return value for os.system() in recognizing import error

2021-01-07 Thread Christian Heimes


Christian Heimes  added the comment:

The exceptions are ignored (Exception ignored in) on shutdown and therefore 
don't cause the interpreter to fail with an error code. Unraisable exceptions 
typically occur when the interpreter is mostly shut down and garbage 
collection, import or atexit hook is triggered as a side-effect.

--
nosy: +christian.heimes

___
Python tracker 

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



[issue42513] Socket.recv hangs

2021-01-07 Thread Barney Stratford


Barney Stratford  added the comment:

The instrumented code froze today, so I'm finally able to probe the bug. 
Despite what that website said, it's looking like checking the return fron the 
poll syscall isn't the problem here. I'm probably going to close this bug 
report as not a bug, but want to check fully before I do so.

--

___
Python tracker 

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



Re: Tkinter menu item underline syntax [RESOLVED]

2021-01-07 Thread Rich Shepard

On Thu, 7 Jan 2021, Peter Otten wrote:


Spoiler: unless the name 'underline' is defined you get a NameError:
NameError: name 'underline' is not defined
If it is defined and self.callbacks is a dict you get a TypeError:
TypeError: unhashable type: 'slice'
because that's what a colon means in a context like
x[a:b]


The template I used for the menu doesn't scale to my application so I'm
re-writing it from scratch.

Thanks, all,

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


[issue42855] pathlib.exists on Windows raises an exception on URL like/bad input

2021-01-07 Thread Paul Moore


Paul Moore  added the comment:

So I guess the key question then is whether Path.exists() should trap 
exceptions and interpret them as "does not exist" (on all platforms, although 
it looks like the null character case in Unix has now been fixed). Which 
doesn't seem unreasonable, I guess.

--

___
Python tracker 

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



[issue42855] pathlib.exists on Windows raises an exception on URL like/bad input

2021-01-07 Thread Eryk Sun


Eryk Sun  added the comment:

> "http:" isn't a valid drive letter, I'd imagine.

It's not a valid DOS drive, but that's not the problem. "http://w.org; is 
parsed as a relative path. The double slashes are replaced by a single 
backslash, and the Windows API tries to open the path relative to a handle for 
the current working directory. 

The issue is handling a path component named "http:". Some filesystems such as 
FAT32 reserve ":" as an invalid name character. Others such as NTFS and ReFS 
reserve ":" as the stream delimiter [1], and "http:" is not a valid stream 
name. I'm on the fence about how to handle names that the OS rejects as invalid 
in a boolean context (e.g. exists, isfile, etc). In one sense, returning False 
is reasonable because an invalid name cannot exist. But on the other hand, 
asking whether something that's invalid exists is a nonsense question that 
warrants an exception. That said, the issue has already been decided multiple 
times in favor of returning False, so at this point that's a pattern that 
should be consistently supported by the standard library.

Note that a filesystem may allow ":" as name character, such as the VirtualBox 
shared-folder filesystem redirector. But the latter brings up yet another 
twist. Adding a redirector into the device stack, and thus including the MUP 
(multiple UNC provider) device, brings along more path-parsing baggage. In this 
case a component name with ":" in it fails as bad syntax, which gets mapped to 
WinAPI ERROR_BAD_PATHNAME (161), and thus C ENOENT, and ultimately 
FileNotFoundError in Python. This is the case regardless of the filesystem. For 
example, let's use the SMB redirector to set the "//localhost/C$" share for the 
"C:" drive as the working directory:

>>> os.chdir('//localhost/C$')
>>> os.stat('http://w.org')
Traceback (most recent call last):
  File "", line 1, in 
FileNotFoundError: [WinError 161] The specified path is invalid: 
'http://w.org'

>>> Path('http://w.org').exists()
False

---

[1] https://docs.microsoft.com/en-us/windows/win32/fileio/file-streams

--
nosy: +eryksun

___
Python tracker 

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



EuroPython 2021: Format Poll

2021-01-07 Thread M.-A. Lemburg
We are currently working out the format for this year’s online
EuroPython conference. The conference will be run using online
conference tools during the week of July 26 - August 1 and we would like
to learn about your preferences regarding the overall structure.

For this reason, we’re running a poll to gather input from our
(potential) attendees:

* EuroPython 2021 Format Poll *

  https://forms.gle/V4oPEXWiexfVyH1S7


Please add any comments you may have to the comment field. We’d love to
hear about new online conference platforms you may have seen (last year,
we used Zoom and Discord), suggestions on social event formats, etc.


Help spread the word


Please help us spread this message by sharing it on your social
networks as widely as possible. Thank you !

Link to the blog post:

https://blog.europython.eu/post/639651925251571712/europython-2021-format-poll

Tweet:

https://twitter.com/europython/status/1347146647403450370

Thanks,
--
EuroPython 2021 Team
https://www.europython-society.org/
___
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/
Member address: arch...@mail-archive.com


  1   2   >