[issue9333] Expose a way to enable os.symlink on Windows

2010-12-02 Thread Brian Curtin

Brian Curtin cur...@acm.org added the comment:

 So the presence of os.symlink depends on some dynamic privilege?

Yes.


 Why not simply raise an exception when the user has not enough
 privileges? (I mean OSError or WindowsError of course, not AttributeError)

My thinking was that anyone writing cross-platform code which uses symlink in 
any way is already doing hasattr(os, symlink), and if they get a symlink 
attribute, it should work. With an exception they would have to add an 
additional try/except for the common case that os.symlink would fail due to 
lack of privilege on Windows.

I suspect that most people are not running with the required privilege, as 
evidenced by a look around the web at how others have written and tested this 
area of code in their applications. Even if someone has an account with 
administrator-level access, the command prompt starts up with regular 
privileges, so even those users (e.g., myself) would experience os.symlink 
raising an exception. Until the application is started explicitly with 
administrator privileges by an account blessed with access to the symlink 
privilege does the os.symlink even provide value.

This was noticed in virtualenv3 right off the bat when the first os.symlink 
checkin happened (see msg112322). They do the hasattr check and go ahead 
expecting it to work, and it would not work in their case no matter what checks 
they would do. I've seen other applications setup to do the same thing.


In the end, I'd rather not make people do this:

if hasattr(os, symlink):
if not os.path.exists(dest):
try:
os.symlink(src, dest)
except OSError:
print(no privilege)

but instead allow them to do what they are likely already be doing:

if hasattr(os, symlink):
if not os.path.exists(dest):
os.symlink(src, dest)


For new uses of os.symlink on Windows versions which support it, it may appear 
a bit unorthodox. I accept that, and I wish it could just work, but we're 
given a complex set of hoops to jump through in order to make this usable in 
any case. I made my decision based on the small percentage of times where this 
functionality is even available, coupled with existing usage of the function.

--
stage: committed/rejected - commit review
status: closed - open

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



[issue10197] subprocess.getoutput fails on win32

2010-12-02 Thread Éric Araujo

Éric Araujo mer...@netwok.org added the comment:

My idea is simply using Popen with appropriate args for stdout and stderr 
instead of using a shell command with redirections:

--- Lib/subprocess.py   (révision 86943)
+++ Lib/subprocess.py   (copie de travail)
@@ -560,11 +560,7 @@
 return ''.join(result)


-# Various tools for executing commands and looking at their output and status.
-#
-# NB This only works (and is only relevant) for UNIX.
-
-def getstatusoutput(cmd):
+def getstatusoutput(cmd, shell=True):
 Return (status, output) of executing cmd in a shell.

 Execute the string 'cmd' in a shell with os.popen() and return a 2-tuple
@@ -581,14 +577,21 @@
  subprocess.getstatusoutput('/bin/junk')
 (256, 'sh: /bin/junk: not found')
 
-pipe = os.popen('{ ' + cmd + '; } 21', 'r')
-text = pipe.read()
-sts = pipe.close()
-if sts is None: sts = 0
-if text[-1:] == '\n': text = text[:-1]
+# Wish I could use with...
+popen = Popen(cmd, shell=shell, stdout=PIPE, stderr=STDOUT)
+sts = popen.communicate() #or wait() or whatever is the right thing
+try:
+text = process.stdout.read()
+finally:
+process.stdout.close()
+if sts is None:
+sts = 0
+if text.endswith('\n'):
+text = text[:-1]
 return sts, text

(The new “shell” argument is icing on the cake, allowing us to later support a 
list as cmd argument like Popen does.)

--

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



[issue7911] unittest.TestCase.longMessage should default to True in Python 3.2

2010-12-02 Thread Michael Foord

Michael Foord mich...@voidspace.org.uk added the comment:

Committed revision 86944.

--
resolution:  - fixed
stage: needs patch - committed/rejected
status: open - closed

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



[issue10534] difflib.SequenceMatcher: expose junk sets, deprecate undocumented isb... functions.

2010-12-02 Thread Terry J. Reedy

Terry J. Reedy tjre...@udel.edu added the comment:

Here is a pretty minimal patch to expose bjunk and bpopular as attributes and 
document them along with b2j, which is already exposed but not documented.

