[issue35889] sqlite3.Row doesn't have useful repr

2019-08-29 Thread Vlad Shcherbina


Vlad Shcherbina  added the comment:

1. "This patch adds too many lines of code and not enough value."
If the maintainers judge it so, I have nothing to say. You have the 
responsibility to keep the codebase relatively simple.

2a. "Existing programs made with the assumption that repr(row) is short (albeit 
useless) will break when it becomes not so short."
I have no experience maintaining popular language implementations, so I defer 
to your judgement on what level of backward compatibility is warranted.

2b. "New users of new repr(row) will run into problems because its size is 
unbounded."
I think this objection is invalid, as I explained in the comment: 
https://bugs.python.org/issue35889#msg336291

--

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



[issue37204] Scripts and binaries in PYTHON_PREFIX/Scripts contain unnecessarily lowercased path to Python location on Windows

2019-06-08 Thread Vlad Shcherbina


Vlad Shcherbina  added the comment:

https://github.com/pypa/pip/issues/6582

--

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



[issue37204] Scripts and binaries in PYTHON_PREFIX/Scripts contain unnecessarily lowercased path to Python location on Windows

2019-06-08 Thread Vlad Shcherbina


New submission from Vlad Shcherbina :

To reproduce:

1. Download and run Python installer (I used python-3.7.3-amd64-webinstall.exe).
2. Modify install settings:
   - Install for all users: yes
   - Customize install location: "C:\Python37"
   (don't know if it's relevant, mentioning it just in case)
3. Install.
4. Run the following commands:
pip --version
py -m pip --version

Expected result:

> pip --version
pip 19.0.3 from C:\Python37\lib\site-packages\pip (python 3.7)
> py -m pip --version
pip 19.0.3 from C:\Python37\lib\site-packages\pip (python 3.7)

Actual result:

> pip --version
pip 19.0.3 from c:\python37\lib\site-packages\pip (python 3.7)
> py -m pip --version
pip 19.0.3 from C:\Python37\lib\site-packages\pip (python 3.7)


Same happens for all binaries and scripts in PYTHON_PREFIX/Scripts, not only 
for pip.exe.

For example, if I install pytest (using "pip install pytest" or "py -m pip 
install pytest", doesn't matter), I get the following:

> pytest -v
 test session 
starts 
platform win32 -- Python 3.7.3, pytest-4.6.2, py-1.8.0, pluggy-0.12.0 -- 
c:\python37\python.exe
cachedir: .pytest_cache
rootdir: C:\temp\qqq
collected 0 items
=== no tests ran in 0.02 
seconds 

> py -m pytest -v
 test session 
starts 
platform win32 -- Python 3.7.3, pytest-4.6.2, py-1.8.0, pluggy-0.12.0 -- 
C:\Python37\python.exe
cachedir: .pytest_cache
rootdir: C:\temp\qqq
collected 0 items
=== no tests ran in 0.02 
seconds 

--
components: Distutils, Installation, Windows
messages: 345037
nosy: dstufft, eric.araujo, paul.moore, steve.dower, tim.golden, vlad, zach.ware
priority: normal
severity: normal
status: open
title: Scripts and binaries in PYTHON_PREFIX/Scripts contain unnecessarily 
lowercased path to Python location on Windows
type: behavior
versions: Python 2.7, Python 3.5, Python 3.6, Python 3.7, Python 3.8, Python 3.9

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



[issue34776] Postponed annotations break inspection of dataclasses

2019-03-02 Thread Vlad Shcherbina


Vlad Shcherbina  added the comment:

Any chance this could get into 3.7.3?

--
nosy: +vlad

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



[issue35889] sqlite3.Row doesn't have useful repr

2019-02-22 Thread Vlad Shcherbina


Vlad Shcherbina  added the comment:

There is no need to add explicit knowledge of reprlib to the Row object or vice 
versa.

Those who use reprlib to limit output size will have no problem. Reprlib 
already truncates arbitrary reprs at the string level: 
https://github.com/python/cpython/blob/22bfe637ca7728e9f74d4dc8bb7a15ee2a913815/Lib/reprlib.py#L144

Those who use builtin repr() have to be prepared for the possibility of 
unbounded repr anyway, because all collection-like objects in Python have 
unbounded __repr__.

It would be annoying if some collection-like objects decided to be clever and 
omit parts of their regular __repr__ because they feel it's too much for the 
user to handle.

--

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



[issue35889] sqlite3.Row doesn't have useful repr

2019-02-02 Thread Vlad Shcherbina


New submission from Vlad Shcherbina :

To reproduce, run the following program:

import sqlite3
conn = sqlite3.connect(':memory:')
conn.row_factory = sqlite3.Row
print(conn.execute("SELECT 'John' AS name, 42 AS salary").fetchone())

It prints ''.
It would be nice if it printed something like "sqlite3.Row(name='Smith', 
saraly=42)" instead.
It wouldn't satisfy the 'eval(repr(x)) == x' property, but it's still better 
than nothing.

