[issue41774] While removing element from list using for and remove(), which has same items output is not right

2020-10-04 Thread Raymond Hettinger


Change by Raymond Hettinger :


--
assignee:  -> terry.reedy

___
Python tracker 

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



[issue41931] Make dict(object) return its attribute __dict__

2020-10-04 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

Sorry, but I think there is a near zero chance that the language will be 
revised as you suggest. 

Marking this as closed. If you want to have more discussion, please take it to 
the python-ideas maillist.

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



Re: Problem

2020-10-04 Thread Mirko via Python-list
Am 03.10.2020 um 17:25 schrieb Dennis Lee Bieber:
> On Fri, 2 Oct 2020 21:47:38 +0200, Hexamorph  declaimed
> the following:
> 
> 
>>
>> - Add a folder named "Python.org " (or similar) to the
>> desktop with shortcuts to Python, IDLE and the CHM.
>>
>> - Add a checkbox (default enabled) like "Start the IDLE Python
>> Editor/Shell" at the end of the installation procedure.
>>
> 
>   Which may only result in reinforcing the idea that one runs the
> installer to run Python.


Perhaps not if the installer says, that Python is already installed
and accessible per Startmenu and desktop icons. At some point they
will probably notice this hint. There are multiple reasons, why
beginners don't find out how to start Python. Some expect a
GUI-Application like an Editor in the Startmenu, some expect desktop
icons, some don't realize, that the installer is just that. They all
need a different change.

However, I'm out of this discussion now. With the exception of Terry
changing IDLE's menu entry, this has been a very unproductive
discussion. People where only highlighting possible drawbacks and
remaining problems (including the usual nitpicking on edge-cases)
without coming up with own ideas.

If you want to lessen the amount of those initial newcomer
questions, reconsider what was proposed:

- Rename the MSI as suggested by Eryk Sun.
- Add a folder named "Python.org " (or similar) to the
desktop with shortcuts to Python, IDLE and the CHM.
- Add a checkbox (default enabled) like "Start the IDLE Python
Editor/Shell" at the end of the installation procedure.
- Perhaps, if possible, add a button like "Start the IDLE Python
Editor/Shell" to the Repair/Modify/Remove Dialog.

So long and happy hacking! :-)
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue41428] PEP 604 -- Allow writing union types as X | Y

2020-10-04 Thread Guido van Rossum


Change by Guido van Rossum :


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



[issue41428] PEP 604 -- Allow writing union types as X | Y

2020-10-04 Thread Guido van Rossum


Guido van Rossum  added the comment:


New changeset 8e1dd55e63d18d40e78d941fc9233d2c77bcd3de by Fidget-Spinner in 
branch 'master':
bpo-41428: Documentation for PEP 604  (gh-22517)
https://github.com/python/cpython/commit/8e1dd55e63d18d40e78d941fc9233d2c77bcd3de


--
nosy: +gvanrossum

___
Python tracker 

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



[issue41892] use both "for in" and "ElementTree.remove" has a index bug

2020-10-04 Thread Stefan Behnel


Stefan Behnel  added the comment:

Closing since this works as designed.

Users are responsible for avoiding concurrent tree modifications during 
iteration.

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



Collecting more feedback about contributing to Python

2020-10-04 Thread Tal Einat
Have you tried contributing to the development of Python itself, or have
considered doing so? I'd like to hear your thoughts and experiences! I'm
collecting such information to guide work during the upcoming core-dev
sprint on making contribution easier and friendlier.

You can reach out publicly or privately. I'll keep private stories to
myself, only mentioning specific relevant points from them without
mentioning who sent them.

Public stories will be added to the dedicated repo, which already includes
many such stories which I have previously collected.
https://github.com/taleinat/python-contribution-feedback

For more info on the core dev sprint:
https://python-core-sprint-2020.readthedocs.io/index.html

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


[issue41938] concurrent.futures.wait calls len() on an possible iterable

2020-10-04 Thread Kaushal Rohit


Change by Kaushal Rohit :


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

___
Python tracker 

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



[issue41938] concurrent.futures.wait calls len() on an possible iterable

2020-10-04 Thread Kaushal Rohit


New submission from Kaushal Rohit :

`fs` argument could be an iterable, and calling len on it would raise an 
Exception.

We are converting `fs` into a set anyways for set difference, and that too 
twice. we can just put an `fs = set(fs)`.

Let me know if we choose to go with that and I will make a PR ASAP.

Thanks.

--
components: Library (Lib)
messages: 377991
nosy: rohitkg98
priority: normal
severity: normal
status: open
title: concurrent.futures.wait calls len() on an possible iterable
type: behavior
versions: Python 3.10

___
Python tracker 

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



[issue41912] Long generator chain causes segmentation fault

2020-10-04 Thread Tim Peters


Tim Peters  added the comment:

"Stackless" is a large topic with a convoluted history. Do the web search. In 
short, no, it will never go in the core - too disruptive to too many things. 
Parts have lived on in other ways, watered down versions. The PyPy project 
captured most of what remains, as optional features. CPython's generators 
captured the easiest part: after a yield, the C stack space the generator 
consumed is released, while the Python VM stack space lives on in the heap 
awaiting possible resumption (but, if/when it's resumed, C stack space is 
required again).

--

___
Python tracker 

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



[issue41892] use both "for in" and "ElementTree.remove" has a index bug

2020-10-04 Thread Ned Deily


Ned Deily  added the comment:


New changeset d5719247ba32b3ac700454bad9a9e2cc7edeac6a by Miss Skeleton (bot) 
in branch '3.9':
bpo-41892: Clarify that an example in the ElementTree docs explicitly avoids 
modifying an XML tree while iterating over it. (GH-22464) (GH-22554)
https://github.com/python/cpython/commit/d5719247ba32b3ac700454bad9a9e2cc7edeac6a


--

___
Python tracker 

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



[issue41937] how to use cpython O

2020-10-04 Thread Steven D'Aprano


Steven D'Aprano  added the comment:

Please don't post screen shots of text when you can post a direct link to the 
page.

Are you talking about this?

https://docs.python.org/3/c-api/arg.html?highlight=py_cleanup#other-objects

This is a bug tracker, for reporting bugs in the Python interpreter and 
standard library, not a help desk for asking for help with your code. There are 
many other places where you can ask for help, such as:

- Stackoverflow

- Reddit's /r/learnpython

- https://python-forum.io/

- the Python-List mailing list 
https://mail.python.org/mailman/listinfo/python-list

- IRC https://www.python.org/community/irc/

and probably many more.

For help getting your code to work, see the above forums.

I'm going to close this as "Not A Bug", if you have an actual bug to report, 
you can re-open this with a demonstration of the bug.

--
nosy: +steven.daprano
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



[issue41925] Lowercase path to python.exe in pip.exe from venv is throwing error

2020-10-04 Thread Eryk Sun


Eryk Sun  added the comment:

> I wouldn't think that changing locales would have an effect on Windows
> paths being case sensitive or not, otherwise folks from other countries
> would be experiencing this error. Perhaps the mixing of locale and system
> language? I had locale set to Japan but system language set to English

It shouldn't make a difference. Filenames are Unicode, the NTFS case table is 
set on disk when the filesystem is formatted, and the launcher uses 
wide-character strings and calls CreateProcessW. I wish I could offer up a 
reasonable explanation, but I think this one stays in the category of strange 
problems fixed by turning it off and on again.

--

___
Python tracker 

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



[issue41935] Add binary operator!

2020-10-04 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

