[issue11592] Compilation warnings in os module

2011-03-18 Thread Ross Lagerwall

Changes by Ross Lagerwall rosslagerw...@gmail.com:


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

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



[issue11320] Can't call Py_SetPath() on pointer returned by Py_GetPath()

2011-03-18 Thread Palm Kevin

Palm Kevin kevin.p...@labsolution.lu added the comment:

Antoine,

Your guess that my issue initially wasn't related to virtualenv is correct 
(I've never heard about that project before posting this issue...)

As for passing the output of Py_GetPath directly to Py_SetPath: You are right, 
there is no point in doing this...
Now,  I remember that the initial problem I had was the one you reported:
Fatal Python error: Py_Initialize: Unable to get the locale encoding
LookupError: no codec search functions registered: can't find encoding

Shall I create a separate issue to report this problem?

--

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



[issue11320] Can't call Py_SetPath() on pointer returned by Py_GetPath()

2011-03-18 Thread Palm Kevin

Palm Kevin kevin.p...@labsolution.lu added the comment:

Furthermore I would propose to rename this issue: The problem is not that 
Py_SetPath cannot be called on pointer returned by Py_GetPath. I think that the 
problem is more general: Calling Py_SetPath NEVER works.

-- I get the same exception as documented in my initial post when calling 
Py_SetPyth like this:
   Py_SetPath(L/usr/labsolution/python32/lib/python3.2/);
or like this:
  wchar_t * path;
  path = malloc(128 * sizeof(wchar_t));
  wcscpy(path,L/usr/labsolution/python32/lib/python3.2/);
  Py_SetPath(path);

--

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



[issue11320] Can't call Py_SetPath() on pointer returned by Py_GetPath()

2011-03-18 Thread Palm Kevin

Palm Kevin kevin.p...@labsolution.lu added the comment:

As for this error:
  Fatal Python error: Py_Initialize: Unable to get the locale encoding
  LookupError: no codec search functions registered: can't find encoding

It seems to me that this error appears if the path passed to Py_SetPath does 
not point to a valid python lib folder.

--

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



[issue11593] Add encoding parameter to logging.basicConfig

2011-03-18 Thread Vinay Sajip

Vinay Sajip vinay_sa...@yahoo.co.uk added the comment:

I've been thinking about adding a handler= keyword argument to basicConfig(), 
and it seems to me that it would not only cover your use case, but also other 
cases which require different handlers.

So I'm marking as wontfix for now, but I'll keep the issue open until the 
handler parameter gets added. Also changing this to Python 3.3, as I can't make 
API changes to 3.2.

--
assignee:  - vinay.sajip
resolution:  - wont fix
versions: +Python 3.3 -Python 3.2

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



[issue11572] bring Lib/copy.py to 100% coverage

2011-03-18 Thread Éric Araujo

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

A little research has found that building without complex is not possible 
anymore, so you’re good: http://bugs.python.org/issue7147

Regarding “unicode”, see line 112.

--

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



[issue10914] Python sub-interpreter test

2011-03-18 Thread Éric Araujo

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

 Well, config._link() seems to do what is needed here.
My point is that it’s easier to write a few lines of code directly using a 
compiler object (copying and simplifying code from try_run or _link) than go 
through the distutils command machinery.  Both are doable, but I think the 
former is easier.

--

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



[issue11591] python -S should be robust against e.g. from site import addsitedir

2011-03-18 Thread Éric Araujo

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

Fair argument.  Brett is the author of recent changes in site, let him decide.

Brett: Would you agree to 1)?

--
nosy: +brett.cannon

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



[issue1195] Problems on Linux with Ctrl-D and Ctrl-C during raw_input

2011-03-18 Thread STINNER Victor

STINNER Victor victor.stin...@haypocalc.com added the comment:

Instead of always calling clearerr(), we can only call it on EOF:

diff -r 88fe1ac48460 Parser/myreadline.c
--- a/Parser/myreadline.c   Mon Mar 07 08:31:52 2011 +0100
+++ b/Parser/myreadline.c   Fri Mar 18 10:57:23 2011 +0100
@@ -72,6 +72,7 @@
 }
 #endif /* MS_WINDOWS */
 if (feof(fp)) {
+clearerr(fp);
 return -1; /* EOF */
 }
 #ifdef EINTR

This patch works around this issue.

--

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



[issue11320] Can't call Py_SetPath() on pointer returned by Py_GetPath()

2011-03-18 Thread Antoine Pitrou

Antoine Pitrou pit...@free.fr added the comment:

 As for this error:
   Fatal Python error: Py_Initialize: Unable to get the locale encoding
   LookupError: no codec search functions registered: can't find encoding
 
 It seems to me that this error appears if the path passed to
 Py_SetPath does not point to a valid python lib folder.

Indeed, it does. The error message could perhaps get improved.
What Python does is try to find the current locale's encoding in the
encodings package and load it. If it can't find it, it assumes that's
because the encoding is unknown, not because the path is wrong.

--

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



[issue11575] addresses.txt file leaks into search engines

2011-03-18 Thread Senthil Kumaran

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

Why should we have this file served on the web itself? Cannot it be on server 
outside of www ( or any directory which is getting served). I would vote for 
this.

--
nosy: +orsenthil

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



[issue11575] addresses.txt file leaks into search engines

2011-03-18 Thread Antoine Pitrou

Antoine Pitrou pit...@free.fr added the comment:

