New GitHub issue #119442 from DWThayerMahan:<br>
<hr>
<pre>
# Bug report
### Bug description:
I discovered that when extracting the file "testfile (2).zip" or "testfile2.zip", instead of creating a new directory of the same name, the folder "testfile" and its contents would be overwritten.
```python
if os.path.exists(location+nameParts[0]):
return True, name, contents, tab, ProjectName, WOpen, WTitle, WBody, tz, DTkids
if re.search("([0-9]+)", nameParts[0]) != None:
psplit = nameParts[0].rsplit('(', 1)
if os.path.exists(location + psplit[0]):
return True, name, contents, tab, ProjectName, WOpen, WTitle, WBody, tz, DTkids
with ZipFile(location+name, 'r') as z:
try:
z.extractall(location)
except zipfile.error as e:
print(e.name)
else:
print(os.path.exists(location+nameParts[0]))```
### CPython versions tested on:
3.9
### Operating systems tested on:
Windows
</pre>
<hr>
<a href="https://github.com/python/cpython/issues/119442">View on GitHub</a>
<p>Labels: type-bug</p>
<p>Assignee: </p>