You can already do:

my_counter = 0

for i in rage(1000):
my_counter += (1 if (i % 2) == 0 else 0)

--
nosy: +pablogsal

___
Python tracker 

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



[issue41935] Add binary operator!

2020-10-04 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

In any case, for modifications about the Python syntax, please, open first some 
debate in the python-ideas mailing list.

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



[issue41892] use both "for in" and "ElementTree.remove" has a index bug

2020-10-04 Thread miss-islington


miss-islington  added the comment:


New changeset 6bd058e0ff5d4a63fb35f6d45161cdf51cb68c58 by Miss Skeleton (bot) 
in branch '3.8':
bpo-41892: Clarify that an example in the ElementTree docs explicitly avoids 
modifying an XML tree while iterating over it. (GH-22464)
https://github.com/python/cpython/commit/6bd058e0ff5d4a63fb35f6d45161cdf51cb68c58


--

___
Python tracker 

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



[issue41892] use both "for in" and "ElementTree.remove" has a index bug

2020-10-04 Thread miss-islington


Change by miss-islington :


--
pull_requests: +21552
pull_request: https://github.com/python/cpython/pull/22554

___
Python tracker 

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



[issue41892] use both "for in" and "ElementTree.remove" has a index bug

2020-10-04 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 7.0 -> 8.0
pull_requests: +21551
pull_request: https://github.com/python/cpython/pull/22553

___
Python tracker 

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



[issue41937] how to use cpython O

2020-10-04 Thread twoone3


New submission from twoone3 <3197653...@qq.com>:

When I use'O&' to parse the parameters, I have never succeeded, I hope I can 
give a demo

--
files: Screenshot_2020_1005_070639.png
messages: 377983
nosy: twoone3
priority: normal
severity: normal
status: open
title: how to use cpython O&
type: behavior
versions: Python 3.8
Added file: https://bugs.python.org/file49494/Screenshot_2020_1005_070639.png

___
Python tracker 

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



[issue41892] use both "for in" and "ElementTree.remove" has a index bug

2020-10-04 Thread Ned Deily


Ned Deily  added the comment:


New changeset 40db798692ca783fc2163656f196ac77e8b9e792 by scoder in branch 
'master':
bpo-41892: Clarify that an example in the ElementTree docs explicitly avoids 
modifying an XML tree while iterating over it. (GH-22464)
https://github.com/python/cpython/commit/40db798692ca783fc2163656f196ac77e8b9e792


--
nosy: +ned.deily

___
Python tracker 

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



[issue41909] Segfault on __getattr__ infinite recursion on certain attribute accesses

2020-10-04 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


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

___
Python tracker 

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



[issue40640] Tutorial for Continue missing ... line

2020-10-04 Thread Irit Katriel


Change by Irit Katriel :


--
nosy: +orsenthil

___
Python tracker 

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



[issue40640] Tutorial for Continue missing ... line

2020-10-04 Thread Irit Katriel


Irit Katriel  added the comment:

ping

--
nosy: +iritkatriel
versions:  -Python 3.5, Python 3.6, Python 3.7

___
Python tracker 

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



[issue41936] Remove macros Py_ALLOW_RECURSION/Py_END_ALLOW_RECURSION

2020-10-04 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


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

___
Python tracker 

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



[issue41909] Segfault on __getattr__ infinite recursion on certain attribute accesses

2020-10-04 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset 7aa22ba923509af1dbf115c090964f503c84ca8d by Serhiy Storchaka in 
branch '3.9':
[3.9] bpo-41909: Enable previously disabled recursion checks. (GH-22536) 
(GH-22550)
https://github.com/python/cpython/commit/7aa22ba923509af1dbf115c090964f503c84ca8d


--

___
Python tracker 

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



[issue41909] Segfault on __getattr__ infinite recursion on certain attribute accesses

2020-10-04 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset 09a7b3b618cd02694a0bc8abfa24c75f0e659407 by Serhiy Storchaka in 
branch '3.8':
[3.8] bpo-41909: Enable previously disabled recursion checks. (GH-22536) 
(GH-22551)
https://github.com/python/cpython/commit/09a7b3b618cd02694a0bc8abfa24c75f0e659407


--

___
Python tracker 

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



[issue41936] Remove macros Py_ALLOW_RECURSION/Py_END_ALLOW_RECURSION

2020-10-04 Thread Serhiy Storchaka


New submission from Serhiy Storchaka :

Macros Py_ALLOW_RECURSION and Py_END_ALLOW_RECURSION together with field 
recursion_critical of the PyInterpreterState structure were added in 
5b222135f8d2492713994f2cb003980e87ce6a72 but were never documented. It seems 
that the reason of adding them was to work around the fact that 
PyDict_GetItem() can silence any exception including recursion error. But 
PyDict_GetItem() no longer used in that code and the macros are also no longer 
used (see issue41909).

GvR proposed to remove these macros. I think that recursion_critical can be 
removed too.

--
components: C API
messages: 377978
nosy: gvanrossum, serhiy.storchaka, vstinner
priority: normal
severity: normal
status: open
title: Remove macros Py_ALLOW_RECURSION/Py_END_ALLOW_RECURSION
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



[issue41909] Segfault on __getattr__ infinite recursion on certain attribute accesses

2020-10-04 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
pull_requests: +21549
pull_request: https://github.com/python/cpython/pull/22551

___
Python tracker 

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



[issue41909] Segfault on __getattr__ infinite recursion on certain attribute accesses

2020-10-04 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
pull_requests: +21548
pull_request: https://github.com/python/cpython/pull/22550

___
Python tracker 

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



[issue41909] Segfault on __getattr__ infinite recursion on certain attribute accesses

2020-10-04 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset 9ece9cd65cdeb0a1f6e60475bbd0219161c348ac by Serhiy Storchaka in 
branch 'master':
bpo-41909: Enable previously disabled recursion checks. (GH-22536)
https://github.com/python/cpython/commit/9ece9cd65cdeb0a1f6e60475bbd0219161c348ac


--

___
Python tracker 

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



Re: python show folder files and not subfolder files

2020-10-04 Thread Cameron Simpson
On 04Oct2020 02:56, pascal z  wrote:
>On Thursday, September 24, 2020 at 4:37:07 PM UTC+2, Terry Reedy wrote:
>> Read
>> https://docs.python.org/3/faq/programming.html#what-is-the-most-efficient-way-to-concatenate-many-strings-together
>
>Thanks for this tip. I do think it's better to use lists than 
>concatenate into string variable. However, writing a list to a csv file 
>is not something easy. If strings stored into the list have commas and 
>single quotes (like song title's), it messes up the whole csv when it 
>first meets this. [...]
>[...]
>csv_contents = "%s;%s;%s;%.2f;%.2f;%.2f;%.2f;%s" % (vfolder_path, 
>vfile_name, vfolder_path_full, 0.00, 0.00, 0.00,0.00, "folder")
>arr.append([csv_contents])
>[...]

Is there a reaon you're not using the csv module to write and read CSV 
files. It knows how to correctly escape values in a number of common 
dialects (the default dialect works well).

By composing CSV files with %-formatting (or with any crude string 
cormatting) you the exact syntax issue you're describing. Faced with 
user supplied data, these issues become "injection attacks", as 
exemplified by this XKCD comics:

https://xkcd.com/327/
https://www.explainxkcd.com/wiki/index.php/Little_Bobby_Tables

The correct approach here is to have a general and _correct_ formatter 
for the values, and to not assemble things with simplistic approaches 
like %-formatting.

With databases the standard approach for assembling SQL is to provide 
template SQL with the values as arguments, and have the db-specific 
driver construct SQL for you. And with CSV files the same applies: 
import the csv module and use csv.writer() to general the CSV data; you 
just hand the writer an array of values (strings, floats, whatever) and 
it takes care of using the correct syntax in the file.

Cheers,
Cameron Simpson 
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue41935] Add binary operator!