If the maintainers agree this is useful, I'll implement.

--
components: Library (Lib)
messages: 334746
nosy: vlad
priority: normal
severity: normal
status: open
title: sqlite3.Row doesn't have useful repr
type: enhancement
versions: Python 2.7, Python 3.4, Python 3.5, Python 3.6, Python 3.7, Python 3.8

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



[issue33075] typing.NamedTuple does not deduce Optional[] from using None as default field value

2018-03-14 Thread Vlad Shcherbina

Vlad Shcherbina <vlad.shcherb...@gmail.com> added the comment:

If the maintainers agree that it's desirable to automatically deduce 
optionality, I'll implement it.

--

___
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue33075>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com




[issue33075] typing.NamedTuple does not deduce Optional[] from using None as default field value

2018-03-14 Thread Vlad Shcherbina

New submission from Vlad Shcherbina <vlad.shcherb...@gmail.com>:

from typing import *

def f(arg: str = None):
pass
print(get_type_hints(f))

# {'arg': typing.Union[str, NoneType]}
# as expected


class T(NamedTuple):
field: str = None
print(get_type_hints(T))

# {'field': }
# but it should be
# {'field': typing.Union[str, NoneType]}
# for consistency

--
components: Library (Lib)
messages: 313819
nosy: vlad
priority: normal
severity: normal
status: open
title: typing.NamedTuple does not deduce Optional[] from using None as default 
field value
type: behavior
versions: Python 3.6, Python 3.7

___
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue33075>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31239] namedtuple comparison ignores types

2017-08-18 Thread Vlad Shcherbina

Vlad Shcherbina added the comment:

While we are at it, namedtuple inherits other operations that make no sense for 
fixed-length tuples:

>>> Rectangle(width=1, height=2) * 3
(1, 2, 1, 2, 1, 2)
>>> Rectangle(width=1, height=2) + Ellipse(x_axis=3, y_axis=4)
(1, 2, 3, 4)

But those are not so problematic because they are less likely to occur in 
practice.

--

___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue31239>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31239] namedtuple comparison ignores types

2017-08-18 Thread Vlad Shcherbina

New submission from Vlad Shcherbina:

Toy example:

>>> from collections import namedtuple
>>> Rectangle = namedtuple('Rectangle', 'width height')
>>> Ellipse = namedtuple('Ellipse', 'x_axis y_axis')
>>> Rectangle(width=1, height=2) == Ellipse(x_axis=1, y_axis=2)
True

I understand this happens because namedtuple inherits comparisons and hash from 
the regular tuple.
However, this seems like confusing and dangerous behavior.
It is especially annoying to debug when these tuples are used as dict keys 
(repr() shows one thing and dict item access shows another).

Why would anyone mix named tuples of different types?
Here is a use case: typing.NamedTuple together with typing.Union would be a 
neat way to express algebraic data types.