The question is not why, it is how. This file is part of the scripts used 
to migrate from svn to hg. These files themselves were maintained in an hg 
repository (it could have been an svn repository), for obvious practical 
reasons. And that repository was online since there didn't seem any reason to 
do otherwise (and, again, it's more practical).

We could of course make this repo less visible now (but I think we still need 
to migrate the peps repo). Georg?

--

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



[issue11549] Rewrite peephole to work on AST

2011-03-18 Thread Mark Dickinson

Changes by Mark Dickinson dicki...@gmail.com:


--
nosy: +mark.dickinson

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



[issue11574] Unicode Fallback Encoding on Python 3.3

2011-03-18 Thread STINNER Victor

STINNER Victor victor.stin...@haypocalc.com added the comment:

After reading the related mail thread on python-dev, I realized that you are 
talking about TextIOWrapper choice (file content, not file name). My previous 
message is about file names.

--

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



[issue11572] bring Lib/copy.py to 100% coverage

2011-03-18 Thread Brandon Craig Rhodes

Brandon Craig Rhodes bran...@rhodesmill.org added the comment:

Éric, after checking line 112 of the two patches and then of the new file, I 
figured out that you meant line 112 of the old file — and, yes, that test can 
go away too since in python3 complex always exists and unicode never 
exists. A further improved patch (#3) is attached.

--
Added file: http://bugs.python.org/file21276/test_copy3.patch

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



[issue11574] Unicode Fallback Encoding on Python 3.3

2011-03-18 Thread STINNER Victor

STINNER Victor victor.stin...@haypocalc.com added the comment:

TextIOWrapper is mostly based on locale.getpreferredencoding(), so msg131290 is 
still valid: if no env var is set, nl_langinfo() gives 'ASCII' (or something 
like that). But it is not easy to detect that env vars are not set.

I would prefer a completly different approach: always use UTF-8 by default if 
the encoding is not set.

Something like:
def open(filename, ..., encoding='UTF-8', ...)
TextIOWrapper.__init__(..., encoding='UTF-8', ...)

So not rely on locales anymore.

--

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



[issue11581] buildbot error when pushing to 2.5 branch?

2011-03-18 Thread R. David Murray

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

I talked to Martin.  He wants the 2.5 mercurial branch to get *exactly* that 
set of changes that needs to be applied to the svn repository in order for him 
to build the security release, no more no less.  Note that 2.5 goes out of 
security maintenance in November.

--
nosy: +r.david.murray

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



[issue11581] buildbot error when pushing to 2.5 branch?

2011-03-18 Thread Senthil Kumaran

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

David, from you message I understand that Martin is planning to
release 2.5 via svn.  If that is the case, whatever was pushed for
security fix to hg can remain as such and so that those can be
exported to svn. 

The bugs related to buildbot and svn keyword for 2.5, can then be
ignored and closed.

--

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



[issue11581] buildbot error when pushing to 2.5 branch?

2011-03-18 Thread R. David Murray

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

Yes, although there may be another answer on the compile bug.

--
resolution:  - wont fix
stage:  - committed/rejected
status: open - closed
type:  - behavior

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



[issue11513] chained exception/incorrect exception from tarfile.open on a non-existent file

2011-03-18 Thread Evan Dandrea

Evan Dandrea e...@ubuntu.com added the comment:

David,

Thanks for the pointers. I've updated the patch hopefully adequately addressing 
your concerns.

--
components: +Interpreter Core -Library (Lib)
type: behavior - 
Added file: 
http://bugs.python.org/file21277/tarfile-fix-multiple-exception-on-enoent.patch

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



[issue11513] chained exception/incorrect exception from tarfile.open on a non-existent file

2011-03-18 Thread Evan Dandrea

Changes by Evan Dandrea e...@ubuntu.com:


Removed file: 
http://bugs.python.org/file21223/tarfile-fix-multiple-exception-on-enoent.patch

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



[issue11579] python 2.5 does not build from hg - looks for subversion keywords

2011-03-18 Thread R. David Murray

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

I talked to Martin about this at the sprints.  He wants the set of patches in 
the 2.5 hg repo to be exactly those that he should apply to svn to build the 
next release, no more no less.  If someone wants to propose a patch that fixes 
the hg compile but does not break the svn compile, he would find that 
acceptable.  Alternatively the hg repo could be fixed, for our convenience, 
after 2.5 goes out of maintenance in November.

--
nosy: +r.david.murray

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



[issue11594] 2to3 tool does not preserve line-endings

2011-03-18 Thread Alexander Belchenko

New submission from Alexander Belchenko bia...@ukr.net:

I'm using LF-only line-endings for development of my IntelHex library. I'm 
working on Windows most of the time.

After 2to3 tool has been ran on my library it has not only changed the Python 
syntax, but it also saved all files with CRLF line-endings. As result I have 
all changed files completelly modified and diff shows change in every line. 

2to3 tool should respect my line-endings and must not use simple open(xxx, 
wt) mode for writing modified files.

--
components: 2to3 (2.x to 3.0 conversion tool)
messages: 131335
nosy: bialix
priority: normal
severity: normal
status: open
title: 2to3 tool does not preserve line-endings
type: behavior
versions: Python 2.7, Python 3.2

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



[issue11572] bring Lib/copy.py to 100% coverage

2011-03-18 Thread Daniel Urban

Changes by Daniel Urban urban.dani...@gmail.com:


--
nosy: +durban

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



[issue11595] Miscellaneous bugs in cfg_to_args() utility function

2011-03-18 Thread Erik Bray

New submission from Erik Bray erik.m.b...@gmail.com:

Attached is a patch that fixes a few miscellaneous bugs in cfg_to_args() that 
were holding me up. Namely:
 * A bad variable name (file - path)
 * A few more fields needed to be in MULTI_FIELDS
 * Added support for packages_root - package_dir conversion

This also adds a unit test for cfg_to_args().

--
assignee: tarek
components: Distutils2
files: cfg_to_args.patch
keywords: patch
messages: 131336
nosy: Erik.Bray, alexis, eric.araujo, tarek
priority: normal
severity: normal
status: open
title: Miscellaneous bugs in cfg_to_args() utility function
Added file: http://bugs.python.org/file21278/cfg_to_args.patch

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



[issue11563] test_urllibnet is triggering a ResourceWarning

2011-03-18 Thread Nadeem Vawda

Nadeem Vawda nadeem.va...@gmail.com added the comment:

issue10883 is related; test_urllib2net also leaves sockets open in several 
places.

--
nosy: +haypo, nvawda

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



[issue11596] import error in test_fileinput.py when bz2 not installed (windows)

2011-03-18 Thread Lorenz

New submission from Lorenz pyt...@xca.ch:

there is an ImportError when there is no bz2 lib and the test_fileinput is 
running.

--
components: Tests
files: check_bz2_lib_available.diff
keywords: patch
messages: 131338
nosy: DaMutz
priority: normal
severity: normal
status: open
title: import error in test_fileinput.py when bz2 not installed (windows)
type: behavior
versions: Python 3.3
Added file: http://bugs.python.org/file21279/check_bz2_lib_available.diff

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



[issue11549] Rewrite peephole to work on AST

2011-03-18 Thread Nadeem Vawda

Changes by Nadeem Vawda nadeem.va...@gmail.com:


--
nosy: +nvawda

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



[issue10050] urllib.request still has old 2.x urllib primitives

2011-03-18 Thread Nadeem Vawda

Changes by Nadeem Vawda nadeem.va...@gmail.com:


--
nosy: +nvawda

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



[issue11597] Can't get ConfigParser.write to write unicode strings

2011-03-18 Thread the_isz

New submission from the_isz the_...@gmx.de:

Hey everyone,

I'm having issues writing unicode strings with ConfigParser.write. I don't know
if this is python's fault or my own but I couldn't find help on this, neither by
googling, nor by asking on the python irc channels.

Attached to this description I'll add an example script reproducing the error
and hope that someone will enlighten me on what I'm doing wrong.

It seems that this only occurs in python2, doing the same with python3 (omitting
the u before the unicode string), everything works fine.

Thanks in advance!

--
components: Extension Modules
files: test.py
messages: 131339
nosy: the_isz
priority: normal
severity: normal
status: open
title: Can't get ConfigParser.write to write unicode strings
type: behavior
versions: Python 2.7
Added file: http://bugs.python.org/file21280/test.py

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



[issue11594] 2to3 tool does not preserve line-endings

2011-03-18 Thread R. David Murray

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


--
nosy: +benjamin.peterson

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



[issue11256] inspect.getcallargs raises TypeError on valid arguments

2011-03-18 Thread Daniel Urban

Daniel Urban urban.dani...@gmail.com added the comment:

Updated the patch for mercurial.

--
Added file: http://bugs.python.org/file21281/issue11256_4.patch

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



[issue11597] Can't get ConfigParser.write to write unicode strings

2011-03-18 Thread R. David Murray

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

 str(u\u0411)
Traceback (most recent call last):
  File stdin, line 1, in module
UnicodeEncodeError: 'ascii' codec can't encode character u'\u0411' in position 
0: ordinal not in range(128)

So, clearly configparser in 2.x doesn't support unicode.  Now the question is, 
is this a bug or would adding support be a feature? (If the latter it can't be 
fixed in 2.7.)  I'll leave the answer to that question up to Lucaz.

--
assignee:  - lukasz.langa
nosy: +lukasz.langa, r.david.murray

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



[issue11597] Can't get ConfigParser.write to write unicode strings

2011-03-18 Thread Raymond Hettinger

Raymond Hettinger raymond.hettin...@gmail.com added the comment:

 Now the question is, is this a bug 
 or would adding support be a feature?

That may be a good question for python-dev.

Since ConfigParser is a very old module,
if there were a pressing need, we probably
would have heard about it before now.

--
nosy: +rhettinger

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



[issue11480] Cannot copy a class with a metaclass other than type

2011-03-18 Thread Éric Araujo

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

Looks good to me.

--
nosy: +eric.araujo, pitrou

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



[issue11596] import error in test_fileinput.py when bz2 not installed (windows)

2011-03-18 Thread Roundup Robot

Roundup Robot devnull@devnull added the comment:

New changeset bb645cc39e60 by briancurtin in branch 'default':
Fix #11596. When bz2 isn't available, skip test_bz2_ext_fake.
http://hg.python.org/cpython/rev/bb645cc39e60

--
nosy: +python-dev

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



[issue11596] import error in test_fileinput.py when bz2 not installed (windows)

2011-03-18 Thread Brian Curtin

Brian Curtin br...@python.org added the comment:

Thanks for the patch!

--
assignee:  - brian.curtin
nosy: +brian.curtin
resolution:  - fixed
stage:  - committed/rejected
status: open - closed

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



[issue11494] Confusing error message from warnings.warn

2011-03-18 Thread Éric Araujo

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


--
nosy: +brett.cannon
versions: +Python 3.1, Python 3.2, Python 3.3

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



[issue11597] Can't get ConfigParser.write to write unicode strings

2011-03-18 Thread R. David Murray

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

Well, python3 is probably pushing some people to try to add better unicode 
support to their python2 versions.  I think it is more a question of is this 
an easy fix? or would it require extensive changes to support unicode 
properly.  If it is easy (ie: it is really just a bug in configparser's string 
handling) I don't see a downside to fixing it.

--

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



[issue11595] Miscellaneous bugs in cfg_to_args() utility function

2011-03-18 Thread Éric Araujo

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

Looks good to me (note: didn’t test).

--
versions: +3rd party

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



[issue11589] Additional tests for email module

2011-03-18 Thread Santoso Wijaya

Santoso Wijaya santoso.wij...@gmail.com added the comment:

Do we need each sample--(input - expected output)--to be its own unittest 
function?

Why not something like (pseudo-code):

expected = {
  'input1': 'output1',
  'input2': 'output2',
}

def test_encode(self):# collapse all
for input, output in expected.items():
self._encode(input, output)# test logic

--
nosy: +santa4nt

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



[issue11594] 2to3 tool does not preserve line-endings

2011-03-18 Thread Éric Araujo

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

Thanks for the report.  Can you run “python -m test.test_lib2to3”, if possible 
with a Python 3.x version?  I’ve seen that the tests use binary mode to compare 
file contents, so maybe you will get an error message that can get us started.

--
nosy: +eric.araujo
versions: +Python 3.1, Python 3.3

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



[issue11485] Default SDK value on MacOSX needs changing

2011-03-18 Thread Éric Araujo

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

Setting it to the version of the current OS is probably the least surprising. 
Agreed.

--
nosy: +eric.araujo

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



[issue11598] missing afxres.h error when building bdist_wininst in Visual Studio 2008 Express

2011-03-18 Thread Carl Meyer

New submission from Carl Meyer c...@dirtcircle.com:

By opening up pcbuild.sln in VS2008 Express, I was able to successfully build 
python and pythonw, but when I tried to build bdist_wininst it failed with 
Fatal Error RC1015: cannot open include file afxres.h

Googling turned up a number of comments about how this file is part of MFC, 
which is really not supposed to be used with VS2008. The recommended fix that 
seemed to work for most people online was to replace afxres.h with 
windows.h in the rc file. I did this in PC/bdist_wininst/install.rc, and then 
it failed with a different error about a missing IDC_STATIC token.

I have very little experience with Windows, so it's entirely possible I'm just 
doing something wrong, but I was asked in #python-dev to file a bug here.

--
components: Build, Windows
messages: 131351
nosy: carljm
priority: normal
severity: normal
status: open
title: missing afxres.h error when building bdist_wininst in Visual Studio 2008 
Express
versions: Python 3.3

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



[issue11599] Useless error message when distutils fails compiling

2011-03-18 Thread Antoine Pitrou

New submission from Antoine Pitrou pit...@free.fr:

Really, can't distutils at least display the command-line that failed to 
execute?


Traceback (most recent call last):
  File /home/antoine/cpython/default/Lib/distutils/unixccompiler.py, line 
176, in _compile
extra_postargs)
  File /home/antoine/cpython/default/Lib/distutils/ccompiler.py, line 911, in 
spawn
spawn(cmd, dry_run=self.dry_run)
  File /home/antoine/cpython/default/Lib/distutils/spawn.py, line 34, in spawn
_spawn_posix(cmd, search_path, dry_run=dry_run)
  File /home/antoine/cpython/default/Lib/distutils/spawn.py, line 138, in 
_spawn_posix
% (cmd[0], exit_status))
distutils.errors.DistutilsExecError: command 'gcc' failed with exit status 1

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File /home/antoine/cpython/default/Lib/test/test_embed.py, line 42, in 
test_subinterps
exe = self.make_exe(embed1.c)
  File /home/antoine/cpython/default/Lib/test/test_embed.py, line 29, in 