2020-10-04 Thread Hadi Alqattan


New submission from Hadi Alqattan :

What are your opinions about adding a binary operator to Python in order to 
make this code possible?
```
my_counter = 0

for i in rage(1000):
my_counter += 1 if (i % 2) == 0
```

--
components: Interpreter Core
messages: 377976
nosy: hadialqattan
priority: normal
severity: normal
status: open
title: Add binary operator!
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



[issue41934] Add `has` method to `pathlib.Path` class.

2020-10-04 Thread Hadi Alqattan


Hadi Alqattan  added the comment:

You're right, I'm sorry.

--

___
Python tracker 

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



[issue41934] Add `has` method to `pathlib.Path` class.

2020-10-04 Thread Hadi Alqattan


Change by Hadi Alqattan :


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



[issue41934] Add `has` method to `pathlib.Path` class.

2020-10-04 Thread Eric V. Smith


Eric V. Smith  added the comment:

Isn't this just:
(project_path / "main.py").exists()
?

I don't think .has would be any more efficient.

--
nosy: +eric.smith

___
Python tracker 

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



[issue41934] Add `has` method to `pathlib.Path` class.

2020-10-04 Thread Hadi Alqattan


New submission from Hadi Alqattan :

Adding a new method to `pathlib.Path` class, `has` method is a method that can 
determine if the `Path` object has a specific file/dir or not.

Assume that we have a `Path` object for this `project/` directory:
```
project/
  main.py
  __init__.py
  utils/
```
and we want to know if the project directory has `main.py` or not, after adding 
this method we will be able to do this:
```
from pathlib import Path

project_path = Path("./project")

if project_path.has("main.py"):
pass  # do something.
```

--
components: Library (Lib)
messages: 377973
nosy: hadialqattan
priority: normal
severity: normal
status: open
title: Add `has` method to `pathlib.Path` class.
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



[issue26680] Incorporating float.is_integer into the numeric tower and Decimal

2020-10-04 Thread Guido van Rossum


Guido van Rossum  added the comment:

Possibly at some point in the future we can switch to using typing.Protocol, 
which requires neither registration nor explicit subclassing (it's like 
Hashable). This makes it easy for user code to define custom protocols as 
needed. So if you need something that has .keys() and .items() but you don't 
care about .values() you can just write

class KeysAndItems(typing.Protocol):
def keys(self): ...
def items(self): ...

def my_func(x: KeysAndItems):
...

This can be statically checked using e.g. mypy.

--

___
Python tracker 

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



[issue26680] Incorporating float.is_integer into the numeric tower and Decimal

2020-10-04 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

> How so?

When a concrete class registers with an ABC, it is making a promise that it 
implements everything in the ABC so that client code can count on all the 
methods being present.  That is the raison d'etre for abstract base classes.

In general, we restrict ABCs to a minimal useful subset of the capabilities of 
concrete classes.  That makes the ABC more broadly applicable and it makes life 
easier for implementers of concrete classes.  That's why collections.abc.Set 
doesn't include most of the named methods present in the concrete set/frozenset 
types.

Likewise, we don't want to add methods to already published ABCs because 
existing user classes registered to the ABC stop being compliant.  If an 
additional method is deemed essential, the technically correct way to do is to 
make a new ABC that subclasses from the old.  For example, that's why Python 2 
had to have both UserDict and IterableUserDict when we needed to add a 
__iter__() method.

--

___
Python tracker 

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



[issue41931] Make dict(object) return its attribute __dict__

2020-10-04 Thread மனோஜ்குமார் பழனிச்சாமி

மனோஜ்குமார் பழனிச்சாமி  added the comment:

Changing '__dict__' to __vars__ will be much better.

Like len() calling __len__()

Can we change the title?

Why Github Issue Tracker is not issued?

--

___
Python tracker 

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



pytest-6.1.1

2020-10-04 Thread Ran Benita
pytest 6.1.1 has just been released to PyPI.

This is a bug-fix release, being a drop-in replacement. To upgrade::

  pip install --upgrade pytest

The full changelog is available at 
https://docs.pytest.org/en/stable/changelog.html.

Thanks to all of the contributors to this release:

* Ran Benita


Happy testing,
The pytest Development Team
___
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


[issue41905] add update_abstractmethods function to update an ABC's abstract methods

2020-10-04 Thread Ben Avrahami


Ben Avrahami  added the comment:

> Adding a function to recalculate will require everyone to use it

I'd argue that this is akin to `functools.update_wrapper`. It too is a function 
that must be called in virtually every function decorator (the only function 
decorators that don't/needn't call it are the built-in method decorators and, 
appropriately enough, @abstractmethod), and if not called, certain 
functionality won't work.

> and worse, know that it even exists

I think that knowing about such a function is a fair requirement. Mixin tools 
already has nuances and edge cases, such that it should only be done (and 
especially distributed) by advanced users.

Furthermore, not all class mixin tools have/need to be ABC-aware. Just as 
`total_ordering` is ABC-agnostic (indeed, it is also subclass-agnostic), any 
other mixin tool can decide that implementing abstract classes is simply not a 
use case for them. The upshot of the `update_abstractmethods` implementation is 
that, as long as their implementation isn't afraid to override methods that are 
already defined (like attrs does), the function can be slotted above 
ABC-agnostic wrappers and it suddenly becomes ABC-aware.

--

___
Python tracker 

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



Introducing NestedText, a nice alternative to JSON, YAML, TOML

2020-10-04 Thread python
NestedText is a file format for holding data that is to be entered, edited, or 
viewed by people. It allows data to be organized into a nested collection of 
dictionaries, lists, and strings.  Similar to YAML, but much simpler. It pairs 
nicely with voluptuous to create a simple and powerful solution for 
configuration files.
 

NestedText is a nice alternative to JSON, YAML, and TOML.

Documentation: https://nestedtext.org
Install: pip install nestedtext
Support: https://github.com/KenKundert/nestedtext/issues
License: MIT

Give it a try.
-Ken (nestedt...@shalmirane.com)

https://nestedtext.org;>NestedText 1.0A Human Friendly Data 
Format. (03-Oct-20)
___
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


[issue41931] Make dict(object) return its attribute __dict__

2020-10-04 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

The vars() function already does this.

--
nosy: +rhettinger

___
Python tracker 

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



[issue41931] Make dict(object) return its attribute __dict__

2020-10-04 Thread மனோஜ்குமார் பழனிச்சாமி

மனோஜ்குமார் பழனிச்சாமி  added the comment:

Your point makes sense as it takes space to allocate for the new instance to 
just return another dict object. 
Then the attribute name at least should be meaningful.

Instead of __dict__ , __attr__ is more appropriate.

--

___
Python tracker 

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



[issue41925] Lowercase path to python.exe in pip.exe from venv is throwing error

2020-10-04 Thread Chris Tse


Chris Tse  added the comment:

Another update:

After a full shutdown from yesterday and trying again today, everything seems 
to be working now, including activating the venv via:

  1. python -m venv myenv
  2. .\myenv\Scripts\activate (not Activate.ps1, though that work too, is this 
intended?)