I suppose the proposed paragraph could be formatted as a list, perhaps after 
   :class:`SequenceMatcher` objects have the following methods:
with 'methods' expanded to 'attributes and methods'. But I do not know how to 
do that and personally prefer what I wrote.

However, Georg, I am adding you as nosy so you can comment on the doc addition 
*before* I commit this tomorrow, to get it in the beta.

Still to do: improve the doctests, including those added as part of #2986, to 
use the exposed sets (they are already implicitly tested by the existing 
tests); deprecate the two obsolete function attributes, as discussed on pydev.

The docstrings and code comments might stand revision, and there is an XXX todo 
in the doc yet.

--
keywords: +patch
nosy: +georg.brandl
stage: unit test needed - commit review
Added file: http://bugs.python.org/file19915/difflib.10534.diff

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



[issue10611] sys.exit() in a test causes the run to stp

2010-12-02 Thread Michael Foord

New submission from Michael Foord mich...@voidspace.org.uk:

Reported by a unittest2 user. 

A SystemExit (or GeneratorExit) will cause a test run to stop in 2.7 / 3.2. 
This would just be reported as an error in 2.6.

 from unittest import TestCase
 def test(s):
...  raise GeneratorExit
... 
 class T(TestCase):
...  test = test
... 
 t = T('test')
 t.run()


Above code works in Python 2.6 (the exception is caught by TestCase.run) but 
dies in 2.7 / 3.2

--
assignee: michael.foord
keywords: easy
messages: 123153
nosy: michael.foord
priority: normal
severity: normal
stage: unit test needed
status: open
title: sys.exit() in a test causes the run to stp
type: behavior
versions: Python 2.7, Python 3.2

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



[issue10611] sys.exit() in a test causes a test run to die

2010-12-02 Thread Michael Foord

Changes by Michael Foord mich...@voidspace.org.uk:


--
title: sys.exit() in a test causes the run to stp - sys.exit() in a test 
causes a test run to die

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



[issue10611] sys.exit() in a test causes a test run to die

2010-12-02 Thread Éric Araujo

Changes by Éric Araujo mer...@netwok.org:


--
nosy: +eric.araujo

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



[issue7475] codecs missing: base64 bz2 hex zlib hex_codec ...

2010-12-02 Thread Alexander Belopolsky

Alexander Belopolsky belopol...@users.sourceforge.net added the comment:

I am probably a bit late to this discussion, but why these things should be 
called codecs and why should they share the registry with the encodings?  It 
looks like the proper term would be transformations or transforms.

--
nosy: +belopolsky

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



[issue10554] Context managerment support for subprocess.Popen

2010-12-02 Thread Brian Curtin

Brian Curtin cur...@acm.org added the comment:

Here's a patch which implements the context manager and adds a few tests and a 
small doc change.

Tested on Mac and Windows.

--
keywords: +patch
nosy: +brian.curtin
Added file: http://bugs.python.org/file19916/subprocess.diff

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



[issue10554] Context managerment support for subprocess.Popen

2010-12-02 Thread Éric Araujo

Éric Araujo mer...@netwok.org added the comment:

Thanks!  Patch looks good, tests pass and doc builds.

I have one question and two micro-nitpicks on 
http://codereview.appspot.com/3441041/

--

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



[issue10610] Correct the float(), int() and complex() documentation

2010-12-02 Thread Alexander Belopolsky

Alexander Belopolsky belopol...@users.sourceforge.net added the comment:

Should we also review the documentation for fractions and decimals?  For 
example, fractions are documented as accepting strings of decimal digits, but 
given that we have presumably non-identical str.isdigit() and str.isdecimal() 
methods, the above definition begs a question whether accepted strings should 
be digits, decimals or both?

--

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



[issue10612] StopTestRun exception to halt test run

2010-12-02 Thread Michael Foord

New submission from Michael Foord mich...@voidspace.org.uk:

It is hard for test infrastructure to halt a test run unless it has access to 
the result object. 

A StopTestRun exception could be provided. This could be caught in TestCase.run 
and call TestResult.stop().

It could be parameterized so that StopTestRun(report=False) bombs out and stops 
the test run completely.