make_exe
compiler.compile([srcpath], output_dir=build_dir)
  File /home/antoine/cpython/default/Lib/distutils/ccompiler.py, line 576, in 
compile
self._compile(obj, src, ext, cc_args, extra_postargs, pp_opts)
  File /home/antoine/cpython/default/Lib/distutils/unixccompiler.py, line 
178, in _compile
raise CompileError(msg)
distutils.errors.CompileError: command 'gcc' failed with exit status 1

--
assignee: tarek
components: Distutils
messages: 131352
nosy: eric.araujo, pitrou, tarek
priority: normal
severity: normal
stage: needs patch
status: open
title: Useless error message when distutils fails compiling
type: behavior
versions: Python 2.7, Python 3.1, Python 3.2, Python 3.3

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



[issue11597] Can't get ConfigParser.write to write unicode strings

2011-03-18 Thread Raymond Hettinger

Raymond Hettinger raymond.hettin...@gmail.com added the comment:

It's also a question of adding a feature to a point release.  If dev's relied 
on the new feature, they would also have to test for version  2.7.1.  We 
usually try to avoid that (after a minor fiasco with booleans many years ago).

--

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



[issue11600] PY_CFLAGS and PY_CPPFLAGS inconsistent

2011-03-18 Thread Antoine Pitrou