The only thing I can think of that changed since I opened the report was that I 
changed my system locale back to English (United States) from Japan (Japan). I 
did a system restart to make the changes take effect, but it didn't seem to fix 
the issue at the time. It could possibly be a difference between a shutdown vs 
a restart. Odd, either way.

I wouldn't think that changing locales would have an effect on Windows paths 
being case sensitive or not, otherwise folks from other countries would be 
experiencing this error. Perhaps the mixing of locale and system language? I 
had locale set to Japan but system language set to English

Thank you for taking the time to reply.

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



[issue41931] Make dict(object) return its attribute __dict__

2020-10-04 Thread Irit Katriel


Irit Katriel  added the comment:

You ignored the other point I made: dict is not a function, it is a class. 
dict() calls the function dict.__init__() which should create a new instance of 
dict (not return some field of its parameter). 


You also didn't justify your suggestion in any way. Why should this change be 
made?

--

___
Python tracker 

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



[issue41892] use both "for in" and "ElementTree.remove" has a index bug

2020-10-04 Thread Stefan Behnel


Change by Stefan Behnel :


--
pull_requests: +21547
pull_request: https://github.com/python/cpython/pull/22546

___
Python tracker 

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



[issue41490] Update bundled pip to 20.2.1 and setuptools to 49.2.1

2020-10-04 Thread Łukasz Langa

Łukasz Langa  added the comment:

This change goes into 3.9.0 with Pablo's fix.

--

___
Python tracker 

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



[issue41490] Update bundled pip to 20.2.1 and setuptools to 49.2.1

2020-10-04 Thread Łukasz Langa

Łukasz Langa  added the comment:


New changeset 4b4d60f9287e0e52c2569876456f40efc11529b4 by Pablo Galindo in 
branch '3.9':
[3.9] bpo-41490: Bump vendored pip to version 20.2.3 (GH-22527). (GH-22544)
https://github.com/python/cpython/commit/4b4d60f9287e0e52c2569876456f40efc11529b4


--

___
Python tracker 

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



[issue41490] Update bundled pip to 20.2.1 and setuptools to 49.2.1

2020-10-04 Thread Łukasz Langa

Łukasz Langa  added the comment:


New changeset 28cd96f2e5cfb16566a75dca8473b71889746f10 by Pablo Galindo in 
branch '3.8':
[3.8] bpo-41490: Bump vendored pip to version 20.2.3 (GH-22527). (GH-22545)
https://github.com/python/cpython/commit/28cd96f2e5cfb16566a75dca8473b71889746f10


--

___
Python tracker 

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



[issue41490] Update bundled pip to 20.2.1 and setuptools to 49.2.1

2020-10-04 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
pull_requests: +21546
pull_request: https://github.com/python/cpython/pull/22545

___
Python tracker 

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



[issue41490] Update bundled pip to 20.2.1 and setuptools to 49.2.1

2020-10-04 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
pull_requests: +21545
pull_request: https://github.com/python/cpython/pull/22544

___
Python tracker 

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



[issue41490] Update bundled pip to 20.2.1 and setuptools to 49.2.1

2020-10-04 Thread Łukasz Langa

Łukasz Langa  added the comment:


New changeset 2cc6dc9896771ef3615abbb5ba80939a2f644a08 by Pablo Galindo in 
branch 'master':
bpo-41490: Bump vendored pip to version 20.2.3 (#22527)
https://github.com/python/cpython/commit/2cc6dc9896771ef3615abbb5ba80939a2f644a08


--

___
Python tracker 

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



Re: python if and same instruction line not working

2020-10-04 Thread MRAB

On 2020-10-04 10:35, pascal z via Python-list wrote:

On Tuesday, September 29, 2020 at 5:28:22 PM UTC+2, MRAB wrote:

On 2020-09-29 15:42, pascal z via Python-list wrote:
> I need to change the script commented out to the one not commented out. Why?
> 
>  # for x in sorted (fr, key=str.lower):

>  # tmpstr = x.rpartition(';')[2]
>  # if x != csv_contents and tmpstr == "folder\n":
>  # csv_contentsB += x
>  # elif x != csv_contents and tmpstr == "files\n":
>  # csv_contentsC += x
> 
>  for x in sorted (fr, key=str.lower):

>  if x != csv_contents:
>  tmpstr = x.rpartition(';')[2]
>  if tmpstr == "folder\n":
>  csv_contentsB += x
>  elif tmpstr == "file\n":
>  csv_contentsC += x
> 
You haven't defined what you mean by "not working" for any test values 
to try, but I notice that the commented code has "files\n" whereas the 
uncommented code has "file\n".


Very good point, it should what caused the issue

By the way, it seems it's ok to check \n as end of line, it will work on 
windows linux and mac platforms even if windows use \r\n

By default, when the 'open' function opens a file in text mode, it uses 
"universal newlines mode", so the rest of the program doesn't have to 
worry about the differences in line endings. It's explained in the 
documentation about the 'open' function.

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


[issue32922] dbm.open() encodes filename with default encoding rather than the filesystem encoding

2020-10-04 Thread Josh Friend


Josh Friend  added the comment:

yes it should be closed, can i do that? (ill try...)

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



[issue38302] [3.10] __pow__ and __rpow__ are not reached when __ipow__ returns NotImplemented for **=

2020-10-04 Thread Łukasz Langa

Change by Łukasz Langa :


--
title: __pow__ and __rpow__ are not reached when __ipow__ returns 
NotImplemented for **= -> [3.10] __pow__ and __rpow__ are not reached when 
__ipow__ returns NotImplemented for **=

___
Python tracker 

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



[issue41875] __builtin_unreachable error in gcc 4.4.5

2020-10-04 Thread Łukasz Langa

Łukasz Langa  added the comment:

Done.

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



[issue41933] Wording of s * n in Common Sequence Operations is not optimal

2020-10-04 Thread Julien Palard


New submission from Julien Palard :

As reported by Graham Ewart on docs@,

in https://docs.python.org/3/library/stdtypes.html#common-sequence-operations:

s * n or n * s | equivalent to adding s to itself n times

is badly worded. In fact it's more like n-1 times, but yet it's not adding s to 
itself.

I'd go for "n times the s sequence" or "n copies of the s sequence" instead, 
which both avoid the "n-1" and the "to itself" parts.

--
assignee: docs@python
components: Documentation
keywords: easy
messages: 377958
nosy: docs@python, mdk
priority: normal
severity: normal
status: open
title: Wording of s * n in Common Sequence Operations is not optimal

___
Python tracker 

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



[issue41898] Any logging causes assertLogs to pass

2020-10-04 Thread Irit Katriel


Irit Katriel  added the comment:

Troy, 

I'm also confused about how you would have liked assertLogs to behave you say:

1. I don't want to specify the logger because I don't care which logger the 
message comes from.

2. I don't want it to catch messages from other loggers (whatever other means 
here).  But -- see 1 -- you didn't specify the logger because you don't care 
which logger.

What do you expect assertLogs to do when you don't specify a logger?

--

___
Python tracker 

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



[issue41905] add update_abstractmethods function to update an ABC's abstract methods

2020-10-04 Thread Bar Harel


Bar Harel  added the comment:

> When instantiation fails, recheck to see the missing abstract methods had 
> been defined?

I've written about it in the python-ideas discussion as well, and completely 
agree.

There is no other approach that would guarantee correctness across all APIs, 
both internal and 3rd party. Adding a function to recalculate will require 
everyone to use it, and worse, know that it even exists.