--
assignee: michael.foord
components: Library (Lib)
messages: 123158
nosy: michael.foord
priority: normal
severity: normal
status: open
title: StopTestRun exception to halt test run
type: performance
versions: Python 3.2, Python 3.3

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



[issue10554] Context managerment support for subprocess.Popen

2010-12-02 Thread Brian Curtin

Brian Curtin cur...@acm.org added the comment:

I updated the doc to be much more simple. I got used to sys.executable based 
tests :) New patch attached.

As for __del__, I think it should do it's thing, and the exit will do it's own. 
Context managers are traditionally used on file-based things, or things that 
can be opened or closed. Creating a Popen object will open one or more pipes, 
so we should just close those opened pipes.

--
Added file: http://bugs.python.org/file19917/subprocess2.diff

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



[issue10554] Context managerment support for subprocess.Popen

2010-12-02 Thread Éric Araujo

Éric Araujo mer...@netwok.org added the comment:

New doc looks good. Suggested changes: make with a link, explaing why it’s a 
context manager.

-   Popen objects are supported as context managers via the ``with`` statement.
+   Popen objects are supported as context managers via the :keyword:`with`` 
statement, so that file descriptors are closed cleanly.

I agree with your view on __del__ vs. __exit__.

--

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



[issue10554] Context managerment support for subprocess.Popen

2010-12-02 Thread Éric Araujo

Éric Araujo mer...@netwok.org added the comment:

:keyword:`with`` → :keyword:`with`

--

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



[issue10554] Context management support for subprocess.Popen

2010-12-02 Thread Alexander Belopolsky

Changes by Alexander Belopolsky belopol...@users.sourceforge.net:


--
title: Context managerment support for subprocess.Popen - Context management 
support for subprocess.Popen

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



[issue9299] os.makedirs(): Add a keyword argument to suppress File exists exception

2010-12-02 Thread Ray.Allen

Ray.Allen ysj@gmail.com added the comment:

Oh, yes, I missed that, too. I didn't pay attention to that. Thanks for  
pointing out it and fix it!

--

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



[issue2142] difflib.unified_diff(...) produces invalid patches

2010-12-02 Thread Éric Araujo

Éric Araujo mer...@netwok.org added the comment:

To sum up the current consensus as I understand it, the missing end of line is 
clearly a bug, but the addition of “\No newline at end of file” is 
controversial.  In the current patch, both are changed, so backporting only the 
first fix to 3.1 and 2.7 will require either agreeing to add “\No newline etc” 
in those versions too, or make another patch for 3.1/2.7.

I uploaded the patch to http://codereview.appspot.com/3432041/ and made some 
minor comments.

--
nosy: +benjamin.peterson, djc, eric.araujo, georg.brandl -BreamoreBoy

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



[issue10554] Context management support for subprocess.Popen

2010-12-02 Thread Brian Curtin

Brian Curtin cur...@acm.org added the comment:

Committed in r86951. Thanks for the reviews!

--
assignee:  - brian.curtin
resolution:  - fixed
stage: needs patch - committed/rejected

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



[issue10557] Malformed error message from float()

2010-12-02 Thread Alexander Belopolsky

Alexander Belopolsky belopol...@users.sourceforge.net added the comment:

I am submitting a new patch that excludes int() changes.  The honest reason for 
the exclusion is that I gave up chasing a bug that only shows in full regrtest 
runs.  (Marc, I don't think it is related to what you thought was a missing 
norm decref: that place had result = NULL, not return NULL, so the contral was 
falling through to the decref after the if statement.)  Nevertheless, I think 
it makes sense to proceed with smaller steps.  As Marc suggested, 
PyUnicode_EncodeDecimal() API will stay indefinitely, so there is no urge to 
remove its use.  There are no actual bugs associated with int(), so technically 
it does not belong to this issue.

--
Added file: http://bugs.python.org/file19918/issue10557c.diff

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



[issue8525] Display exception's subclasses in help()

2010-12-02 Thread Éric Araujo

Éric Araujo mer...@netwok.org added the comment:

Didn’t the first message ask for the feature to be extended to non-exceptions 
classes?  “Built-in” subclasses is a red herring, to me the feature is: display 
subclasses.  In the text output you can use the search feature of your pager to 
jump to a subclass, in the HTML output it would be a helpful link.