New submission from Antoine Pitrou pit...@free.fr:

One contains the include dirs for Python, not the other:

 distutils.sysconfig.get_config_var('PY_CFLAGS')
'-g -O0 -Wall -Wstrict-prototypes'
 distutils.sysconfig.get_config_var('PY_CPPFLAGS')
'-I. -IInclude -I./Include'

In Python 2.7 and 3.1, PY_CFLAGS did contain the include dirs, so this seems to 
be a regression:

 distutils.sysconfig.get_config_var('PY_CFLAGS')
'-g -O2 -g -Wall -Wstrict-prototypes -I. -IInclude -I./Include  -DPy_BUILD_CORE'

--
assignee: tarek
components: Distutils
messages: 131354
nosy: eric.araujo, pitrou, tarek
priority: high
severity: normal
stage: needs patch
status: open
title: PY_CFLAGS and PY_CPPFLAGS inconsistent
type: behavior
versions: Python 3.2, Python 3.3

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



[issue11601] UnixCCompiler always uses compiler_so, not compiler

2011-03-18 Thread Antoine Pitrou

New submission from Antoine Pitrou pit...@free.fr:

UnixCCompiler always uses compiler_so, not compiler, even when creating a 
.o file. It is misleading and begs the question why compiler even exists.

--
assignee: tarek
components: Distutils
messages: 131355
nosy: eric.araujo, pitrou, tarek
priority: normal
severity: normal
stage: needs patch
status: open
title: UnixCCompiler always uses compiler_so, not compiler
type: behavior
versions: Python 3.2, Python 3.3

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