The overhead should be quite low as this case is probably rare and the 
recalculation can happen only on failure.

I'm not sure however, what are the implications of changing 
Py_TPFLAGS_IS_ABSTRACT during type creation.

--
nosy: +bar.harel

___
Python tracker 

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



[issue41483] Do not acquire lock in MemoryHandler.flush() if no target defined

2020-10-04 Thread Irit Katriel


Irit Katriel  added the comment:

The missing target error was fixed under issue41503

--

___
Python tracker 

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



[issue41932] Incorrect struct definition with bitfields

2020-10-04 Thread berthin


New submission from berthin :

Hi all,

I found one issue related to bitfields and ctypes, and although there is a 
similar issue already opened (https://bugs.python.org/issue29753), that only 
covers the case with pragmas. 

Please, consider the following scenario:

>>> from ctypes import *
>>> class X(Structure):
... _fields_ = [("a", c_uint8, 8), ("b", c_uint8, 8), ("c", c_uint32, 16)]
...
>>> sizeof(X)
5


Which seems to be incorrect, because what natively C does is to generate a 
4bytes struct.

root@0bc6a647abaa:/target/cpython-fix# cat sample.c

#include 
#include 
struct X { 
uint8_t a; 
uint8_t b; 
uint32_t c:16;
} X;

int main() { 
printf("%u\n", sizeof(X)); 
}

root@0bc6a647abaa:/target/cpython-fix# gcc sample.c -o a && ./a
4

Also, if I use different databtypes I get what I expect (a struct of 4 bytes).

>>> X = type('X', (Structure,), {'_fields_': [('a', c_uint32, 8), ('b', 
>>> c_uint32, 8), ('c', c_uint32, 16)]})
>>> sizeof(X)
4
>>> X = type('X', (Structure,), {'_fields_': [('a', c_uint16, 8), ('b', 
>>> c_uint16, 8), ('c', c_uint16, 16)]})
>>> sizeof(X)
4
>>> X = type('X', (Structure,), {'_fields_': [('a', c_uint8, 8), ('b', c_uint8, 
>>> 8), ('c', c_uint16, 16)]})
>>> sizeof(X)
4

I tried to debug a little bit, adding some prints before and after calling 
*PyCField_FromDesc* in *Modules/_ctypes/stgdict.c:L603*.=, if someone wants to 
look at it, the logs are attached / one log file per each test, using the 
following gdb init:

# before
break stgdict.c:601
commands
p field_size
p bitofs
p size
p align
p *dict
continue
end


# after
break stgdict.c:617
commands
p field_size
p bitofs
p size
p align
p *(CFieldObject*) prop
continue
end

Hope someone could spot the issue, I will also try to investigate it by my own.

Best,

P.S. For the tests, I worked on top of bpo-29753 
(https://github.com/python/cpython/pull/19850)

--
components: ctypes
files: bitfields.zip
messages: 377953
nosy: FFY00, berthin
priority: normal
severity: normal
status: open
title: Incorrect struct definition with bitfields
type: behavior
versions: Python 3.10, Python 3.8, Python 3.9
Added file: https://bugs.python.org/file49493/bitfields.zip

___
Python tracker 

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



[issue41483] Do not acquire lock in MemoryHandler.flush() if no target defined

2020-10-04 Thread Kostis Anagnostopoulos


Kostis Anagnostopoulos  added the comment:

Have nothing else to say on top of what iritkatriel discovered, a double-check 
would be needed, but may be a pointless speed up, if MemoryHandler is 
impossible to work without a `target`.  

Fixing the no-target error is more important.  Actually that's how i came to 
notice this optimization.

--
status: pending -> open

___
Python tracker 

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



[issue25292] ssl socket gets into broken state when client exits during handshake

2020-10-04 Thread Carl Bordum Hansen


Carl Bordum Hansen  added the comment:

I have submitted a proposed solution

Just found this similar issue https://bugs.python.org/issue35840

--

___
Python tracker 

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



[issue41898] Any logging causes assertLogs to pass

2020-10-04 Thread Irit Katriel


Irit Katriel  added the comment:

I'm not sure my patch completely resolved this issue. I'm adding Antoine re the 
OP's question about the assertLogs API. 

> Doing so would make the test over-specific and fragile.  The requirement is > 
> that a warning be logged, not that a specific logger issue the warning.

My view is that your test is fragile because it just asks "was anything logged" 
without checking the log message. The docs show how to verify that the log 
message is what you expect it to be.

--
nosy: +pitrou

___
Python tracker 

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



[issue21756] IDLE - ParenMatch fails to find closing paren of multi-line statements

2020-10-04 Thread Tal Einat


Tal Einat  added the comment:

As noted on the PR GH-20753, an incremental change to the current logic doesn't 
seem like a promising approach.

It seems to me that this will require refactoring the code parsing logic to 
allow it to incrementally parse lines backwards and forwards in order to find 
the beginning and end of a code block.

--

___
Python tracker 

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



[issue41929] Detect OEM code page for zip archives in ZipFile based on system locale

2020-10-04 Thread Eryk Sun


Eryk Sun  added the comment:

This is already addressed in bpo-28080, which adds an `encoding` parameter -- 
e.g. `encoding="oem"` ("oem" is only available in Windows). Unfortunately 
bpo-28080 has languished without resolution for four years.

--
nosy: +eryksun

___
Python tracker 

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



[issue32112] Should uuid.UUID() accept another UUID() instance?

2020-10-04 Thread Irit Katriel


Irit Katriel  added the comment:

I agree with Serhiy that there needs to be a reason for adding this to a class 
constructor.

In the case of int, this is to implement conversion - it's not accepting int, 
it's accepting any number (it would be weird of int(3.4) worked and int(3) 
didn't).  Similarly, complex constructor accepts numbers.

In the case of tuple, bytes, bytearray - the constructor accepts any iterable, 
again in order to implement type conversion.


So it's not random - these constructors accept objects of the same type because 
they accept params of a more generic type, in order to provide type conversion 
functionality.

What functionality would we gain from increasing the API surface of the UUID 
constructor as you suggest?

--
nosy: +iritkatriel

___
Python tracker 

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



[issue41483] Do not acquire lock in MemoryHandler.flush() if no target defined

2020-10-04 Thread Vinay Sajip


Vinay Sajip  added the comment:

OK, I'll mark as pending and close in a few days if nothing more is heard from 
Kostis.

--
status: open -> pending

___
Python tracker 

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



[issue41898] Any logging causes assertLogs to pass

2020-10-04 Thread Vinay Sajip


Change by Vinay Sajip :


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

___
Python tracker 

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



[issue41898] Any logging causes assertLogs to pass

2020-10-04 Thread Vinay Sajip


Vinay Sajip  added the comment:


New changeset faa8c6a8f1fe9c3bac31061e8a59a686b983ebb8 by Miss Skeleton (bot) 
in branch '3.9':
bpo-41898: add caveat on root logger seeing all messages in assertLogs doc 
(GH-22526) (GH-22540)
https://github.com/python/cpython/commit/faa8c6a8f1fe9c3bac31061e8a59a686b983ebb8


--

___
Python tracker 

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



[issue41928] ZipFile does not supports Unicode Path Extra Field (0x7075) zip header field

2020-10-04 Thread Ivan Sorokin

Ivan Sorokin  added the comment:

Grand unified algorithm to read filenames from zip files correctly:

1. Do zip entry have «Unicode Path Extra Field» (0x7075)? Use it for file name.
2. Is Unicode flag (0x800) set in «Flags» Field of zip entry? Assume «Filename» 
Field is in UTF-8.
3. Do «HostOS» Field of zip entry have values of 0 (FAT) or 11 (NTFS)? Assume 
«Filename» Field is in OEM charset corresponding to system locale.
4. Assume «Filename» Field is in UTF-8.

p7zip with oemcp patch (https://github.com/unxed/oemcp/) uses exactly this 
method, and is able to process all zip files in my test set correctly (my test 
set contains several zips generated by different packers on windows, macos, 
linux, and by online services). The same algorithm should be used in any zip 
unpacker wishing to process non-latin filenames as gently as possible.

--

___
Python tracker 

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



[issue41483] Do not acquire lock in MemoryHandler.flush() if no target defined

2020-10-04 Thread Irit Katriel


Irit Katriel  added the comment:

I think this issue should be closed - Kostis doesn't seem keen to discuss the 
merits of this change, and as I've said I don't think it's worth pursuing.

--

___
Python tracker 

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



[issue25292] ssl socket gets into broken state when client exits during handshake

2020-10-04 Thread Carl Bordum Hansen


Change by Carl Bordum Hansen :


--
keywords: +patch
nosy: +carlbordum
nosy_count: 5.0 -> 6.0
pull_requests: +21544
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/22541

___
Python tracker 

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



[issue32222] pygettext doesn't extract docstrings for functions with type annotated params

2020-10-04 Thread Irit Katriel


Irit Katriel  added the comment:

I think this is resolved and can be closed.

--
nosy: +iritkatriel

___
Python tracker 

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



[issue32922] dbm.open() encodes filename with default encoding rather than the filesystem encoding

2020-10-04 Thread Irit Katriel


Irit Katriel  added the comment:

This seems resolved, can it be closed?

--
nosy: +iritkatriel

___
Python tracker 

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



[issue41931] Make dict(object) return its attribute __dict__

2020-10-04 Thread மனோஜ்குமார் பழனிச்சாமி

மனோஜ்குமார் பழனிச்சாமி  added the comment:

Will return only if it is not an iterator

--

___
Python tracker 

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



[issue41931] Make dict(object) return its attribute __dict__

2020-10-04 Thread Irit Katriel


New submission from Irit Katriel :

dict is not a function, it's a class and the purpose of a dict() call is to 
create a new instance of that class.

The change you are proposing is also breaking for iterators:

>>> class Pairs(list): pass
... 
>>> pairs = Pairs([('a', 1), ('b', 2)])
>>> pairs.__dict__
{}
>>> dict(pairs)
{'a': 1, 'b': 2}

A change of this magnitude will need to be discussed on python-ideas and will 
require a PEP explaining why the benefits of the change outweigh its costs. I 
very much doubt that they do.

--
nosy: +iritkatriel

___
Python tracker 

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



[issue41183] [3.5] Workaround or fix for SSL ".._KEY_TOO_SMALL" test failures

2020-10-04 Thread Łukasz Langa

Change by Łukasz Langa :


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

___
Python tracker 

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



[issue41931] Make dict(object) return its attribute __dict__

2020-10-04 Thread மனோஜ்குமார் பழனிச்சாமி

Change by மனோஜ்குமார் பழனிச்சாமி :


--
nosy: SmartManoj
priority: normal
severity: normal
status: open
title: Make dict(object) return its attribute __dict__
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



[issue41898] Any logging causes assertLogs to pass

2020-10-04 Thread miss-islington


Change by miss-islington :


--
pull_requests: +21543
pull_request: https://github.com/python/cpython/pull/22540

___
Python tracker 

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



[issue41898] Any logging causes assertLogs to pass

2020-10-04 Thread Vinay Sajip


Vinay Sajip  added the comment:


New changeset b2611fac05ed391d68f09781903aae7394fab832 by Miss Skeleton (bot) 
in branch '3.8':
bpo-41898: add caveat on root logger seeing all messages in assertLogs doc 
(GH-22526) (GH-22537)
https://github.com/python/cpython/commit/b2611fac05ed391d68f09781903aae7394fab832


--

___
Python tracker 

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



[issue29394] Cannot tunnel TLS connection through TLS connection

2020-10-04 Thread Carl Bordum Hansen


Change by Carl Bordum Hansen :


--
keywords: +patch
nosy: +carlbordum
nosy_count: 4.0 -> 5.0
pull_requests: +21542
stage: needs patch -> patch review
pull_request: https://github.com/python/cpython/pull/22539

___
Python tracker 

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



[issue41898] Any logging causes assertLogs to pass

2020-10-04 Thread Vinay Sajip


Vinay Sajip  added the comment:


New changeset 1ed54435268b285964141fb74d47ceaa33ea79ab by Irit Katriel in 
branch 'master':
bpo-41898: add caveat on root logger seeing all messages in assertLogs doc 
(GH-22526)
https://github.com/python/cpython/commit/1ed54435268b285964141fb74d47ceaa33ea79ab


--
nosy: +vinay.sajip

___
Python tracker 

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



[issue41898] Any logging causes assertLogs to pass

2020-10-04 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 3.0 -> 4.0
pull_requests: +21540
pull_request: https://github.com/python/cpython/pull/22537

___
Python tracker 

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



[issue41898] Any logging causes assertLogs to pass

2020-10-04 Thread miss-islington


Change by miss-islington :


--
pull_requests: +21541
pull_request: https://github.com/python/cpython/pull/22538

___
Python tracker 

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



Re: ValueError: arrays must all be same length

2020-10-04 Thread Tim Williams
On Sun, Oct 4, 2020 at 8:39 AM Tim Williams  wrote:

>
>
> On Fri, Oct 2, 2020 at 11:00 AM Shaozhong SHI 
> wrote:
>
>> Hello,
>>
>> I got a json response from an API and tried to use pandas to put data into
>> a dataframe.
>>
>> However, I kept getting this ValueError: arrays must all be same length.
>>
>> Can anyone help?
>>
>> The following is the json text.  Regards, Shao
>>
>> (snip json_text)
>
>
>> import pandas as pd
>>
>> import json
>>
>> j = json.JSONDecoder().decode(req.text)  ###req.json
>>
>> df = pd.DataFrame.from_dict(j)
>>
>
> I copied json_text into a Jupyter notebook and got the same error trying
> to convert this into a pandas DataFrame:When I tried to copy this into a
> string, I got an error,, but without enclosing the paste in quotes, I got
> the dictionary.
>
>
(delete long response output)


> for k in json_text.keys():
> if isinstance(json_text[k], list):
> print(k, len(json_text[k]))
>
> relationships 0
> locationTypes 0
> regulatedActivities 2
> gacServiceTypes 1
> inspectionCategories 1
> specialisms 4
> inspectionAreas 0
> historicRatings 4
> reports 5
>
> HTH,.
>
>
This may also be more of a pandas issue.

json.loads(json.dumps(json_text))

has a successful round-trip


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


[issue30578] Misleading example in sys.set_coroutine_wrapper docs

2020-10-04 Thread Carl Bordum Hansen


Carl Bordum Hansen  added the comment:

I think this can be closed as `sys.set_coroutine_wrapper` was removed in 
https://bugs.python.org/issue36933

--
nosy: +carlbordum

___
Python tracker 

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



Re: ValueError: arrays must all be same length

2020-10-04 Thread Tim Williams
On Fri, Oct 2, 2020 at 11:00 AM Shaozhong SHI 
wrote:

> Hello,
>
> I got a json response from an API and tried to use pandas to put data into
> a dataframe.
>
> However, I kept getting this ValueError: arrays must all be same length.
>
> Can anyone help?
>
> The following is the json text.  Regards, Shao
>
> (snip json_text)


> import pandas as pd
>
> import json
>
> j = json.JSONDecoder().decode(req.text)  ###req.json
>
> df = pd.DataFrame.from_dict(j)
>

I copied json_text into a Jupyter notebook and got the same error trying to
convert this into a pandas DataFrame:When I tried to copy this into a
string, I got an error,, but without enclosing the paste in quotes, I got
the dictionary.

dir(json_text)
['__class__',
 '__contains__',
 '__delattr__',
 '__delitem__',
 '__dir__',
 '__doc__',
 '__eq__',
 '__format__',
 '__ge__',
 '__getattribute__',
 '__getitem__',
 '__gt__',
 '__hash__',
 '__init__',
 '__init_subclass__',
 '__iter__',
 '__le__',
 '__len__',
 '__lt__',
 '__ne__',
 '__new__',
 '__reduce__',
 '__reduce_ex__',
 '__repr__',
 '__reversed__',
 '__setattr__',
 '__setitem__',
 '__sizeof__',
 '__str__',
 '__subclasshook__',
 'clear',
 'copy',
 'fromkeys',
 'get',
 'items',
 'keys',
 'pop',
 'popitem',
 'setdefault',
 'update',
 'values']

pd.DataFrame(json_text)

---

ValueErrorTraceback (most recent call last)
 in 
> 1 pd.DataFrame(json_text)

D:\anaconda3\lib\site-packages\pandas\core\frame.py in __init__(self, data,
index, columns, dtype, copy)
433 )
434 elif isinstance(data, dict):
--> 435 mgr = init_dict(data, index, columns, dtype=dtype)
436 elif isinstance(data, ma.MaskedArray):
437 import numpy.ma.mrecords as mrecords

D:\anaconda3\lib\site-packages\pandas\core\internals\construction.py in
init_dict(data, index, columns, dtype)
252 arr if not is_datetime64tz_dtype(arr) else arr.copy()
for arr in arrays
253 ]
--> 254 return arrays_to_mgr(arrays, data_names, index, columns,
dtype=dtype)
255
256

D:\anaconda3\lib\site-packages\pandas\core\internals\construction.py in
arrays_to_mgr(arrays, arr_names, index, columns, dtype)
 62 # figure out the index, if necessary
 63 if index is None:
---> 64 index = extract_index(arrays)
 65 else:
 66 index = ensure_index(index)

D:\anaconda3\lib\site-packages\pandas\core\internals\construction.py in
extract_index(data)
363 lengths = list(set(raw_lengths))
364 if len(lengths) > 1:
--> 365 raise ValueError("arrays must all be same length")
366
367 if have_dicts:

ValueError: arrays must all be same length


I got a different error trying json.loads(str(json_text)),
---
JSONDecodeError   Traceback (most recent call last)
 in 
> 1 json.loads(str(json_text))

D:\anaconda3\lib\json\__init__.py in loads(s, cls, object_hook,
parse_float, parse_int, parse_constant, object_pairs_hook, **kw)
355 parse_int is None and parse_float is None and
356 parse_constant is None and object_pairs_hook is None
and not kw):
--> 357 return _default_decoder.decode(s)
358 if cls is None:
359 cls = JSONDecoder