--

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



[issue1058305] HTMLParser.locatestartagend regex too stringent

2010-12-02 Thread R. David Murray

R. David Murray rdmur...@bitdance.com added the comment:

Closing this in favor of 1486713, which has a patch and covers additional 
issues.

--
nosy:  -BreamoreBoy
resolution:  - duplicate
stage: unit test needed - committed/rejected
status: open - closed
superseder:  - HTMLParser : A auto-tolerant parsing mode

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



[issue8525] Display exception's subclasses in help()

2010-12-02 Thread Alexander Belopolsky

Alexander Belopolsky belopol...@users.sourceforge.net added the comment:

On Thu, Dec 2, 2010 at 9:56 PM, Éric Araujo rep...@bugs.python.org wrote:
..
 Didn’t the first message ask for the feature to be extended to non-exceptions 
 classes?  “Built-in”
 subclasses is a red herring, to me the feature is: display subclasses.  In 
 the text output you can use
 the search feature of your pager to jump to a subclass, in the HTML output it 
 would be a helpful link.

If we don't restrict to builtins, then the display will depend on what
modules are currently loaded and will be useless for command line use
unless all subclasses are defined in the same module.

--

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



[issue8525] Display exception's subclasses in help()

2010-12-02 Thread Éric Araujo

Éric Araujo mer...@netwok.org added the comment:

Yes, I imagine the feature to be useful to find subclasses defined in the same 
module.  Rob, am I misunderstanding your original request?

--

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



[issue10613] gzip._PaddedFile calls getattr with arguments in reversed order

2010-12-02 Thread Charles Harris

New submission from Charles Harris charlesr.har...@gmail.com:

The attached patch fixes the problem.

--
components: Library (Lib)
files: gzip.patch
keywords: patch
messages: 123171
nosy: charris44
priority: normal
severity: normal
status: open
title: gzip._PaddedFile calls getattr with arguments in reversed order
versions: Python 3.2
Added file: http://bugs.python.org/file19919/gzip.patch

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



[issue10613] gzip._PaddedFile calls getattr with arguments in reversed order

2010-12-02 Thread Éric Araujo

Éric Araujo mer...@netwok.org added the comment:

Thanks for the report and patch.  Can you add a test, to prevent a regression?

--
nosy: +eric.araujo
stage:  - unit test needed
type:  - behavior
versions: +Python 2.7, Python 3.1

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



[issue10528] argparse uses %s in gettext calls

2010-12-02 Thread Éric Araujo

Éric Araujo mer...@netwok.org added the comment:

The incompatibility worries me a bit.  A program compatible with Python 3.1 and 
3.2 would have to support both sets of messages; I don’t know whether the i18n 
tools support having all the strings in one PO file, and how inconvenient it 
would be for translators.  I assume such transitions have happened in many 
projects and that people just accept the inconvenience.

