Re: FileNotFoundError: [Errno 2] No such file or directory: ''

2021-04-14 Thread Eryk Sun
On 4/14/21, Quentin Bock  wrote:
>
> this is the only part of the code that causes the error
>
> file = open('Egils Saga 1-15.txt', "r")

Here's an app_abspath() function to resolve a filename against the
directory of the main script:

import os
import sys

def get_main_file():
if hasattr(sys, 'frozen'):
return sys.executable
main = getattr(sys.modules.get('__main__'), '__file__', '')
return os.path.abspath(main) if main else ''

def get_main_dir():
return os.path.dirname(get_main_file()) or os.getcwd()

def app_abspath(filename):
return os.path.join(get_main_dir(), filename)

file = open(app_abspath('Egils Saga 1-15.txt'), 'r')

In the frozen script case, sys.executable is the main 'script'. For a
"-c" command, there is no main file, so it uses the current working
directory.

Using the variable name "file" is fine so long as compatibility with
Python 2 isn't required. In Python 3, "file" is not a reserved keyword
and not the name of a builtin function or type.
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue37596] Reproducible pyc: frozenset is not serialized in a deterministic order

2021-04-14 Thread Filipe Laíns

Filipe Laíns  added the comment:

Normal sets have the same issue, see bpo-43850.

Would it be reasonable to make it so that sets are always created with the 
definition order? Looking at the set implementation, this seems perfectly 
possible.

--
nosy: +FFY00

___
Python tracker 

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



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

2021-04-14 Thread Inada Naoki


Change by Inada Naoki :


--
nosy: +methane
nosy_count: 4.0 -> 5.0
pull_requests: +24150
pull_request: https://github.com/python/cpython/pull/25419

___
Python tracker 

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



[issue37741] importlib.metadata docs not showing up in the module index

2021-04-14 Thread miss-islington


miss-islington  added the comment:


New changeset a746fceb7548e92f58037d9f90b5468bdc76889d by Miss Islington (bot) 
in branch '3.8':
bpo-37741: make importlib.metadata docs discoverable through a module 
directive. (GH-25415)
https://github.com/python/cpython/commit/a746fceb7548e92f58037d9f90b5468bdc76889d


--

___
Python tracker 

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



[issue37741] importlib.metadata docs not showing up in the module index

2021-04-14 Thread Barry A. Warsaw


Barry A. Warsaw  added the comment:

@jaraco beat me to it.  PRs approved!

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



[issue37741] importlib.metadata docs not showing up in the module index

2021-04-14 Thread miss-islington


Change by miss-islington :


--
pull_requests: +24149
pull_request: https://github.com/python/cpython/pull/25418

___
Python tracker 

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



[issue37741] importlib.metadata docs not showing up in the module index

2021-04-14 Thread miss-islington


Change by miss-islington :


--
pull_requests: +24148
pull_request: https://github.com/python/cpython/pull/25417

___
Python tracker 

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



[issue37741] importlib.metadata docs not showing up in the module index

2021-04-14 Thread miss-islington


miss-islington  added the comment:


New changeset 23acadcc1c75eb74b2459304af70d97a35001b34 by Jason R. Coombs in 
branch 'master':
bpo-37741: make importlib.metadata docs discoverable through a module 
directive. (GH-25415)
https://github.com/python/cpython/commit/23acadcc1c75eb74b2459304af70d97a35001b34


--
nosy: +miss-islington

___
Python tracker 

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



[issue43850] unreproducible bytecode: set order depends on random seed for compiled bytecode

2021-04-14 Thread Benjamin Peterson

Benjamin Peterson  added the comment:

Let's keep any discussion on the preëxisting issue for this.

--
resolution:  -> duplicate
stage: patch review -> resolved
status: open -> closed
superseder:  -> support reproducible Python builds

___
Python tracker 

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



[issue43850] unreproducible bytecode: set order depends on random seed for compiled bytecode

2021-04-14 Thread Filipe Laíns

Filipe Laíns  added the comment:

Sorry for the spam, I am trying to figure out the best option here, which is 
hard to do by myself.

IMO it would be reasonable to create set objects with elements in the order 
they appear in the code, instead of based on the hash. I am not really sure 
where is the code responsible for this, and if there are any limitations 
preventing this from being implemented.

So, my question are: Would you consider this reasonable? Is there anything I am 
missing?
If there are no issues, could someone point me to the target code?

--

___
Python tracker 

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



[issue43835] Dataclasses don't call base class __init__

2021-04-14 Thread Eric V. Smith


Change by Eric V. Smith :


--
assignee:  -> eric.smith

___
Python tracker 

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



[issue43850] unreproducible bytecode: set order depends on random seed for compiled bytecode

2021-04-14 Thread Filipe Laíns

Filipe Laíns  added the comment:

Nevermind, AFAIK that depends on the hash seed, correct?  So, the most viable 
option to me would be a sorting algorithm that could take type into account. 
Would that be an acceptable solution?

--

___
Python tracker 

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



[issue38530] Offer suggestions on AttributeError and NameError

2021-04-14 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


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



[issue43820] Remove namespace copy from dataclasses.make_dataclass()

2021-04-14 Thread Eric V. Smith


Change by Eric V. Smith :


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



[issue43850] unreproducible bytecode: set order depends on random seed for compiled bytecode

2021-04-14 Thread Filipe Laíns

Filipe Laíns  added the comment:

I just realized my fix is wrong because list.sort does not handle different 
types. Similarly to other reproducibility fixes, how does skipping the item 
randomization when SOURCE_DATE_EPOCH is set sound?

--

___
Python tracker 

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



[issue37741] importlib.metadata docs not showing up in the module index

2021-04-14 Thread Jason R. Coombs


Change by Jason R. Coombs :


--
pull_requests: +24147
pull_request: https://github.com/python/cpython/pull/25415

___
Python tracker 

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



[issue43851] Optimise SQLite builds on macOS and Windows