D:\anaconda3\lib\json\decoder.py in decode(self, s, _w)
335
336 """
--> 337 obj, end = self.raw_decode(s, idx=_w(s, 0).end())
338 end = _w(s, end).end()
339 if end != len(s):

D:\anaconda3\lib\json\decoder.py in raw_decode(self, s, idx)
351 """
352 try:
--> 353 obj, end = self.scan_once(s, idx)
354 except StopIteration as err:
355 raise JSONDecodeError("Expecting value", s, err.value)
from None

JSONDecodeError: Expecting property name enclosed in double quotes: line 1
column 2 (char 1)

I think the solution is to fix the arrays so that the lengths match.

for k in json_text.keys():
if isinstance(json_text[k], list):
print(k, len(json_text[k]))

relationships 0
locationTypes 0
regulatedActivities 2
gacServiceTypes 1
inspectionCategories 1
specialisms 4
inspectionAreas 0
historicRatings 4
reports 5

HTH,.

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


[issue41927] Why is there no documentation in Russian?

2020-10-04 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Closed as an obvious trolling.

--
nosy: +serhiy.storchaka
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



[issue41930] Wrap sqlite3_serialize API in sqlite3 module

2020-10-04 Thread Kerrick Staley


New submission from Kerrick Staley :

It would be useful to provide a wrapper (in the Python sqlite3 stdlib module) 
for the sqlite3_serialize API. This API allows you to get a database's content 
as a byte string, as if you had called open('foo.sqlite3', 'rb').read(). 
sqlite3_serialize can even be used for :memory: databases, which I think is the 
most interesting use-case.