Attached patch changes the strings to avoid warnings.  No tests added (I intend 
to write tests for i18n in argparse in the future, see #10497 and #10529).

Steven, I’d like your +1 before committing anything.  One message in particular 
is not very helpful, but I’ve been unable to find better placeholders (it’s in 
ArgumentPaser._get_value):
  msg = _('invalid %(name)s value: %(arg_string)r')

--
keywords: +patch
Added file: http://bugs.python.org/file19920/fix-gettext-positionals.diff

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



[issue1486713] HTMLParser : A auto-tolerant parsing mode

2010-12-02 Thread R. David Murray

R. David Murray rdmur...@bitdance.com added the comment:

I have committed a version of this patch, without the warnings, using the 
keyword 'strict=True' as the default, and with a couple added heuristics from 
other similar issues, in r86952.

kxroberto, if you want to supply your full name, I'll add you to Misc/ACKS.  
Thanks for the original patch.

--
nosy:  -BreamoreBoy
resolution:  - accepted
stage: unit test needed - committed/rejected
status: open - closed

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



[issue975556] HTMLParser lukewarm on bogus bare attribute chars

2010-12-02 Thread R. David Murray

R. David Murray rdmur...@bitdance.com added the comment:

The new strict=False mode from #1486713 handles this case.

--
nosy: +r.david.murray
resolution:  - accepted
stage:  - committed/rejected
status: open - closed
superseder:  - HTMLParser : A auto-tolerant parsing mode

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



[issue1046092] HTMLParser fix to accept mailformed tag attributes

2010-12-02 Thread R. David Murray

R. David Murray rdmur...@bitdance.com added the comment:

Included this in the 'strict=False' mode in the issue 1486713 patch.

--
nosy: +r.david.murray -BreamoreBoy
resolution:  - accepted
stage: patch review - committed/rejected
status: open - closed
superseder:  - HTMLParser : A auto-tolerant parsing mode

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



[issue1046092] HTMLParser fix to accept malformed tag attributes

2010-12-02 Thread R. David Murray

Changes by R. David Murray rdmur...@bitdance.com:


--
title: HTMLParser fix to accept mailformed tag attributes - HTMLParser fix to 
accept malformed tag attributes

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




[issue10497] Incorrect use of gettext in argparse

2010-12-02 Thread Éric Araujo

Éric Araujo mer...@netwok.org added the comment:

I’ve started on a test but I’m not sure how to proceed, since I need to use or 
intercept gettext and compare the error messages of argparse with translated 
messages to prove that the gettext calls are bogus.  There are various ways of 
using or intercepting gettext from tests, but I have to experiment a bit before 
I can propose the simplest patch that could possibly work.

Exceptionally, I’d like to commit the change as is, and defer the testing for 
some months, until I can get to #10529.

--
assignee:  - eric.araujo

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



[issue9709] test_distutils warning: initfunc exported twice on Windows

2010-12-02 Thread Éric Araujo

Éric Araujo mer...@netwok.org added the comment:

Sounds like a “+1 for the patch” to me :)

I get no warning on linux2 after the patch.  This is still a behavior change, 
and there might be code out there relying on self.get_export_symbols being 
called.  My understanding of extension modules build is too small for me to 
have confidence, so I will defer the decision to Tarek.

--
assignee: eric.araujo - tarek

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



[issue10562] Change 'j' for imaginary unit into an 'i'

2010-12-02 Thread Éric Araujo

Changes by Éric Araujo mer...@netwok.org:


Removed file: http://bugs.python.org/file19914/unnamed

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



[issue10562] Change 'j' for imaginary unit into an 'i'

2010-12-02 Thread Éric Araujo

Éric Araujo mer...@netwok.org added the comment:

Whether 1+2j is a literal or an expression is debatable.  I think +1 is an 
expression but 1+2j is a literal; neither should have a space.

I’m not sure the language reference and the actual implementation are in 
agreement here (I have peephole optimizations in mind).

--
nosy: +eric.araujo

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



[issue10613] gzip._PaddedFile calls getattr with arguments in reversed order

2010-12-02 Thread Charles Harris

Charles Harris charlesr.har...@gmail.com added the comment:

Hi Eric,

On Thu, Dec 2, 2010 at 8:12 PM, Éric Araujo rep...@bugs.python.org wrote:

Where are the guidelines for writing python tests?

Chuck

--
Added file: http://bugs.python.org/file19921/unnamed

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10613
___Hi Eric,brbrdiv class=gmail_quoteOn Thu, Dec 2, 2010 at 8:12 PM, Éric 
Araujo span dir=ltrlt;a 
href=mailto:rep...@bugs.python.org;rep...@bugs.python.org/agt;/span 
wrote:brblockquote class=gmail_quote style=margin: 0pt 0pt 0pt 0.8ex; 
border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;
br
Éric Araujo lt;a href=mailto:mer...@netwok.org;mer...@netwok.org/agt; 
added the comment:br
br
Thanks for the report and patch.  Can you add a test, to prevent a 
regression?br
br
--br
nosy: +eric.araujobr
stage:  -gt; unit test neededbr
type:  -gt; behaviorbr
versions: +Python 2.7, Python 3.1br
divdiv/divdiv class=h5br/div/div/blockquotedivbrWhere are 
the guidelines for writing python tests?brbrChuck br/divbr/div
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10613] gzip._PaddedFile calls getattr with arguments in reversed order

2010-12-02 Thread Charles Harris

Changes by Charles Harris charlesr.har...@gmail.com:


Removed file: http://bugs.python.org/file19921/unnamed

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