Haskell's
data Shape = Rectangle Int Int | Ellipse Int Intderiving(Eq, Show)

would become
Shape = Union[Rectangle, Ellipse]

except that it does not work as expected because of the flawed comparisons.

--
components: Library (Lib)
messages: 300562
nosy: vlad
priority: normal
severity: normal
status: open
title: namedtuple comparison ignores types
type: behavior
versions: Python 2.7, Python 3.3, Python 3.4, Python 3.5, Python 3.6, Python 3.7

___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue31239>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18945] Name collision handling in tempfile is not covered by tests

2013-09-13 Thread Vlad Shcherbina

Changes by Vlad Shcherbina vlad.shcherb...@gmail.com:


Added file: http://bugs.python.org/file31739/tempfile_collision_tests_27

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



[issue18945] Name collision handling in tempfile is not covered by tests

2013-09-11 Thread Vlad Shcherbina

Changes by Vlad Shcherbina vlad.shcherb...@gmail.com:


Added file: http://bugs.python.org/file31730/tempfile_collision_tests.patch

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



[issue18945] Name collision handling in tempfile is not covered by tests

2013-09-11 Thread Vlad Shcherbina

Changes by Vlad Shcherbina vlad.shcherb...@gmail.com:


Removed file: http://bugs.python.org/file31697/tempfile_collision_tests.patch

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



[issue18945] Name collision handling in tempfile is not covered by tests

2013-09-09 Thread Vlad Shcherbina

Changes by Vlad Shcherbina vlad.shcherb...@gmail.com:


--
keywords: +patch
Added file: http://bugs.python.org/file31697/tempfile_collision_tests.patch

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



[issue18945] Name collision handling in tempfile is not covered by tests

2013-09-07 Thread Vlad Shcherbina

Vlad Shcherbina added the comment:

Probably yes, I'm just not sure when I'll get the time.

--

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



[issue18945] Name collision handling in tempfile is not covered by tests

2013-09-06 Thread Vlad Shcherbina

New submission from Vlad Shcherbina:

I intend to add test for (existing dir)-(new file) collision in 
http://bugs.python.org/issue18849, but file-file, file-dir and dir-dir 
collisions are yet to be covered.

--
components: Tests
messages: 197062
nosy: vlad
priority: normal
severity: normal
status: open
title: Name collision handling in tempfile is not covered by tests
type: enhancement
versions: Python 2.7, Python 3.3, Python 3.4

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



[issue18849] Failure to try another name for tempfile when directory with chosen name exists on windows

2013-09-05 Thread Vlad Shcherbina

Changes by Vlad Shcherbina vlad.shcherb...@gmail.com:


Removed file: 
http://bugs.python.org/file31580/temp_dir_exists_retry_test_27.patch

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



[issue18849] Failure to try another name for tempfile when directory with chosen name exists on windows

2013-09-05 Thread Vlad Shcherbina

Changes by Vlad Shcherbina vlad.shcherb...@gmail.com:


Removed file: http://bugs.python.org/file31573/temp_dir_exists_retry_27.patch

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



[issue18849] Failure to try another name for tempfile when directory with chosen name exists on windows

2013-09-05 Thread Vlad Shcherbina

Changes by Vlad Shcherbina vlad.shcherb...@gmail.com:


Removed file: http://bugs.python.org/file31574/temp_dir_exists_retry_33_34.patch

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



[issue18849] Failure to try another name for tempfile when directory with chosen name exists on windows

2013-09-05 Thread Vlad Shcherbina

Changes by Vlad Shcherbina vlad.shcherb...@gmail.com:


Removed file: 
http://bugs.python.org/file31579/temp_dir_exists_retry_test_33_34.patch

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



[issue18849] Failure to try another name for tempfile when directory with chosen name exists on windows

2013-09-05 Thread Vlad Shcherbina

Changes by Vlad Shcherbina vlad.shcherb...@gmail.com:


Added file: 
http://bugs.python.org/file31601/temp_dir_exists_retry_test_33_34.patch

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



[issue18849] Failure to try another name for tempfile when directory with chosen name exists on windows

2013-09-05 Thread Vlad Shcherbina

Changes by Vlad Shcherbina vlad.shcherb...@gmail.com:


Added file: http://bugs.python.org/file31605/temp_dir_exists_retry_27.patch

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



[issue18849] Failure to try another name for tempfile when directory with chosen name exists on windows

2013-09-05 Thread Vlad Shcherbina

Changes by Vlad Shcherbina vlad.shcherb...@gmail.com:


Added file: http://bugs.python.org/file31604/temp_dir_exists_retry_test_27.patch

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



[issue18849] Failure to try another name for tempfile when directory with chosen name exists on windows

2013-09-05 Thread Vlad Shcherbina

Changes by Vlad Shcherbina vlad.shcherb...@gmail.com:


Added file: http://bugs.python.org/file31602/temp_dir_exists_retry_33_34.patch

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



[issue18849] Failure to try another name for tempfile when directory with chosen name exists on windows

2013-09-05 Thread Vlad Shcherbina

Changes by Vlad Shcherbina vlad.shcherb...@gmail.com:


Removed file: 
http://bugs.python.org/file31604/temp_dir_exists_retry_test_27.patch

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



[issue18849] Failure to try another name for tempfile when directory with chosen name exists on windows

2013-09-05 Thread Vlad Shcherbina

Changes by Vlad Shcherbina vlad.shcherb...@gmail.com:


Removed file: http://bugs.python.org/file31605/temp_dir_exists_retry_27.patch

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



[issue18849] Failure to try another name for tempfile when directory with chosen name exists on windows

2013-09-05 Thread Vlad Shcherbina

Changes by Vlad Shcherbina vlad.shcherb...@gmail.com:


Removed file: 
http://bugs.python.org/file31601/temp_dir_exists_retry_test_33_34.patch

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



[issue18849] Failure to try another name for tempfile when directory with chosen name exists on windows

2013-09-05 Thread Vlad Shcherbina

Changes by Vlad Shcherbina vlad.shcherb...@gmail.com:


Removed file: http://bugs.python.org/file31602/temp_dir_exists_retry_33_34.patch

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



[issue18849] Failure to try another name for tempfile when directory with chosen name exists on windows

2013-09-05 Thread Vlad Shcherbina

Changes by Vlad Shcherbina vlad.shcherb...@gmail.com:


Added file: http://bugs.python.org/file31607/temp_dir_exists_retry_33_34.patch

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



[issue18849] Failure to try another name for tempfile when directory with chosen name exists on windows

2013-09-05 Thread Vlad Shcherbina

Changes by Vlad Shcherbina vlad.shcherb...@gmail.com:


Added file: 
http://bugs.python.org/file31606/temp_dir_exists_retry_test_33_34.patch

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



[issue18849] Failure to try another name for tempfile when directory with chosen name exists on windows

2013-09-05 Thread Vlad Shcherbina

Changes by Vlad Shcherbina vlad.shcherb...@gmail.com:


Added file: http://bugs.python.org/file31608/temp_dir_exists_retry_test_27.patch

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



[issue18849] Failure to try another name for tempfile when directory with chosen name exists on windows

2013-09-05 Thread Vlad Shcherbina

Changes by Vlad Shcherbina vlad.shcherb...@gmail.com:


Added file: http://bugs.python.org/file31609/temp_dir_exists_retry_27.patch

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



[issue18849] Failure to try another name for tempfile when directory with chosen name exists on windows

2013-09-04 Thread Vlad Shcherbina

Changes by Vlad Shcherbina vlad.shcherb...@gmail.com:


Added file: 
http://bugs.python.org/file31579/temp_dir_exists_retry_test_33_34.patch

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



[issue18849] Failure to try another name for tempfile when directory with chosen name exists on windows