Concretely, I'd propose adding a .serialize() method on sqlite3.Connection 
objects that returns a bytes object representing the serialized database. It 
would be similar to the .iterdump() method except that it would use the binary 
format instead of the text format, and it would return all the data at once 
instead of an iterator (because that's how the underlying sqlite API works).

--
components: Library (Lib)
messages: 377935
nosy: Kerrick Staley
priority: normal
severity: normal
status: open
title: Wrap sqlite3_serialize API in sqlite3 module
type: enhancement

___
Python tracker 

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



[issue41927] Why is there no documentation in Russian?

2020-10-04 Thread Andrew Svetlov


Andrew Svetlov  added the comment:

Python is a volunteer-driven project.
The documentation translation is provided by champions who does this hard work 
for free. 
You can join the team and maintain the Python Russian Translation :)

Sorry, to keep the discussion productive I should remind our community rules:
* Please keep calm and provide a polite attitude in conversations on this bug 
tracker.
* Otherwise, you must understand that the rude mood can be considered as the 
reason for the ban.

--
nosy: +asvetlov

___
Python tracker 

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



[issue41927] Why is there no documentation in Russian?

2020-10-04 Thread Steven D'Aprano


Steven D'Aprano  added the comment:

Oh no, you have discovered our dirty secret! Python is racist against Russia! 
/sarcasm

Python is created by volunteers, including the documentation. If you want a 
Russian translation, feel free to start working on one.

You could start here: https://wiki.python.org/moin/Languages

--
nosy: +steven.daprano

___
Python tracker 

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



[issue41929] Detect OEM code page for zip archives in ZipFile based on system locale

2020-10-04 Thread Ivan Sorokin

New submission from Ivan Sorokin :

ZipFile has problems with filename charset in .zip archives having filenames 
charset encoded in OEM code page.

ZipFile assumes that OEM code page always means "cp437". Actually many popular 
.zip packers (for example, Windows internal "zip folders" tool) use OEM code 
page corresponding to system locale to write file names in .zip files.

To read such files correctly we should detect correct OEM code page from system 
locale instead of sticking to cp437.

Here is locale-to-oem-code-page conversion table, generated from Wine source 
code:
https://github.com/unxed/oemcp/blob/master/oemcp.txt

Sample archive is attached. The file inside should be extracted as "Новый 
текстовый документ.txt" when ru_RU system locale is set.