[issue10613] gzip._PaddedFile calls getattr with arguments in reversed order

2010-12-02 Thread Éric Araujo

Éric Araujo mer...@netwok.org added the comment:

The best way is to learn by imitation.  If you prefer to read, there is some 
guidance on http://www.python.org/dev/workflow/ and 
http://www.python.org/dev/faq/#how-to-test-a-patch .

Concretely, you need to open a file, wrap it in a _PaddedFile and check that 
attributes like name and closed are good (using assertEqual).

You’ll also want to follow patch guidelines at 
http://www.python.org/dev/patches/

--

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



[issue10610] Correct the float(), int() and complex() documentation

2010-12-02 Thread Raymond Hettinger

Raymond Hettinger rhettin...@users.sourceforge.net added the comment:

Try not to sprawl this all over the docs.  Find the most common root and 
document it there.  No need to garbage-up Fractions, Decimal etc. with 
something that is of zero interest to 99.9% of users.

--
nosy: +rhettinger

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



[issue10610] Correct the float(), int() and complex() documentation

2010-12-02 Thread Alexander Belopolsky

Alexander Belopolsky belopol...@users.sourceforge.net added the comment:

On Fri, Dec 3, 2010 at 12:10 AM, Raymond Hettinger
rep...@bugs.python.org wrote:
..
 Try not to sprawl this all over the docs.  Find the most common root and 
 document it there.
 No need to garbage-up Fractions, Decimal etc. with something that is of zero 
interest to
 99.9% of users.

Decimal do already has a big BNF display with

digit  ::=  '0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9'

And a note that, btw, Other Unicode decimal digits are also permitted
where digit appears above. These include decimal digits from various
other alphabets (for example, Arabic-Indic and Devanāgarī digits)
along with the fullwidth digits '\uff10' through '\uff19'.

http://docs.python.org/dev/library/decimal.html#decimal-objects

Builtin int() doc take you on a link chase that ends at the language
reference int literal BNF.   Bringing these all to a common root was
exactly the reason I brought up these related modules.

--

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



[issue10613] gzip._PaddedFile calls getattr with arguments in reversed order

2010-12-02 Thread Charles Harris

Charles Harris charlesr.har...@gmail.com added the comment:

Looks like this was fixed by r86555 and a test added. I think you can close the 
ticket.

--

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



[issue10613] gzip._PaddedFile calls getattr with arguments in reversed order

2010-12-02 Thread Éric Araujo

Éric Araujo mer...@netwok.org added the comment:

Good catch.  I’m tired, I should have noticed that :)

--
resolution:  - duplicate
stage: unit test needed - committed/rejected
status: open - closed
superseder:  - gzip module calls getattr incorrectly

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



[issue10562] Change 'j' for imaginary unit into an 'i'

2010-12-02 Thread Alexander Belopolsky

Alexander Belopolsky belopol...@users.sourceforge.net added the comment:

On Thu, Dec 2, 2010 at 11:49 PM, Éric Araujo rep...@bugs.python.org wrote:
..
 Whether 1+2j is a literal or an expression is debatable.
 I think +1 is an expression but 1+2j is a literal; neither should have a 
space.

With respect to implementation there is no debate:

[TokenInfo(type=57 (ENCODING), string='utf-8', start=(0, 0), end=(0,
0), line=''),
 TokenInfo(type=2 (NUMBER), string='1', start=(1, 0), end=(1, 1), line='1+1j'),
 TokenInfo(type=53 (OP), string='+', start=(1, 1), end=(1, 2), line='1+1j'),
 TokenInfo(type=2 (NUMBER), string='1j', start=(1, 2), end=(1, 4), line='1+1j'),
 TokenInfo(type=0 (ENDMARKER), string='', start=(2, 0), end=(2, 0), line='')]

[TokenInfo(type=57 (ENCODING), string='utf-8', start=(0, 0), end=(0,
0), line=''),
 TokenInfo(type=53 (OP), string='-', start=(1, 0), end=(1, 1), line='-1'),
 TokenInfo(type=2 (NUMBER), string='1', start=(1, 1), end=(1, 2), line='-1'),
 TokenInfo(type=0 (ENDMARKER), string='', start=(2, 0), end=(2, 0), line='')]