[issue4114] struct returns incorrect 4 byte float

2011-03-18 Thread Robert Withrow

Robert Withrow bigbaaad...@gmail.com added the comment:

For completeness: msg131234 states that the issue of 64 bit - 32 bit precision 
truncation is covered in the floating point tutorial.  I believe that is 
incorrect; at least I can't find it explicitly mentioned. Ref: 
http://docs.python.org/tutorial/floatingpoint.html.

If struct is the only place this (64-32 bit precision truncation) can happen 
in Python, the lack of discussion in the tutorial makes sense.  Otherwise, a 
sentence about it should be added to the tutorial.

As it is, there is no _explicit_ mention of this anywhere in Python 
documentation.  It is all well and good to state that it is obvious, but it 
seems that explicit documentation is preferable to implicit documentation, 
given the rarity of the issue in Python and the meager cost of adding a 
sentence here or there.

Incidentally, it is simple to create the truncation routine I mention earlier:

 def fptrunc(value):
...   return unpack('!f', pack('!f', value))[0]
... 
 fptrunc(6.24)
6.237711181641
 fptrunc(6.25)
6.25

But this has the questionable smell of using pack/unpack in a test of 
pack/unpack.  It's sorta OK for _users_ of pack/unpack though.

A quick scan of the Python source code shows that only two things try to pack 4 
byte floats: struct and ctypes and both of these use the underlying Python 
float object routines.  So a better way of doing the truncation is to use 
ctypes:

 def fptrunc(value):
...   return c_float(value).value
... 
 fptrunc(6.24)
6.237711181641
 fptrunc(6.25)
6.25

Doing this allows you to write tests that work for any number and don't require 
the use of magic numbers or knowledge of the underlying floating point 
implementation.

Even if nothing gets put into the documentation, people will probably find this 
discussion by Googling.

I can't imagine there is much more that can be said about this, so I'll leave 
you guys alone now...  ;-)

--

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



[issue11602] python-config code should be in sysconfig

2011-03-18 Thread Antoine Pitrou

New submission from Antoine Pitrou pit...@free.fr:

python-config has the following non-trivial code for discovery of 
cflags/ldflags, which should be callable as a sysconfig API instead:

elif opt in ('--includes', '--cflags'):
flags = ['-I' + sysconfig.get_path('include'),
 '-I' + sysconfig.get_path('platinclude')]
if opt == '--cflags':
flags.extend(getvar('CFLAGS').split())
print(' '.join(flags))

elif opt in ('--libs', '--ldflags'):
libs = getvar('LIBS').split() + getvar('SYSLIBS').split()
libs.append('-lpython' + pyver + sys.abiflags)
# add the prefix/lib/pythonX.Y/config dir, but only if there is no
# shared library in prefix/lib/.
if opt == '--ldflags':
if not getvar('Py_ENABLE_SHARED'):
libs.insert(0, '-L' + getvar('LIBPL'))
libs.extend(getvar('LINKFORSHARED').split())
print(' '.join(libs))


Also, it begs the question why distutils doesn't use the same code in its 
compiler class, or even in customize_compiler()...

--
assignee: tarek
components: Distutils
messages: 131357
nosy: eric.araujo, pitrou, tarek
priority: normal
severity: normal
stage: needs patch
status: open
title: python-config code should be in sysconfig
type: behavior
versions: Python 3.2, Python 3.3

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



[issue11602] python-config code should be in sysconfig

2011-03-18 Thread Raymond Hettinger

Raymond Hettinger raymond.hettin...@gmail.com added the comment:

+1

--
nosy: +rhettinger

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



[issue11589] Additional tests for email module

2011-03-18 Thread R. David Murray

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

Until unittest learns to do parameterized tests, it's nice to have each test be 
separate so that you can easily see which test cases are failing.  (A number of 
the existing email tests have a lot of tests in each unit test, and this can 
make debugging more difficult, as I know well.)

I've been known to synthesize parameterized tests in my unit tests to save 
myself some typing, but Michael has already done the typing here...

--

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



[issue10914] Python sub-interpreter test

2011-03-18 Thread Antoine Pitrou

Antoine Pitrou pit...@free.fr added the comment:

Ok, this is what I came up with to build an exe using distutils. At this point, 
the complication is downright silly and it doesn't even work under Windows, so 
we may prefer to go down the Makefile route instead.

--
Added file: http://bugs.python.org/file21282/embedtest-distutils.patch

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



[issue11579] python 2.5 does not build from hg - looks for subversion keywords

2011-03-18 Thread R. David Murray

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

I understand what you are saying, and I thought about that, too; but
you could say the same thing about any bug fix that makes code work that didn't 
work before, yet we don't.  So I guess you are right that it should be 
discussed on python-dev.

--

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



[issue11579] python 2.5 does not build from hg - looks for subversion keywords

2011-03-18 Thread R. David Murray

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


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

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



[issue11597] Can't get ConfigParser.write to write unicode strings

2011-03-18 Thread R. David Murray

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

I understand what you are saying, and I thought about that, too; but you could 
say the same thing about any bug fix that makes code work that didn't work 
before, yet we don't.  So I guess you are right that it should be discussed on 
python-dev.