2021-04-14 Thread Erlend Egeberg Aasland


Change by Erlend Egeberg Aasland :


--
pull_requests: +24146
pull_request: https://github.com/python/cpython/pull/25414

___
Python tracker 

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



[issue43851] Optimise SQLite builds on macOS and Windows

2021-04-14 Thread Erlend Egeberg Aasland


Change by Erlend Egeberg Aasland :


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

___
Python tracker 

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



Re: Website

2021-04-14 Thread Mladen Gogala via Python-list
On Wed, 14 Apr 2021 15:41:37 +0200, Rainyis wrote:

> Hello,
> I am Sergio Llorente, and I want to create a web about python. I will
> publish apps, scripts.. made by python. I will like to put python in the
> domain. The domain will be like all-about-python.com but in Spanish(
> todosobrepython.com). Can I use it?
> 
> Thanks in advance,
> Sergio

I give you my permission. May the Force be with you and your website.



-- 
Mladen Gogala
Database Consultant
https://dbwhisperer.wordpress.com
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue43851] Optimise SQLite builds on macOS and Windows

2021-04-14 Thread Erlend Egeberg Aasland


Erlend Egeberg Aasland  added the comment:

BTW, is SQLITE_WITHOUT_ZONEMALLOC still needed for macOS?

--

___
Python tracker 

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



[issue43851] Optimise SQLite builds on macOS and Windows

2021-04-14 Thread Erlend Egeberg Aasland


New submission from Erlend Egeberg Aasland :

We should apply some of the recommended "optimisation" compile-time options[1] 
to the SQLite builds for the macOS and Windows installers. The following 
options should be safe to apply:

- SQLITE_DEFAULT_MEMSTATUS=0
- SQLITE_LIKE_DOESNT_MATCH_BLOBS
- SQLITE_MAX_EXPR_DEPTH=0
- SQLITE_OMIT_DEPRECATED
- SQLITE_OMIT_AUTOINIT

I'm not sure about SQLITE_DEFAULT_WAL_SYNCHRONOUS=1.

Quoting the SQLite docs:
"So these options do not make a huge difference. But in some design situations, 
every little bit helps."


[1] https://sqlite.org/compile.html

--
components: Windows, macOS
messages: 391109
nosy: erlendaasland, ned.deily, paul.moore, ronaldoussoren, steve.dower, 
tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: Optimise SQLite builds on macOS and Windows
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



[issue38530] Offer suggestions on AttributeError and NameError

2021-04-14 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:


New changeset 3fc65b97d09fd29272fdf60d2e567bfb070da824 by Pablo Galindo in 
branch 'master':
bpo-38530: Optimize the calculation of string sizes when offering suggestions 
(GH-25412)
https://github.com/python/cpython/commit/3fc65b97d09fd29272fdf60d2e567bfb070da824


--

___
Python tracker 

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



[issue43837] Operator precedence documentation could be more clear

2021-04-14 Thread Zachary Ware


Zachary Ware  added the comment:

I think it might be easiest to see your suggestion as a pull request :)

--
nosy: +zach.ware

___
Python tracker 

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



[issue38530] Offer suggestions on AttributeError and NameError

2021-04-14 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
pull_requests: +24144
pull_request: https://github.com/python/cpython/pull/25412

___
Python tracker 

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



[issue43837] Operator precedence documentation could be more clear

2021-04-14 Thread Aidan Feldman


Aidan Feldman  added the comment:

Let me try and say a simpler way: I think "variables" should be mentioned in 
that section, either in the table or the paragraph above.

--

___
Python tracker 

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



[issue43850] unreproducible bytecode: set order depends on random seed for compiled bytecode

2021-04-14 Thread Filipe Laíns

Change by Filipe Laíns :


--
nosy: +christian.heimes

___
Python tracker 

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



[issue43850] unreproducible bytecode: set order depends on random seed for compiled bytecode

2021-04-14 Thread Filipe Laíns

Change by Filipe Laíns :


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

___
Python tracker 

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



[issue40804] Bug report in python3.6.8 using argparse module

2021-04-14 Thread Irit Katriel


Irit Katriel  added the comment:

amansi26, I am closing this because you did not reply to the request for more 
information for almost a year. Also, the link in your comment is not working 
anymore. 

If you are still having a problem with argparse, please open a new issue for it 
and include code that demonstrates the problem.

There is some documentation on bug reporting that might be helpful:
https://docs.python.org/3/bugs.html#using-the-python-issue-tracker

--
nosy: +iritkatriel
resolution:  -> rejected
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



[issue43850] unreproducible bytecode: set order depends on random seed for compiled bytecode

2021-04-14 Thread Filipe Laíns

New submission from Filipe Laíns :

Currently, the order of set or frozenset elements when saved to bytecode is 
dependent on the random seed. This breaks reproducibility.

Example fail from an Arch Linux package: 
https://reproducible.archlinux.org/api/v0/builds/88454/diffoscope

Let's take an example file, `test_compile.py`
```python
s = {
'aaa',
'bbb',
'ccc',
'ddd',
'eee',
}
```

$ PYTHONHASHSEED=0 python -m compileall --invalidation-mode checked-hash 
test_compile.py
$ mv __pycache__ __pycache__1
$ PYTHONHASHSEED=1 python -m compileall --invalidation-mode checked-hash 
test_compile.py

$ diff __pycache__/test_compile.cpython-39.pyc 
__pycache__1/test_compile.cpython-39.pyc
Binary files __pycache__/test_compile.cpython-39.pyc and 
__pycache__1/test_compile.cpython-39.pyc differ