2013-09-04 Thread Vlad Shcherbina

Changes by Vlad Shcherbina vlad.shcherb...@gmail.com:


Added file: http://bugs.python.org/file31580/temp_dir_exists_retry_test_27.patch

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



[issue18849] Failure to try another name for tempfile when directory with chosen name exists on windows

2013-09-04 Thread Vlad Shcherbina

Vlad Shcherbina added the comment:

1. I agree that consistency between 2.7 and 3.* have some value, but maybe it's 
better to take less permissive approach in 3.* instead and only retry when 
exception is PermissionError _and_ errno is EACCES?

2. Currently it's being reraised unless platform.name == 'nt'. Also, I added a 
test, so if there are problems on other platforms, they will surface (I myself 
only tried it on linux and windows 7 though).

--

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



[issue18849] Failure to try another name for tempfile when directory with chosen name exists on windows

2013-09-03 Thread Vlad Shcherbina

Changes by Vlad Shcherbina vlad.shcherb...@gmail.com:


Removed file: http://bugs.python.org/file31518/fix_for_27.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18849
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18849] Failure to try another name for tempfile when directory with chosen name exists on windows

2013-09-03 Thread Vlad Shcherbina

Changes by Vlad Shcherbina vlad.shcherb...@gmail.com:


Added file: http://bugs.python.org/file31573/temp_dir_exists_retry_27.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18849
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18849] Failure to try another name for tempfile when directory with chosen name exists on windows

2013-09-03 Thread Vlad Shcherbina

Changes by Vlad Shcherbina vlad.shcherb...@gmail.com:


Added file: http://bugs.python.org/file31574/temp_dir_exists_retry_33_34.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18849
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18849] Failure to try another name for tempfile when directory with chosen name exists on windows

2013-08-30 Thread Vlad Shcherbina

Changes by Vlad Shcherbina vlad.shcherb...@gmail.com:


--
keywords: +patch
Added file: http://bugs.python.org/file31518/fix_for_27.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18849
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18849] Failure to try another name for tempfile when directory with chosen name exists on windows

2013-08-27 Thread Vlad Shcherbina

New submission from Vlad Shcherbina:

When directory exists with a name chosen for new temporary file, OSError with 
EACCESS errno is thrown on windows, while attempts to chose another name only 
happen on EEXIST errors.


To reproduce, run
--- 8 -
import sys
import tempfile
import os

print sys.platform
print sys.version

# Mock random names to ensure collision.
tempfile._RandomNameSequence = lambda: iter(['a', 'a', 'b'])

d = tempfile.mkdtemp()
print d

try:
print tempfile.NamedTemporaryFile().name
finally:
os.rmdir(d)
--- 8 -


Expected result:
win32
2.7.3 (default, Apr 10 2012, 23:24:47) [MSC v.1500 64 bit (AMD64)]
...\tmpa
...\tmpb


Actual result:
win32
2.7.3 (default, Apr 10 2012, 23:24:47) [MSC v.1500 64 bit (AMD64)]
c:\users\shcher~1\appdata\local\temp\tmpa
Traceback (most recent call last):
  File hz.py, line 13, in module
print tempfile.NamedTemporaryFile().name
  File C:\python_27_amd64\files\lib\tempfile.py, line 454, in 
NamedTemporaryFile
(fd, name) = _mkstemp_inner(dir, prefix, suffix, flags)
  File C:\python_27_amd64\files\lib\tempfile.py, line 235, in _mkstemp_inner
fd = _os.open(file, flags, 0600)
OSError: [Errno 13] Permission denied: 
'c:\\users\\shcher~1\\appdata\\local\\temp\\tmpa'

--
components: Library (Lib), Windows
messages: 196269
nosy: Vlad.Shcherbina
priority: normal
severity: normal
status: open
title: Failure to try another name for tempfile when directory with chosen name 
exists on windows
type: behavior

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18849
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com