--

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



[issue11597] Can't get ConfigParser.write to write unicode strings

2011-03-18 Thread Georg Brandl

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

My vote would be that this is a new feature and therefore uneligible for 2.x.

--
nosy: +georg.brandl

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



[issue11603] Python crashes or hangs when rebinding __repr__ as __str__

2011-03-18 Thread Carl Banks

New submission from Carl Banks pythond...@aerojockey.com:

The issue was raised by J Peyret on the following c.l.python thread:

http://groups.google.com/group/comp.lang.python/browse_frm/thread/459e5ec433e7dcab?hl=en#

Several posters reported that the following code either hangs or crashes Python 
(versions 2.7, 2.6, and 3.2, on Windows and Linux) were tested:

-
class Foo(object):
pass

Foo.__repr__ = Foo.__str__

foo = Foo()
print(str(foo))
-

--
components: Interpreter Core
messages: 131364
nosy: aerojockey
priority: normal
severity: normal
status: open
title: Python crashes or hangs when rebinding __repr__ as __str__
type: crash
versions: Python 2.6, Python 2.7, Python 3.2

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



[issue11476] StreamHandler code broken by change of parameter name

2011-03-18 Thread Éric Araujo

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

Is it okay to change a public parameter name without deprecation process?

--
nosy: +eric.araujo

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



[issue11603] Python crashes or hangs when rebinding __repr__ as __str__

2011-03-18 Thread Andreas Stührk

Andreas Stührk andy-pyt...@hammerhartes.de added the comment:

Confirmed under 3.2 and 2.7. The attached patch should fix the issue.

--
keywords: +patch
nosy: +Trundle
Added file: http://bugs.python.org/file21283/issue_11603.patch

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



[issue11598] missing afxres.h error when building bdist_wininst in Visual Studio 2008 Express

2011-03-18 Thread Lorenz

Lorenz pyt...@xca.ch added the comment:

replace the afxres.h by the following lines and then it builds:

#include windows.h

#ifndef IDC_STATIC
#define IDC_STATIC (-1)
#endif

but the problem is, that the 'install.rc' file is generated. Unfortunately I do 
not know how to solve the root cause.

--
nosy: +DaMutz

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



[issue1559549] ImportError needs attributes for module and file name

2011-03-18 Thread Filip Gruszczyński

Changes by Filip Gruszczyński grusz...@gmail.com:


Removed file: http://bugs.python.org/file21020/1559549_1.patch

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



[issue1559549] ImportError needs attributes for module and file name

2011-03-18 Thread Filip Gruszczyński

Changes by Filip Gruszczyński grusz...@gmail.com:


Removed file: http://bugs.python.org/file21031/1559549_2.patch

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



[issue1559549] ImportError needs attributes for module and file name

2011-03-18 Thread Filip Gruszczyński

Filip Gruszczyński grusz...@gmail.com added the comment:

Ok, here is a patch created using mq. I have a problem, however. I managed to 
solve following situation:

try:
raise ImportError('failed import' module_name='somemodule')
except ImportError as e:
print(e.module_name)

that would print somemodule.

However, I can't pass kwargs to ImportError_init from load_next. If someone 
could instruct me, how this can be achieved, I'll be happy to do that.

--
Added file: http://bugs.python.org/file21284/1559549_3.patch

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



[issue10050] urllib.request still has old 2.x urllib primitives

2011-03-18 Thread Jeff McNeil

Jeff McNeil j...@jmcneil.net added the comment:

Alright, attaching a patch that reworks urlretrieve to use urlopen internal to 
urllib.request.  

1. I dropped the local caching as it isn't turned on by default anyway (and 
isn't really documented).

2. Updated documentation to reflect caching changes  make urlretrieve part of 
the official API again.

3. Kept the urlcleanup function, but use a global list to track temporary 
files.  I'd be happy to change this functionality if that makes sense.

4. After moving the urlretrieve stuff out of test_urllibnet, I realized that 
file didn't serve much of a purpose any longer, so I just removed it. 

5. Updated NEWS.

I'd be happy to rework any of this in order to bring it up to stuff. Comments 
and suggestions are very much welcomed.

--
keywords: +patch
Added file: http://bugs.python.org/file21285/issue10050.patch

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



[issue11476] StreamHandler code broken by change of parameter name

2011-03-18 Thread Vinay Sajip

Vinay Sajip vinay_sa...@yahoo.co.uk added the comment:

It's a formal parameter name, in general passed by position rather than 
keyword. Anyway, it seems a bit late to change it back now.

--

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



[issue10050] urllib.request still has old 2.x urllib primitives

2011-03-18 Thread Éric Araujo

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

Follow the “review” link next to the patch for an initial review.

--

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



[issue11476] StreamHandler code broken by change of parameter name

2011-03-18 Thread follower

follower bugs.python@rancidbacon.com added the comment:

I don't think it would be unreasonable to add the old name back in temporarily 
and use whichever parameter is supplied--this change has obviously broken code 
in the process.

But for future situations I think changes like this shouldn't happen
without a deprecation process.

--

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



[issue11594] 2to3 tool does not preserve line-endings

2011-03-18 Thread Benjamin Peterson

Changes by Benjamin Peterson benja...@python.org:


--
assignee:  - benjamin.peterson

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



[issue10050] urllib.request still has old 2.x urllib primitives

2011-03-18 Thread Senthil Kumaran

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

Significant patch. Thanks. I looked at the review too. For the
Context Manager part, don't club it along with this one. We need to
test this thoroughly, after this is in shape, that can be addressed.

--

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



[issue11603] Python crashes or hangs when rebinding __repr__ as __str__