$ diff <(xxd __pycache__/test_compile.cpython-39.pyc) <(xxd 
__pycache__1/test_compile.cpython-39.pyc)
5,6c5,6
< 0040: 005a 0362 6262 5a03 6464 645a 0361 6161  .Z.bbbZ.dddZ.aaa
< 0050: 5a03 6363 635a 0365 6565 4e29 01da 0173  Z.cccZ.eeeN)...s
---
> 0040: 005a 0361 6161 5a03 6363 635a 0364 6464  .Z.aaaZ.cccZ.ddd
> 0050: 5a03 6565 655a 0362 6262 4e29 01da 0173  Z.eeeZ.bbbN)...s

I believe the issue is in the marshall module. Particularly, this line[1]. My 
simple fix was to create a list from the set, sort it, and iterate over it 
instead.

[1] 
https://github.com/python/cpython/blob/00d7abd7ef588fc4ff0571c8579ab4aba8ada1c0/Python/marshal.c#L505

--
messages: 391104
nosy: FFY00, Mark.Shannon, benjamin.peterson, yselivanov
priority: normal
severity: normal
status: open
title: unreproducible bytecode: set order depends on random seed for compiled 
bytecode
type: behavior

___
Python tracker 

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



[issue32935] Documentation falsely leads to believe that MemoryHandler can be used to wrap SMTPHandler to send multiple messages per email

2021-04-14 Thread Irit Katriel


Irit Katriel  added the comment:

The documentation does talk about emit() operating on single records:

https://docs.python.org/3/library/logging.handlers.html#logging.handlers.BufferingHandler.emit

How would you make this clearer?

--
nosy: +iritkatriel
versions: +Python 3.10 -Python 3.6

___
Python tracker 

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



[issue37741] importlib.metadata docs not showing up in the module index

2021-04-14 Thread Barry A. Warsaw


Barry A. Warsaw  added the comment:

I'd still like to.  I'm also happy to review any PRs if someone beats me to it.

--

___
Python tracker 

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



[issue43296] [sqlite3] Fix sqlite3_value_blob() usage

2021-04-14 Thread Erlend Egeberg Aasland


Erlend Egeberg Aasland  added the comment:

Thanks, Berker!

I'll add separate issues for sqlite3_value_text() and the missing 
PyTuple_SetItem() error checks.

--

___
Python tracker 

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



[issue43296] [sqlite3] Fix sqlite3_value_blob() usage

2021-04-14 Thread Berker Peksag


Change by Berker Peksag :


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



[issue43296] [sqlite3] Fix sqlite3_value_blob() usage

2021-04-14 Thread Berker Peksag


Berker Peksag  added the comment:


New changeset 5cb601f956886b32641f818b5da347cc86a43db2 by Erlend Egeberg 
Aasland in branch 'master':
bpo-43296: Handle sqlite3_value_blob() errors (GH-24674)
https://github.com/python/cpython/commit/5cb601f956886b32641f818b5da347cc86a43db2


--

___
Python tracker 

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



[issue43849] Typo in calendar doc

2021-04-14 Thread John


John  added the comment:

Sorry for the noise. My confusion.

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



[issue43849] Typo in calendar doc

2021-04-14 Thread John


New submission from John :

I believe the parenthesis in 

calendar.firstweekday()

should be removed. As it is, it produces 'int' cannot be called.

--
assignee: docs@python
components: Documentation
messages: 391098
nosy: JohnCC330, docs@python
priority: normal
severity: normal
status: open
title: Typo in calendar doc
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



[issue37741] importlib.metadata docs not showing up in the module index

2021-04-14 Thread Brett Cannon


Brett Cannon  added the comment:

Are you still planning to fix this, Barry?

--

___
Python tracker 

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



Re: port to PDOS (especially mainframe)

2021-04-14 Thread Paul Edwards
On Thursday, April 15, 2021 at 4:32:51 AM UTC+10, Alan Gauld wrote:
> On 14/04/2021 11:35, Paul Edwards wrote: 
> > I have succeeded in producing a Python 3.3 executable
> ...
> > However, the executable doesn't work yet.

> Late to this party but how big is the assembler?

Assuming the stuff in "asma" has no dependency
on the other .py files, it is 35,000 lines of code!

I think I might need a linker from them too. I haven't
seen the output of asma yet.

> It might be easier to translate the Python to C!

I would also have a maintenance problem going
that way.

I think other people would like Python to be available
on MVS/380 too, for other projects.

BTW, my Python is a 1.5 MB executable. That is
without optimization and without symbols.

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


Re: FileNotFoundError: [Errno 2] No such file or directory: ''

2021-04-14 Thread Michael F. Stemper

On 14/04/2021 12.55, Dan Stromberg wrote:

Open a cmd.exe, command.exe or powershell, and:

cd c:\my\dir\ect\ory
Then run your script.

Or put an os.chdir(r'c:\my\dir\ect\ory') at the top of your script.

Or use file = open(r'c:\my\dir\ect\ory\Egils Saga 1-15.txt', 'r')

BTW, "file" means something to python other than just a variable name.  You
can replace it, as your code below (and my example above) does, but it
obscures the thing you're replacing.  That's why I like to use file_
instead of file.


Personally, I'd use a meaningful name. For instance, I might do

saga = open(r'c:\my\dir\ect\ory\Egils Saga 1-15.txt', 'r')

or even

with open(r'c:\my\dir\ect\ory\Egils Saga 1-15.txt', 'r') as saga:

The latter form eliminates the need for saga.close(). (I'm sure that you
know that; it's directed at the OP.)

--
Michael F. Stemper
The FAQ for rec.arts.sf.written is at

Please read it before posting.
--
https://mail.python.org/mailman/listinfo/python-list


Re: Ann: New Python curses book

2021-04-14 Thread Rich Shepard

On Wed, 14 Apr 2021, Alan Gauld via Python-list wrote:


The paper version should be fine (apart from one error on p44 which has
now been fixed!).


Alan,

What's the error and correction so I can change it in my dead tree version?

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


[issue38748] 32 bit ctypes stdcall callback fails to restore stack pointer

2021-04-14 Thread Michael Curran


Michael Curran  added the comment:

This bug is reproduceable on both Python 3.8 and 3.9. But not 3.7.
Ths bug is seen in the real world, in the context of providing Python callbacks 
to Win32 API functions, or when implementing comtypes COM objects in Python.
For example, we see this crash in the NVDA screen reader project, in our 
implementation of ITTSBufNotifySink from the Microsoft SAPI4 speech API.
ITTSBufNotifySink::TextDataStarted takes a pointer (this), and a long long 
(qTimestamp).
https://github.com/nvaccess/nvda/issues/12152

--

___
Python tracker 

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



[issue43848] gzip.py: explain optional argument mtime

2021-04-14 Thread Joachim


Change by Joachim :


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

___
Python tracker 

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



[issue38748] 32 bit ctypes stdcall callback fails to restore stack pointer

2021-04-14 Thread Michael Curran


Michael Curran  added the comment:

I can also reproduce this. I will attach my own testcase below.
So far I see it when the callback is __stdcall (WINFUNCTYPE) and it takes an 
larger than 4 bytes (E.g. a long long or a VARIANT), with one or more arguments 
preceeding it such that this argument is not aligned on a multiple of 8 bytes. 
For example arguments can be:
* long, long long
* long, long, long, long long
But the corruption does not occur with something like:
* long, long, long long
My testcase uses long, long long to show the crash.

--
nosy: +michaeldcurran
Added file: https://bugs.python.org/file49959/py3.8crash.zip

___
Python tracker 

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



[issue43252] deepcopy of weakref proxies

2021-04-14 Thread Irit Katriel


Irit Katriel  added the comment:

If you deep-copy the referents, what would hold a reference to them? Wouldn't 
the new objects be immediately GCed?

--
nosy: +iritkatriel

___
Python tracker 

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



Re: port to PDOS (especially mainframe)

2021-04-14 Thread Alan Gauld via Python-list
On 14/04/2021 11:35, Paul Edwards wrote:
> I have succeeded in producing a Python 3.3 executable
...
> However, the executable doesn't work yet.
Late to this party but how big is the assembler?
It might be easier to translate the Python to C!
I've done that in the past and with the aid of a
few functions to mimic common Python constructs
(dicts, foreach() etc) it was verbose but not
too painful.

If its <5K? lines of Python it might be easier.

Just a thought.

-- 
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.amazon.com/author/alan_gauld
Follow my photo-blog on Flickr at:
http://www.flickr.com/photos/alangauldphotos


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


Re: Ann: New Python curses book

2021-04-14 Thread Alan Gauld via Python-list
On 30/03/2021 12:12, Alan Gauld via Python-list wrote:
> I've just published, in Kindle and paperback formats,

I've just noticed that the kindle version has several indentation
problems in the code listings. I can't do anything to fix it
because it is all perfectly aligned in the Word file I submit,
it's caused somewhere in the Amazon conversion process. (In fact
it's possibly its OK on some Kindle devices/apps, just not
the web reader I was using!)

Hopefully the expected readership will be smart enough to:
a) figure it out from the context and
b) download the sample code which is correctly formatted.

The paper version should be fine (apart from one error
on p44 which has now been fixed!).

Apologies to anyone who got stung by this.

-- 
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.amazon.com/author/alan_gauld
Follow my photo-blog on Flickr at:
http://www.flickr.com/photos/alangauldphotos


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


[issue43848] gzip.py: explain optional argument mtime

2021-04-14 Thread Joachim


New submission from Joachim :

Explain the data type of optional argument mtime: seconds since the epoch.

As an alternative to mtime = None, recommend mtime = 0 for generating 
deterministic streams.

--
assignee: docs@python
components: Documentation
messages: 391093
nosy: docs@python, j5w6
priority: normal
severity: normal
status: open
title: gzip.py: explain optional argument mtime
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



[issue43583] make test failures, 2 tests failed: test_embed test_tabnanny

2021-04-14 Thread Irit Katriel


Irit Katriel  added the comment:

As Victor suggested in https://bugs.python.org/issue43001#msg386820:

Try to run directly the two failing tests in verbose mode, copy/paste the 
output into a file and attach the file here:

python -m test test_embed test_tabnanny -v

--
nosy: +iritkatriel

___
Python tracker 

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