(Who designed the tokenize interface, btw?  I took me 3 tries to come
up with the incantation above.)


 I’m not sure the language reference and the actual implementation are in 
 agreement here
 (I have peephole optimizations in mind).

Literals are atomic to the tokenizer.  AST processes a stream of
tokens.  Peephole optimizations are irrelevant because these are hacks
that operate on the bytecode when the lexical structure is all but
forgotten.

--

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



[issue10562] Change 'j' for imaginary unit into an 'i'

2010-12-02 Thread Alexander Belopolsky

Alexander Belopolsky belopol...@users.sourceforge.net added the comment:

On Thu, Dec 2, 2010 at 11:49 PM, Éric Araujo rep...@bugs.python.org wrote:
..
 Whether 1+2j is a literal or an expression is debatable.
 I think +1 is an expression but 1+2j is a literal; neither should have a 
space.

With respect to implementation there is no debate:

[TokenInfo(type=57 (ENCODING), string='utf-8', start=(0, 0), end=(0,
0), line=''),
 TokenInfo(type=2 (NUMBER), string='1', start=(1, 0), end=(1, 1), line='1+1j'),
 TokenInfo(type=53 (OP), string='+', start=(1, 1), end=(1, 2), line='1+1j'),
 TokenInfo(type=2 (NUMBER), string='1j', start=(1, 2), end=(1, 4), line='1+1j'),
 TokenInfo(type=0 (ENDMARKER), string='', start=(2, 0), end=(2, 0), line='')]

[TokenInfo(type=57 (ENCODING), string='utf-8', start=(0, 0), end=(0,
0), line=''),
 TokenInfo(type=53 (OP), string='-', start=(1, 0), end=(1, 1), line='-1'),
 TokenInfo(type=2 (NUMBER), string='1', start=(1, 1), end=(1, 2), line='-1'),
 TokenInfo(type=0 (ENDMARKER), string='', start=(2, 0), end=(2, 0), line='')]

(Who designed the tokenize interface, btw?  I took me 3 tries to come
up with the incantation above.)


 I’m not sure the language reference and the actual implementation are in 
 agreement here
 (I have peephole optimizations in mind).

Literals are atomic to the tokenizer.  AST processes a stream of
tokens.  Peephole optimizations are irrelevant because these are hacks
that operate on the bytecode when the lexical structure is all but
forgotten.

--

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



[issue10562] Change 'j' for imaginary unit into an 'i'

2010-12-02 Thread Alexander Belopolsky

Alexander Belopolsky belopol...@users.sourceforge.net added the comment:

And of course, roundup ate my work.  The tokenize incantation was

 pprint(list(tokenize(iter([b'1+1j']).__next__)))

--

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



[issue10562] Change 'j' for imaginary unit into an 'i'

2010-12-02 Thread Alexander Belopolsky

Changes by Alexander Belopolsky belopol...@users.sourceforge.net:


--
Removed message: http://bugs.python.org/msg123186

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



[issue10562] Change 'j' for imaginary unit into an 'i'

2010-12-02 Thread Alexander Belopolsky

Changes by Alexander Belopolsky belopol...@users.sourceforge.net:


--
Removed message: http://bugs.python.org/msg123187

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



[issue10610] Correct the float(), int() and complex() documentation

2010-12-02 Thread Raymond Hettinger

Raymond Hettinger rhettin...@users.sourceforge.net added the comment:

Try not to twist yourself in a knot over this.

I'll be happy to review in proposed doc patch.

--
assignee: d...@python - rhettinger

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



[issue10609] dbm documentation example doesn't work (iteritems())

2010-12-02 Thread Sandro Tosi

Sandro Tosi sandro.t...@gmail.com added the comment:

Hi Eric,
on and up-to-date py3k I got this:


 for k, v in db.items():
... print(k, '\t', v)
... 
Traceback (most recent call last):
  File stdin, line 1, in module
AttributeError: '_dbm.dbm' object has no attribute 'items'
 'items' in dir(db)
False

(I tried to use items() before proposing that code ;)).

--

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



[issue10577] (Fancy) URL opener stuck when trying to open redirected url

2010-12-02 Thread Senthil Kumaran