--
components: Library (Lib)
files: windows_cyrillic.zip
messages: 377932
nosy: ivan.sorokin.tech
priority: normal
severity: normal
status: open
title: Detect OEM code page for zip archives in ZipFile based on system locale
versions: Python 3.10
Added file: https://bugs.python.org/file49492/windows_cyrillic.zip

___
Python tracker 

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



[issue41928] ZipFile does not supports Unicode Path Extra Field (0x7075) zip header field

2020-10-04 Thread Ivan Sorokin

New submission from Ivan Sorokin :

See attached sample. Well-known unzip command line tool lists its contents 
correctly:

$ unzip -l 23.zip
Archive:  23.zip
  Length  DateTimeName
-  -- -   
81408  2012-10-23 19:03   Β' ΦΑΣΗ ΠΕ06 ΣΧΟΛΕΙΑ ΕΑΕΠ (ΙΝΤ).xls
- ---
81408 1 file

But ZipFile lists the same file inside this archive as
ü' öÇæå Åä06 æòÄèäêÇ äÇäÅ (êîÆ).xls

It's because ZipFile completely ignores Unicode Path Extra Field (0x7075) zip 
header field.

See .ZIP specification for details on this field meaning and usage:
https://pkware.cachefly.net/webdocs/casestudies/APPNOTE.TXT

--
components: Library (Lib)
files: 23.zip
messages: 377931
nosy: ivan.sorokin.tech
priority: normal
severity: normal
status: open
title: ZipFile does not supports Unicode Path Extra Field (0x7075) zip header 
field
type: enhancement
versions: Python 3.10
Added file: https://bugs.python.org/file49491/23.zip

___
Python tracker 

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



[issue41927] Why is there no documentation in Russian?

2020-10-04 Thread Борис Лакеев

New submission from Борис Лакеев :

Is this a racist policy of the site management? For so much time, not even for 
2.7. I'm sure there were a lot of suggestions to add. Aren't you ashamed?

--
assignee: docs@python
components: Documentation
messages: 377930
nosy: docs@python, lakeevboris
priority: normal
severity: normal
status: open
title: Why is there no documentation in Russian?
type: resource usage
versions: Python 3.8

___
Python tracker 

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



[issue41926] Unpredictable behavior when parsing xml. (xml.etree.ElementTree.iterparse)

2020-10-04 Thread Джон Смит

Джон Смит  added the comment:

The file example5.xml could not be loaded, so to generate it, run the 
generator.py.

--

___
Python tracker 

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



[issue41926] Unpredictable behavior when parsing xml. (xml.etree.ElementTree.iterparse)

2020-10-04 Thread Джон Смит

Change by Джон Смит :


Added file: https://bugs.python.org/file49490/app.rar

___
Python tracker 

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



[issue41926] Unpredictable behavior when parsing xml. (xml.etree.ElementTree.iterparse)

2020-10-04 Thread Джон Смит

New submission from Джон Смит :

Data is lost when parsing large files.
I have prepared 5 test files for different cases.
With their help, I learned that losses are not accidental.
In example.xml, when going to iteration 717 (i = 717), the data is lost.

In the rest of the files, I learned that data loss occurs when the number of 
characters changes. It looks like some kind of buffer overflow.
In example5.xml I am using randomly generated data using a generator.py.

Several xml files have been prepared to show that this is not an error in the 
input data, but a problem in the library itself.

I tried to trace the cause of the occurrence, and came to the conclusion that 
the bug lies in the compiled file.

In the ElementTree.py library file, the line
"events = self._events_queue" 
returns an empty list. This can be seen at iteration 717 in example.xml.

--
components: XML
messages: 377928
nosy: kibertitan
priority: normal
severity: normal
status: open
title: Unpredictable behavior when parsing xml. 
(xml.etree.ElementTree.iterparse)
type: behavior
versions: Python 3.8

___
Python tracker 

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



Re: python show folder files and not subfolder files

2020-10-04 Thread pascal z via Python-list
On Thursday, September 24, 2020 at 4:37:07 PM UTC+2, Terry Reedy wrote:
> On 9/23/2020 7:24 PM, pascal z via Python-list wrote:
> > Please advise if the following is ok (i don't think it is)
> > 
> > #!/usr/bin/env python3
> > # -*- coding: utf-8 -*-
> > 
> > import os
> > 
> > csv_contents = ""
> > output_file = '/home/user/Documents/csv/output3csv.csv'
> > Lpath = '/home/user/Documents/'
> > 
> > csv_contents = "FOLDER PATH;Size in Byte;Size in Kb;Size in Mb;Size in Gb\n"
> > 
> > d_size = 0
> > for root, dirs, files in os.walk(Lpath, topdown=False):
> >  for i in files:
> >  d_size += os.path.getsize(root + os.sep + i)
> >  csv_contents += "%s   ;%.2f   ;%.2f   ;%.2f   ;%.2f  \n" % (root, 
> > d_size, d_size/1024, d_size/1048576, d_size/1073741824)
> > 
> >  counter = Lpath.count(os.path.sep)
> >  if counter < 5:
> >  for f in os.listdir(Lpath):
> >  path = os.path.join(Lpath, f)
> >  f_size = 0
> >  f_size = os.path.getsize(path)
> >  csv_contents += "%s   ;%.2f   ;%.2f   ;%.2f   ;%.2f  \n" % 
> > (path, f_size, f_size/1024, f_size/1048576, f_size/1073741824)
> > 
> > fp = open(output_file, "w")
> > fp.write(csv_contents)
> > fp.close()
> 
> 
> Read
> https://docs.python.org/3/faq/programming.html#what-is-the-most-efficient-way-to-concatenate-many-strings-together
> -- 
> Terry Jan Reedy

Thanks for this tip. I do think it's better to use lists than concatenate into 
string variable. However, writing a list to a csv file is not something easy. 
If strings stored into the list have commas and single quotes (like song 
title's), it messes up the whole csv when it first meets this. Example with arr 
as list:


import csv
import io

(...)

csv_contents = "%s;%s;%s;%.2f;%.2f;%.2f;%.2f;%s" % (vfolder_path, vfile_name, 
vfolder_path_full, 0.00, 0.00, 0.00,0.00, "folder")
arr.append([csv_contents])

b = io.BytesIO()
with open(CSV_FILE,'w', newline ='\n') as f:
#write = csv.writer(f,delimiter=';')
#write = csv.writer(f,quotechar='\'', 
quoting=csv.QUOTE_NONNUMERIC,delimiter=',')
write = csv.writer(f,b)
for row in arr:
write.writerows(row)

(...)

string samples: ;'Forgotten Dreams' Mix.mp3;'Awakening of a Dream' Ambient 
Mix.mp3;Best of Trip-Hop & Downtempo & Hip-Hop Instrumental.mp3;2-Hour _ Space 
Trance.mp3

for the titles above, the easiest thing to write csv for me is 


(...)
csv_contents += "%s;%s;%s;%.2f;%.2f;%.2f;%.2f;%s" % (vfolder_path, vfile_name, 
vfolder_path_full, 0.00, 0.00, 0.00,0.00, "folder"

with open(CSV_FILE,'w') as f:
f.write(csv_contents)


csv_contents can be very large and it seems to work. It can concatenate 30k 
items and it's ok. Also with the above, I have the expected result into each of 
the 8 rows having the corresponding data. This is not always the case with csv 
writerows. If it meets a character it can't process, from there everything go 
into a single cell row. The split on semi colon from doesnt work anymore.

I am not allowed to change the name of the files (it could be used later 
somewhere else, making side effects...).
-- 
https://mail.python.org/mailman/listinfo/python-list


  1   2   >