[issue40407] Zipfile couldn`t recognized character set rightly.

2021-04-14 Thread Irit Katriel


Change by Irit Katriel :


--
nosy: +alanmcintyre, serhiy.storchaka, twouters

___
Python tracker 

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



[issue28197] Add start and stop parameters to the range.index() ABC method

2021-04-14 Thread Shreyan Avigyan


Change by Shreyan Avigyan :


--
nosy: +shreyanavigyan

___
Python tracker 

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



[issue43836] range.index doesn't support start/stop optional arguments

2021-04-14 Thread Ammar Askar


Ammar Askar  added the comment:

Marked as a duplicate.

Kaleb, would you mind posting your comment on the original bug #28197?

--
nosy: +ammar2
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> Add start and stop parameters to the range.index() ABC method

___
Python tracker 

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



[issue38530] Offer suggestions on AttributeError and NameError

2021-04-14 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:


New changeset e07f4ab26aaf08f90ebd9e6004af14fd6ef39351 by Pablo Galindo in 
branch 'master':
bpo-38530: Make sure that failing to generate suggestions on failure will not 
propagate exceptions (GH-25408)
https://github.com/python/cpython/commit/e07f4ab26aaf08f90ebd9e6004af14fd6ef39351


--

___
Python tracker 

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



Re: FileNotFoundError: [Errno 2] No such file or directory: ''

2021-04-14 Thread Dan Stromberg
Open a cmd.exe, command.exe or powershell, and:

cd c:\my\dir\ect\ory
Then run your script.

Or put an os.chdir(r'c:\my\dir\ect\ory') at the top of your script.

Or use file = open(r'c:\my\dir\ect\ory\Egils Saga 1-15.txt', 'r')

BTW, "file" means something to python other than just a variable name.  You
can replace it, as your code below (and my example above) does, but it
obscures the thing you're replacing.  That's why I like to use file_
instead of file.

On Wed, Apr 14, 2021 at 10:42 AM Quentin Bock  wrote:

> Okay, how exactly do I do that?
> Thanks
>
> On Wed, 14 Apr 2021 at 13:35, Dan Stromberg  wrote:
>
>>
>>
>> On Wed, Apr 14, 2021 at 9:14 AM Quentin Bock  wrote:
>>
>>> I receive this error when I try to open a file
>>> The file (what I'm trying to open) is in the same folder as the program
>>> I'm
>>> trying to open it from; why is it saying no such file or directory?
>>>
>>> this is the only part of the code that causes the error
>>>
>>> file = open('Egils Saga 1-15.txt', "r")
>>>
>>> file.close()
>>>
>>
>> Python will try to open the file in the directory you are currently in,
>> rather than the directory your program is in.
>>
>> Try cd'ing to the appropriate directory first.  Or specify a full to your
>> file in the open.
>>
>>
>>
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue15795] Zipfile.extractall does not preserve file permissions

2021-04-14 Thread William Woodruff


Change by William Woodruff :


--
nosy: +yossarian

___
Python tracker 

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



Re: FileNotFoundError: [Errno 2] No such file or directory: ''

2021-04-14 Thread jak

Il 14/04/2021 18:13, Quentin Bock ha scritto:

I receive this error when I try to open a file
The file (what I'm trying to open) is in the same folder as the program I'm
trying to open it from; why is it saying no such file or directory?

this is the only part of the code that causes the error

file = open('Egils Saga 1-15.txt', "r")

file.close()



>>> file = open('Egils Saga 1-15.txt', "r")
>>> file.read()
'Hello from Egils Saga 1-15.txt'
>>> file.close()

Try to check your 'current working directory':

>>> import os
>>> os.getcwd()
'D:\\tmp'# where the file is
>>>
--
https://mail.python.org/mailman/listinfo/python-list


Re: FileNotFoundError: [Errno 2] No such file or directory: ''

2021-04-14 Thread Dan Stromberg
On Wed, Apr 14, 2021 at 9:14 AM Quentin Bock  wrote:

> I receive this error when I try to open a file
> The file (what I'm trying to open) is in the same folder as the program I'm
> trying to open it from; why is it saying no such file or directory?
>
> this is the only part of the code that causes the error
>
> file = open('Egils Saga 1-15.txt', "r")
>
> file.close()
>

Python will try to open the file in the directory you are currently in,
rather than the directory your program is in.

Try cd'ing to the appropriate directory first.  Or specify a full to your
file in the open.
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue43836] range.index doesn't support start/stop optional arguments

2021-04-14 Thread Kaleb Barrett


Kaleb Barrett  added the comment:

And so it is... There is also a PR open with a solution from 2017. 
https://github.com/python/cpython/pull/4378/files. Can this get reviewed?

The rationalizations against solving this bug stated in the original issue are 
weak, range.index *is* useful. I use range objects to describe alternate 
indexing schemes for an array type (to model HDL datatypes that allow arbitrary 
indexing schemes). range.index is used to translate user supplied indexes into 
0-based indexes to index into a parallel list with the array values.
https://github.com/cocotb/cocotb/pull/2510/files#diff-62a4545e5bbb9291f2bdb820609b2d68c69cbafe64faea83beb380d01c02fb5aR315-R319

Additionally, this causes issues with mypy. If you subclass Sequence, mypy will 
complain if you don't have the optional start and stop arguments in the index 
method. I would need to feed them into a range object in my implementation. I 
guess in my case I'm expected to just reject them? This breaks substitutability 
in my class.

It also breaks substitutability with list, tuples, every built-in Sequence type 
as well.

--

___
Python tracker 

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



FileNotFoundError: [Errno 2] No such file or directory: ''

2021-04-14 Thread Quentin Bock
I receive this error when I try to open a file
The file (what I'm trying to open) is in the same folder as the program I'm
trying to open it from; why is it saying no such file or directory?

this is the only part of the code that causes the error

file = open('Egils Saga 1-15.txt', "r")

file.close()
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Website

2021-04-14 Thread Paul Bryan
Yes.

On Wed, 2021-04-14 at 15:41 +0200, Rainyis wrote:
> Hello,
> I am Sergio Llorente, and I want to create a web about python. I
> will publish apps, scripts.. made by python. I will like to put
> python in
> the domain. The domain will be like all-about-python.com but in
> Spanish(
> todosobrepython.com). Can I use it?
> 
> Thanks in advance,
> Sergio

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


Website

2021-04-14 Thread Rainyis
Hello,
I am Sergio Llorente, and I want to create a web about python. I
will publish apps, scripts.. made by python. I will like to put python in
the domain. The domain will be like all-about-python.com but in Spanish(
todosobrepython.com). Can I use it?

Thanks in advance,
Sergio
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue43492] Upgrade to SQLite 3.35.4 in macOS and Windows

2021-04-14 Thread Shreyan Avigyan


Shreyan Avigyan  added the comment:

As @steve.dower mentioned that maybe the SQLite team is busy fixing bugs and 
implementing features in SQLite 3.35. But @erlendaasland, 
https://sqlite.org/forum/forumpost/d36426225c?t=h has a question related to 
SQLite 3.35.5 but there was no reply or confirmation from the SQLite team. 
There maybe a direct SQLite 3.36.0 instead of 3.35.5. Moreover if n o bugs are 
found in the upcoming SQLite 3.35 release I think it's time to implement that 
version of SQLite to work with python/cpython or it'll be too late and SQLite 
3.36 may be released.

--
nosy: +shreyanavigyan

___
Python tracker 

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



[issue41282] Deprecate and remove distutils

2021-04-14 Thread Petr Viktorin

Petr Viktorin  added the comment:


New changeset 341e8a939aca6e9f59ffb0e6daee5888933694ed by Lumír 'Frenzy' Balhar 
in branch 'master':
bpo-41282: (PEP 632) Load install schemes from sysconfig (GH-24549)
https://github.com/python/cpython/commit/341e8a939aca6e9f59ffb0e6daee5888933694ed


--
nosy: +petr.viktorin

___
Python tracker 

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



[issue43798] Add position metadata to alias AST type

2021-04-14 Thread Florian Bruhin


Change by Florian Bruhin :


--
nosy: +The Compiler

___
Python tracker 

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



[issue38530] Offer suggestions on AttributeError and NameError

2021-04-14 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
pull_requests: +24141
pull_request: https://github.com/python/cpython/pull/25408

___
Python tracker 

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



[issue43836] range.index doesn't support start/stop optional arguments

2021-04-14 Thread Mark Dickinson


Mark Dickinson  added the comment:

Duplicate of #28197?

--
nosy: +mark.dickinson

___
Python tracker 

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



[issue43505] [sqlite3] Explicitly initialise and shut down sqlite3

2021-04-14 Thread Erlend Egeberg Aasland


Erlend Egeberg Aasland  added the comment:

> Making SQLITE_OMIT_AUTOINIT the default behavior would pretty much break 
> every application that use SQLite [...]

Yeah, I know, _but_ if some user decides use a SQLite library compiled with 
SQLITE_OMIT_AUTOINIT (because it is mentioned in the "Recommended Compile-time 
Optinos"[1]), Python 3.10 won't break :)


[1] https://sqlite.org/compile.html

--

___
Python tracker 

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



[issue43505] [sqlite3] Explicitly initialise and shut down sqlite3

2021-04-14 Thread Berker Peksag


Change by Berker Peksag :


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



[issue43505] [sqlite3] Explicitly initialise and shut down sqlite3

2021-04-14 Thread Berker Peksag


Berker Peksag  added the comment:


New changeset def919342facf7f53a3a5f0e9f4b1889d323956d by Erlend Egeberg 
Aasland in branch 'master':
bpo-43505: Explicitly initialize and shutdown sqlite3 (GH-25404)
https://github.com/python/cpython/commit/def919342facf7f53a3a5f0e9f4b1889d323956d


--

___
Python tracker 

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



[issue43505] [sqlite3] Explicitly initialise and shut down sqlite3

2021-04-14 Thread Berker Peksag


Berker Peksag  added the comment:

Making SQLITE_OMIT_AUTOINIT the default behavior would pretty much break every 
application that use SQLite, but since the PR is small enough and uses the 
interface in the correct way, I don't see a strong reason to reject it.

--

___
Python tracker 

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



[issue43844] [easy] test_lib2to3 logs a PendingDeprecationWarning: lib2to3 package is deprecated and may not be able to parse Python 3.10+

2021-04-14 Thread STINNER Victor


Change by STINNER Victor :


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

___
Python tracker 

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



[issue41282] Deprecate and remove distutils

2021-04-14 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset d9ba9dee7f267a603394b8d63a7697b08efdf1cb by Victor Stinner in 
branch 'master':
bpo-41282: setup.py ignores distutils DeprecationWarning (GH-25405)
https://github.com/python/cpython/commit/d9ba9dee7f267a603394b8d63a7697b08efdf1cb


--

___
Python tracker 

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



[issue43795] Implement PEP 652 -- Maintaining the Stable ABI

2021-04-14 Thread Petr Viktorin


Petr Viktorin  added the comment:


New changeset 92eebf6dd20c541ca5883d010a575fb6ea4a245c by Petr Viktorin in 
branch 'master':
bpo-43795: Sort PC/python3dll.c (GH-25312)
https://github.com/python/cpython/commit/92eebf6dd20c541ca5883d010a575fb6ea4a245c


--

___
Python tracker 

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



[issue38530] Offer suggestions on AttributeError and NameError

2021-04-14 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:


New changeset 5bf8bf2267cd109970b2d946d43b2e9f71379ba2 by Pablo Galindo in 
branch 'master':
bpo-38530: Offer suggestions on NameError (GH-25397)
https://github.com/python/cpython/commit/5bf8bf2267cd109970b2d946d43b2e9f71379ba2


--

___
Python tracker 

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



[issue43426] test_importlib.test_windows emits deprecation warning over usage of distutils

2021-04-14 Thread STINNER Victor


STINNER Victor  added the comment:

It should be fixed by:

commit 1899087b21119c5c64cd41619b542c0bf0ab5751
Author: Brett Cannon 
Date:   Fri Mar 26 11:55:07 2021 -0700

bpo-42136: Deprecate module_repr() as found in importlib (GH-25022)

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



[issue43840] [easy] test_distutils logs 3 DeprecationWarning warnings

2021-04-14 Thread STINNER Victor


STINNER Victor  added the comment:

Ok, let's reuse bpo-41282.

I created PR 25405 and PR 25406.

--
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> Deprecate and remove distutils

___
Python tracker 

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



[issue41282] Deprecate and remove distutils

2021-04-14 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +24139
pull_request: https://github.com/python/cpython/pull/25406

___
Python tracker 

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



[issue41282] Deprecate and remove distutils

2021-04-14 Thread STINNER Victor


Change by STINNER Victor :


--
nosy: +vstinner
nosy_count: 19.0 -> 20.0
pull_requests: +24138
pull_request: https://github.com/python/cpython/pull/25405

___
Python tracker 

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



[issue43505] [sqlite3] Explicitly initialise and shut down sqlite3

2021-04-14 Thread Erlend Egeberg Aasland


Change by Erlend Egeberg Aasland :


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

___
Python tracker 

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



[issue20364] Rename & explain sqlite3.Cursor.execute 'parameters' param

2021-04-14 Thread Berker Peksag


Change by Berker Peksag :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
versions: +Python 3.10, Python 3.9 -Python 2.7, Python 3.3, Python 3.4

___
Python tracker 

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



[issue20364] Rename & explain sqlite3.Cursor.execute 'parameters' param

2021-04-14 Thread Berker Peksag


Berker Peksag  added the comment:


New changeset 95e4431804587a0c9d464bb7b3d5f3057bbeaccd by Miss Islington (bot) 
in branch '3.9':
bpo-20364: Improve sqlite3 placeholder docs (GH-25003)
https://github.com/python/cpython/commit/95e4431804587a0c9d464bb7b3d5f3057bbeaccd


--

___
Python tracker 

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



[issue43846] Control stack usage in large expressions

2021-04-14 Thread Mark Shannon


Change by Mark Shannon :


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

___
Python tracker 

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



[issue43846] Control stack usage in large expressions

2021-04-14 Thread Mark Shannon


Change by Mark Shannon :


--
nosy: +pablogsal

___
Python tracker 

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



[issue43844] [easy] test_lib2to3 logs a PendingDeprecationWarning: lib2to3 package is deprecated and may not be able to parse Python 3.10+

2021-04-14 Thread Karthikeyan Singaravelan

Karthikeyan Singaravelan  added the comment:

I fixed this in https://github.com/python/cpython/pull/21694 . Somehow this 
seems to emit warning over full test run and not in individual case :( Is there 
a command to reproduce this always? I ran the command but it's successful for 
me and doesn't show the warning.

./python -Werror -m test -v test_lib2to3 -m test_load_grammar_from_subprocess
== CPython 3.10.0a7+ (heads/master:d9151cb453, Apr 13 2021, 03:10:47) [GCC 
7.5.0]
== Linux-4.15.0-99-generic-x86_64-with-glibc2.27 little-endian
== cwd: /root/cpython/build/test_python_20462æ
== CPU count: 1
== encodings: locale=UTF-8, FS=utf-8
0:00:00 load avg: 0.02 Run tests sequentially
0:00:00 load avg: 0.02 [1/1] test_lib2to3
test_load_grammar_from_subprocess (lib2to3.tests.test_parser.TestPgen2Caching) 
... ok

--

Ran 1 test in 0.164s

OK

== Tests result: SUCCESS ==

1 test OK.

Total duration: 303 ms
Tests result: SUCCESS

--
nosy: +xtreak

___
Python tracker 

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



[issue43840] [easy] test_distutils logs 3 DeprecationWarning warnings

2021-04-14 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

I have reported this in the original issue earlier 
https://bugs.python.org/issue41282#msg388224 . See also 
https://bugs.python.org/issue43425 for more discussion over handling this.

--
nosy: +xtreak

___
Python tracker 

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



[issue43847] realpath of bytestr smb drive letters fail

2021-04-14 Thread ed


New submission from ed :

some win7sp1 and win10:20H2 boxes cannot realpath a networked drive letter such 
as b"n:" (also affects b"n:\\")
 * observed with 3.8.7 and 3.9.1
 * 3.7.9 is fine

requirements to trigger:
 * bytestring (not unicode str)
 * just the drive letter (subfolders are ok)
 * networked drive (regular disks and vmhgfs are ok)
 * enterprise/AD network? (doesn't seem to happen with samba)

hits the following exceptions in succession:
 * access denied at L601: "path = _getfinalpathname(path)"
 * "cant concat str to bytes" at L621: "return path + tail"

--
components: Windows
messages: 391074
nosy: 9001, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: realpath of bytestr smb drive letters fail
type: behavior
versions: Python 3.8, Python 3.9

___
Python tracker 

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



[issue20364] Rename & explain sqlite3.Cursor.execute 'parameters' param

2021-04-14 Thread miss-islington


Change by miss-islington :


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

___
Python tracker 

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



[issue20364] Rename & explain sqlite3.Cursor.execute 'parameters' param

2021-04-14 Thread Berker Peksag


Berker Peksag  added the comment:


New changeset 3386ca0b36327afeef8d7eff277b2aed1030c08d by Erlend Egeberg 
Aasland in branch 'master':
bpo-20364: Improve sqlite3 placeholder docs (GH-25003)
https://github.com/python/cpython/commit/3386ca0b36327afeef8d7eff277b2aed1030c08d


--
nosy: +berker.peksag

___
Python tracker 

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



[issue43834] Use context manager in StringIO example

2021-04-14 Thread John Hagen


Change by John Hagen :


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

___
Python tracker 

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



[issue43846] Control stack usage in large expressions

2021-04-14 Thread Mark Shannon


New submission from Mark Shannon :

Large literals or function calls with many arguments can consume a lot of stack 
space.

This will be a problem for any future work to use a contiguous stack for data 
and possibly eliminate frame objects for most calls.

It is also possible (I haven't measured this) that this large stack consumption 
is hurting performance now, as it might leak memory by leaving giant frames in 
the free-list or as a zombie frame.

This fix relatively straightforward. For large literals and argument lists, 
build them incrementally rather than all at once.

--
assignee: Mark.Shannon
components: Interpreter Core
messages: 391072
nosy: Mark.Shannon
priority: normal
severity: normal
stage: needs patch
status: open
title: Control stack usage in large expressions
type: performance

___
Python tracker 

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



[issue43845] test_concurrent_futures leaks many dangling threads on FreeBSD

2021-04-14 Thread STINNER Victor


STINNER Victor  added the comment:

See also:

* bpo-39995: test_concurrent_futures: 
ProcessPoolSpawnExecutorDeadlockTest.test_crash() fails with OSError: [Errno 9] 
Bad file descriptor
* bpo-35809: test_concurrent_futures.ProcessPoolForkExecutorDeadlockTest fails 
intermittently on Travis and passes in verbose mode

--

___
Python tracker 

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



[issue43845] test_concurrent_futures leaks many dangling threads on FreeBSD

2021-04-14 Thread STINNER Victor


New submission from STINNER Victor :

test_idle_process_reuse_multiple() of test_concurrent_futures failed on AMD64 
FreeBSD Shared 3.x, but then passed when re-run in verbose mode.
https://buildbot.python.org/all/#/builders/483/builds/1073

Moreover, test_concurrent_futures leaked many dangling threads.


0:04:31 load avg: 1.95 [163/427/1] test_concurrent_futures failed (3 min 29 
sec) -- running: test_nntplib (2 min 17 sec)
Warning -- threading_cleanup() failed to cleanup 2 threads (count: 2, dangling: 
3)
Warning -- Dangling thread: <_ExecutorManagerThread(Thread-41, started 
34386025472)>
Warning -- Dangling thread: <_MainThread(MainThread, started 34374492160)>
Warning -- Dangling thread: 
Warning -- threading_cleanup() failed to cleanup -2 threads (count: 0, 
dangling: 1)
Warning -- Dangling thread: <_MainThread(MainThread, started 34374492160)>
(...)
==
FAIL: test_idle_process_reuse_multiple 
(test.test_concurrent_futures.ProcessPoolForkProcessPoolExecutorTest)
--
Traceback (most recent call last):
  File 
"/usr/home/buildbot/python/3.x.koobs-freebsd-564d/build/Lib/test/test_concurrent_futures.py",
 line 1018, in test_idle_process_reuse_multiple
self.assertLessEqual(len(executor._processes), 2)
AssertionError: 3 not less than or equal to 2

Stdout:
0.43s 

--

Ran 226 tests in 209.441s

FAILED (failures=1, skipped=6)
test test_concurrent_futures failed
(...)
1 re-run test:
test_concurrent_futures

Total duration: 16 min 7 sec
Tests result: FAILURE then SUCCESS

--
components: Tests
messages: 391070
nosy: vstinner
priority: normal
severity: normal
status: open
title: test_concurrent_futures leaks many dangling threads on FreeBSD
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



[issue43492] Upgrade to SQLite 3.35.4 in macOS and Windows

2021-04-14 Thread Erlend Egeberg Aasland


Erlend Egeberg Aasland  added the comment:

Looks like there might be a 3.35.5 release in the near future: 
https://sqlite.org/forum/forumpost/d36426225c?t=h

--

___
Python tracker 

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



[issue43825] Deprecation warnings in test_cmd_line and test_collections

2021-04-14 Thread STINNER Victor


STINNER Victor  added the comment:

I also created bpo-43839 "[easy] test_cmd_line: DeprecationWarning: invalid 
escape sequence \u" which was closed as duplicate of this one.

--

___
Python tracker 

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



[issue43825] Deprecation warnings in test_cmd_line and test_collections

2021-04-14 Thread STINNER Victor


Change by STINNER Victor :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
title: [easy] test_collections: DeprecationWarning: Please use assertEqual 
instead -> Deprecation warnings in test_cmd_line and test_collections

___
Python tracker 

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



[issue43265] [sqlite3] Improve backup error handling

2021-04-14 Thread Berker Peksag


Berker Peksag  added the comment:

Thank you.

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



[issue43825] [easy] test_collections: DeprecationWarning: Please use assertEqual instead

2021-04-14 Thread STINNER Victor


STINNER Victor  added the comment:

Thanks Karthikeyan! Usually, I let core developers to merge their own PRs, but 
I created multiple "easy" issues about warnings in tests, and so I merged 
directly your fix to prevent contributors to propose similar fixes ;-)

--

___
Python tracker 

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



[issue43265] [sqlite3] Improve backup error handling

2021-04-14 Thread Berker Peksag


Berker Peksag  added the comment:


New changeset c1ae7419975f7d664320f66ea3acc8663bbf76cf by Erlend Egeberg 
Aasland in branch 'master':
bpo-43265: Improve sqlite3.Connection.backup error handling (GH-24586)
https://github.com/python/cpython/commit/c1ae7419975f7d664320f66ea3acc8663bbf76cf


--

___
Python tracker 

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



[issue43825] [easy] test_collections: DeprecationWarning: Please use assertEqual instead

2021-04-14 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset b8509ffa82d393d9d4a0f5520edca057978bbd86 by Karthikeyan 
Singaravelan in branch 'master':
bpo-43825: Fix deprecation warnings in test_cmd_line and test_collections 
(GH-25380)
https://github.com/python/cpython/commit/b8509ffa82d393d9d4a0f5520edca057978bbd86


--

___
Python tracker 

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



[issue43825] [easy] test_collections: DeprecationWarning: Please use assertEqual instead

2021-04-14 Thread STINNER Victor


STINNER Victor  added the comment:

Serhiy closed my issue bpo-43841 as a duplicate of this one. My message:

Does someone want to propose a fix?

$ ./python -m test -v test_collections 
(...)
test_issue_4920 (test.test_collections.TestCollectionABCs) ... 
/home/vstinner/python/master/Lib/test/test_collections.py:1518: 
DeprecationWarning: Please use assertEqual instead.
  self.assertEquals(len(s), len(items) - 1)
ok
(...)
Tests result: SUCCESS


Warning introduced by PR 25209:

commit 453074c8daf996b1815a0cd2218f0dbf1801056c
Author: Stepan Sindelar 
Date:   Thu Apr 8 01:31:55 2021 +0200

Fix broken test for MutableSet.pop() (GH-25209)

Changes the test to not assert concrete result of pop, but just that it
was an item from the set, and that the set shrunk by one.

--
nosy: +vstinner
title: Deprecation warnings in test cases -> [easy] test_collections: 
DeprecationWarning: Please use assertEqual instead

___
Python tracker 

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



[issue43844] [easy] test_lib2to3 logs a PendingDeprecationWarning: lib2to3 package is deprecated and may not be able to parse Python 3.10+

2021-04-14 Thread STINNER Victor


Change by STINNER Victor :


--
components: +Tests
keywords: +easy, newcomer friendly
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



  1   2   >