Senthil Kumaran orsent...@gmail.com added the comment:

On Mon, Nov 29, 2010 at 05:51:35PM +, Antoine Pitrou wrote:

 However, urllib.request.urlopen() works fine in this case, so
 perhaps this advocates for deprecating the old stuff? Senthil?

Yes. It should be deprecated.. I created a branch for trying
removing/refactoring some old old (urlretrive, etc) for eg. Let me go
along that and come up with something soon.

--

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



[issue10367] python setup.py sdist upload --show-response can fail with UnboundLocalError: local variable 'result' referenced before assignment

2010-12-02 Thread Éric Araujo

Éric Araujo mer...@netwok.org added the comment:

Thanks Daniel.  I have good and bad news for this patch.

The bad news is that I don’t want to accept patches without tests.  We need to 
stop guessing or experimenting with the real PyPI to fix bugs.

The good news is that we have a mock PyPI server in distutils2.  Its use is 
described at 
http://distutils2.notmyidea.org/library/distutils2.tests.pypi_server.html and 
there are examples in the current test suite.  Instructions for patching 
distutils2 are at http://wiki.python.org/moin/Distutils/FixingBugs .  When a 
patch that includes a test is written, I will backport the relevant parts to 
distutils1.

--
assignee:  - eric.araujo
components: +Distutils, Distutils2
nosy: +tarek
versions: +3rd party, Python 3.1, Python 3.2

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



[issue10453] Add -h/--help option to compileall

2010-12-02 Thread Éric Araujo

Changes by Éric Araujo mer...@netwok.org:


--
priority: normal - high
stage: needs patch - unit test needed

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



[issue10534] difflib.SequenceMatcher: expose junk sets, deprecate undocumented isb... functions.

2010-12-02 Thread Georg Brandl

Georg Brandl ge...@python.org added the comment:

Don't worry about doc additions too much; all doc changes can be considered bug 
fixes.

In this patch, it appears that two of the three attributes are new?  They 
should get a versionadded.

--

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



[issue10610] Correct the float(), int() and complex() documentation

2010-12-02 Thread Raymond Hettinger

Changes by Raymond Hettinger rhettin...@users.sourceforge.net:


--
Removed message: http://bugs.python.org/msg123190

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



[issue1745035] DoS smtpd vulnerability

2010-12-02 Thread Georg Brandl

Georg Brandl ge...@python.org added the comment:

Committed in r86955.  Thanks!

--
resolution:  - fixed
status: open - closed

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



[issue10610] Correct the float(), int() and complex() documentation

2010-12-02 Thread Raymond Hettinger

Raymond Hettinger rhettin...@users.sourceforge.net added the comment:

Let me know when you have a proposed doc patch.  Ideally, the details should 
just be in one place and we can refer to it elsewhere.   We don't want to add 
extra info to every function or method in Python that uses int(s) and gets 
extra unicode digits as an unintended artifact.

--

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



[issue10614] ZipFile and CP932 encoding

2010-12-02 Thread Hirokazu Yamamoto

New submission from Hirokazu Yamamoto ocean-c...@m2.ccsnet.ne.jp:

Currently, ZipFile only accepts ascii or utf8 as file
name encodings. On Windows (Japanese), usually CP932
is used for it. So currently, when we melt ZipFile
via py3k, non-ascii file name becomes strange. Can we handle
this issue? (ie: adding encoding option for ZipFile#__init__)

--
components: Extension Modules
messages: 123197
nosy: ocean-city
priority: normal
severity: normal
status: open
title: ZipFile and CP932 encoding
type: feature request
versions: Python 3.2, Python 3.3

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



[issue940286] pydoc.Helper.help() ignores input/output init parameters

2010-12-02 Thread Georg Brandl

Georg Brandl ge...@python.org added the comment:

Looks good; committed in r86957.

--
resolution:  - fixed
status: open - closed

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



[issue10360] _weakrefset.WeakSet.__contains__ should not propagate TypeErrors

2010-12-02 Thread Georg Brandl

Georg Brandl ge...@python.org added the comment:

I agree; committed in r86960.

If anyone wants to change this to raise TypeError for objects that are both 
unhashable and unrefable, please speak up.

--
resolution:  - fixed
status: open - closed

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



<    1   2