2011-03-18 Thread Terry J. Reedy

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

With 3.2 on WinXP, I get no error report in interactive mode,
with either IDLE or plain interpreter, nor from 'python file' in Command Prompt 
window. But now with the print added to what I ran before, I see no print 
output, and I see that IDLE is restarting after executing the code, so 
something *is* wrong. Further experiments with other print statements in 
various places show that 'str(foo)' is the specific culprit.

Appears to act same on 3.1 for me.

Patch is to this code (from 3.2, presume same otherwise):
==
static PyObject *
object_str(PyObject *self) 
{
unaryfunc f;

f = Py_TYPE(self)-tp_repr;
if (f == NULL)
f = object_repr;
return f(self);
}
=
Patch prevent infinite recursion if f == object_str.
Whether or not this fixes issue ('should' is a bit vague, confirmation is 
needed) this seems like a good idea.

To be applied, patch should have a new testcase that fails without the patch 
and passes with it applied.

def test_NoCrashIfStrIsRepr(self)
  'see issue 11603'
  class Foo(object): # delete object for 3.x
pass
  Foo.__repr__ = Foo.__str__
  foo = Foo()
  s = str(foo)

would be a start. I so not know if any AssertX is needed since just finishing 
would be a success. However, I also do not know where to put it as there is no 
test_object or test_typeobject file that I see.

--
nosy: +barry, terry.reedy
stage:  - test needed
versions: +Python 3.1, Python 3.3

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



[issue10050] urllib.request still has old 2.x urllib primitives

2011-03-18 Thread Jeff McNeil

Jeff McNeil j...@jmcneil.net added the comment:

Made recommended changes. Moved to NamedTemporaryFile. I don't think the 
spooled file makes sense here as the existing protocol provides a filename in 
the returned tuple, not a f.l.o. 

As far as the description?  Here are a couple suggestions:

1. URL Retrieval Library
2. URL Access Module

Updated the module documentation as well as the howto.

--
Added file: http://bugs.python.org/file21286/issue10050.patch

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



[issue10050] urllib.request still has old 2.x urllib primitives

2011-03-18 Thread Senthil Kumaran

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

Changing the description is a minor update. The term 'URL access module' seems 
fine.

--

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



[issue7391] Re-title the Using Backslash to Continue Statements anti-idiom

2011-03-18 Thread Roundup Robot

Roundup Robot devnull@devnull added the comment:

New changeset 80ff78425419 by Raymond Hettinger in branch '3.2':
Issue 7391: Remove questionable and outdated HOWTO document with permission 
from its author.
http://hg.python.org/cpython/rev/80ff78425419

--

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



[issue11071] What's New review comments

2011-03-18 Thread Raymond Hettinger

Raymond Hettinger raymond.hettin...@gmail.com added the comment:

It seems no new issues have arisen.
If something new comes-up, feel free to re-open.

--
resolution:  - fixed
status: open - closed

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



[issue10042] total_ordering stack overflow

2011-03-18 Thread Raymond Hettinger

Raymond Hettinger raymond.hettin...@gmail.com added the comment:

Éric, would you like to apply this to 2.7?

--
assignee: rhettinger - eric.araujo

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



[issue10050] urllib.request still has old 2.x urllib primitives

2011-03-18 Thread Jeff McNeil

Jeff McNeil j...@jmcneil.net added the comment:

Made requested change to Synopsis/Description.

--
Added file: http://bugs.python.org/file21287/issue10050.patch

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



[issue11604] Have type(n,b,d) check for type(b[i]) is module

2011-03-18 Thread Terry J. Reedy

New submission from Terry J. Reedy tjre...@udel.edu:

People occasionally ask on python-list about the following error message when 
trying to create a class:

 TypeError: Error when calling the metaclass bases
 module.__init__() takes at most 2 arguments (3 given)

It is a bit cryptic. It is also accidental: if module.__init__ happened to take 
3 args instead of 2, the exception would be delayed until ???

The cause is using a module as a superclass, as in

import UserDict
class MyDict(UserDict): pass

This seems to happen mostly because of duplicate (or only case-different) 
module/class names.
 
Suggestion: insert a specific module type check for bases in type_new() in 
typeobject.c. In Python:
  if basetype is module: # where 'module' is the module class
raise TypeError('Cannot subclass module')

I see 2 possible places to put the check:

1. for all bases - after
tmp = PyTuple_GET_ITEM(bases, i);
tmptype = Py_TYPE(tmp);

Advantage: can add (name of) tmp to the error message.

