Gregory P. Smith added the comment:
backwards compatibility with what? i'd like to just remove tempfile.template
in 3.5 as part of addressing issue24230.
--
nosy: +gregory.p.smith
___
Python tracker rep...@bugs.python.org
R. David Murray added the comment:
Backward compatibility in that someone might be using the constant in their
code. You could just leave the existing value there with a comment that it is
unused and use a leading _ for the new constants. (Or you could delete
it...it's not likely anyone is
Roundup Robot devnull@devnull added the comment:
New changeset eafe8c7f7049 by R David Murray in branch 'default':
#10354: remove last public mentions of 'template' and comment as private.
http://hg.python.org/cpython/rev/eafe8c7f7049
--
nosy: +python-dev
R. David Murray rdmur...@bitdance.com added the comment:
I have removed the last mentions of template from the docs and docstrings, and
added a comment that it is a private variable despite its name. I do not see a
reason to break backward compatibility just to have a leading underscore in
New submission from Giampaolo Rodola' g.rod...@gmail.com:
import tempfile
tempfile.template = 'XXX'
tempfile.mkdtemp()
'/tmp/tmpPf5lML'
Functions that use template use it as an argument default, so changing it
afterwards has no effect.
--
components: Library (Lib)
messages: 120729
Giampaolo Rodola' g.rod...@gmail.com added the comment:
Patch in attachment.
--
keywords: +patch
Added file: http://bugs.python.org/file19541/tempfile.patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10354
Eric Smith e...@trueblade.com added the comment:
The patch looks good to me, but it needs a test.
--
nosy: +eric.smith
stage: - unit test needed
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10354
Giampaolo Rodola' g.rod...@gmail.com added the comment:
Patch including tests is in attachment.
I think I've just found two further bugs though:
tempfile.TemporaryFile().name
'fdopen'
tempfile.TemporaryFile(prefix='xxx').name
'fdopen'
tempfile.SpooledTemporaryFile().name
Traceback (most
Giampaolo Rodola' g.rod...@gmail.com added the comment:
Adding georg.brandl to nosy list as per misc/maintainers.rst.
--
nosy: +georg.brandl
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10354
Giampaolo Rodola' g.rod...@gmail.com added the comment:
Created issue 10355 for SpooledTemporaryFile bug while TemporaryFile having no
name seems to be rightful.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10354
R. David Murray rdmur...@bitdance.com added the comment:
Shouldn't the global template variable just be deleted in python3? It is no
longer documented except for what is probably an overlooked mention in the
introduction.
--
nosy: +r.david.murray
Changes by Éric Araujo mer...@netwok.org:
--
nosy: +eric.araujo
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10354
___
___
Python-bugs-list
Eric Smith e...@trueblade.com added the comment:
I sort of agree with David.
The global template is a bad name and a bad design. And since it doesn't work
I don't think anything would be lost by modifying the code to ignore it;
document that it's unused and deprecated; and remove it in a
R. David Murray rdmur...@bitdance.com added the comment:
It has been documented as deprecated since 2.0. I'm sure the intent was for all
mention of it to have been deleted from the 3.x docs already, but that first
paragraph was overlooked.
--
___
Raymond Hettinger rhettin...@users.sourceforge.net added the comment:
+1 for just deleting it. nothing is lost by deleting code that never worked
in the first place ;-)
--
nosy: +rhettinger
___
Python tracker rep...@bugs.python.org
15 matches
Mail list logo