2. Before the return call in
if (winner != metatype) {
if (winner-tp_new != type_new) /* Pass it to the winner */
return winner-tp_new(winner, args, kwds);

Advantage: only add extra check when module is the winner and are about to call 
it as a metaclass, which raises the current error.

Any test would be CPython specific and would require checking something about 
the message text.

I am only suggesting a check for module because the is the only mistake I 
remember anyone reporting. Passing a number as a base class gives a similar 
message, but no one does that. And as far as I know, there is no way in general 
to detect whether a callable works as a metaclass except by calling it with 
name, bases, and dict.

--
components: Interpreter Core
messages: 131381
nosy: terry.reedy
priority: normal
severity: normal
stage: test needed
status: open
title: Have type(n,b,d) check for type(b[i]) is module
type: feature request
versions: Python 3.3

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



[issue9516] sysconfig: $MACOSX_DEPLOYMENT_TARGET mismatch: now 10.3 but 10.5 during configure

2011-03-18 Thread Éric Araujo

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


--
nosy: +eric.araujo
title: sysconfig: $MACOSX_DEPLOYMENT_TARGET mismatch: now 10.3but 
10.5 during configure - sysconfig: $MACOSX_DEPLOYMENT_TARGET mismatch: now 
10.3 but 10.5 during configure

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



[issue11376] Solaris/GCC/shared lib problem

2011-03-18 Thread Éric Araujo

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

Thanks for the report.  What’s the exact command-line you run?  In your 
message, it looks like you run the pycc command which then outputs the gcc 
error.

--

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



[issue9313] distutils error on MSVC older than 8

2011-03-18 Thread Éric Araujo

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

Martin: Just applying the same changes to distutils2.

--

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



[issue11370] Fix distutils to carry configure's LIBS through to extension modules.

2011-03-18 Thread Éric Araujo

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

Thanks for the report and patch.  Has this bug been a problem for existing 
projects?  Would you have links?

 Looks like this should've been done against the py3k branch instead.
Yes, patches should apply to the py3k branch, or to distutils2.  More 
guidelines at http://wiki.python.org/moin/Distutils/FixingBugs

In this case, Tarek will have to decide whether this is a suitable bugfix for 
distutils or whether it’s for distutils2 only.  There is a feature freeze in 
distutils, so we try to change the code only to fix proved bugs, in the less 
pervasive way possible, and with regression tests.

 Perhaps there is a better way to do this under py3k?  Or it's handled already?
In the absence of a test (unit test, instructions to reproduce or script), it’s 
hard to tell.

--

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



[issue9410] Add Unladen Swallow's optimizations to Python 3's pickle.

2011-03-18 Thread Jesús Cea Avión

Changes by Jesús Cea Avión j...@jcea.es:


--
nosy: +jcea

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



[issue3873] Unpickling is really slow

2011-03-18 Thread Jesús Cea Avión

Changes by Jesús Cea Avión j...@jcea.es:


--
nosy: +jcea

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



[issue10042] total_ordering stack overflow

2011-03-18 Thread Roundup Robot

Roundup Robot devnull@devnull added the comment:

New changeset 94c158199277 by Éric Araujo in branch '2.7':
Fix the total_ordering decorator to handle cross-type comparisons
http://hg.python.org/cpython/rev/94c158199277

--
nosy: +python-dev
stage:  - committed/rejected
status: open - closed

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



[issue11397] os.path.realpath() may produce incorrect results

2011-03-18 Thread Terry J. Reedy

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

2.5 and 2.6 are only open for security issues.
I am guessing that 2.7, 3.1, and 3.3 are affected.
I cannot test as I only have Windows currently.

--
nosy: +terry.reedy
stage:  - test needed
versions: +Python 2.7, Python 3.1, Python 3.3 -Python 2.5, Python 2.6

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



[issue11412] Section numbers in the Library Reference have a trailing period

2011-03-18 Thread Terry J. Reedy

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

My haphazard sample gave 8 without, 5 with.

I suspect trailing dot is analogy with lists:
1. something.
2. something else.
2.1. detail of else
2.2. more detail

Books without generally have extra space instead of '.'.

--
nosy: +terry.reedy

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



[issue11415] ZipFile don't overwrite compresed files at create

2011-03-18 Thread Terry J. Reedy

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

2.6 is only open for security fixes.

--
nosy: +terry.reedy
resolution:  - invalid
status: open - closed
superseder:  - remove/delete method for zipfile/tarfile objects
versions:  -Python 2.6

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



[issue11418] Method's global scope is module containing function definition, not class.

2011-03-18 Thread Terry J. Reedy

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

Methods defined within a class may reference...
would make the tutorial correct without introducing the complication of methods 
defined outside a class, let alone in another module.

--
nosy: +terry.reedy

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



[issue11432] webbrowser.open on unix fails.

2011-03-18 Thread Terry J. Reedy

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

With fix, test, and news in 3.2 and 3.3, is anything left to do?

--
nosy: +terry.reedy

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



[issue11462] Peephole creates duplicate and unused constants

2011-03-18 Thread Terry J. Reedy

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

Eugene has started work on AST optimizer in #11549

--
nosy: +terry.reedy
superseder:  - Rewrite peephole to work on AST

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



[issue11549] Rewrite peephole to work on AST

2011-03-18 Thread Terry J. Reedy

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

A couple of somewhat related issues:
#10399 AST Optimization: inlining of function calls
#1346238 A constant folding optimization pass for the AST
Obviously, ast optimizers should work together and not duplicate.
Nice to see increased attention.

--
nosy: +terry.reedy

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



[issue1346238] A constant folding optimization pass for the AST

2011-03-18 Thread Terry J. Reedy

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

#11549 Rewrite peephole to work on AST
includes constant folding. I have not compared.

--
nosy: +terry.reedy
versions: +Python 3.3 -Python 3.2

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



[issue11463] IncompleteRead: IncompleteRead(168 bytes read)

2011-03-18 Thread Terry J. Reedy

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

2.6 is only open for security issues, so any verification should use later 
version.

--
nosy: +terry.reedy
status: pending - open
versions:  -Python 2.6

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



[issue11463] IncompleteRead: IncompleteRead(168 bytes read)

2011-03-18 Thread Terry J. Reedy

Changes by Terry J. Reedy tjre...@udel.edu:


--
status: open - pending

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



[issue11465] Set documentation: Link to wikipedia

2011-03-18 Thread Terry J. Reedy

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

There is no end of helpful articles at Wikipedia and elsewhere. Wikipedia 
articles are especially easy to find with a special search in some browsers and 
on the site. In my experience on python-list, for instance, people have much 
more problem with floats, for instance, than sets. Certainly, sets are taught 
much better in U.S. schools.

--
nosy: +terry.reedy
resolution:  - wont fix
status: open - closed

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