[issue6862] exec(), locals() and local variable access

2009-09-08 Thread john zeng
New submission from john zeng o...@163.com: Can you help me understand why variable `u' is not accessible after exec()? Is this sort of a late binding issue? def test(v1): print(v1) print(Before exec(): + str(locals())) exec(v1) print(After exec(): + str(locals())) # This

[issue6862] exec(), locals() and local variable access

2009-09-08 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc amaur...@gmail.com added the comment: When the parser analyzes the test() function, it determines that 'u' in print(u) is a global variable. But exec modifies the local namespace... You could add a u=None near the start of the function, or better, always use a namespace for

[issue1578269] Add os.link() and os.symlink() and os.path.islink() support for Windows

2009-09-08 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc amaur...@gmail.com added the comment: Your patch re-adds the compatibility code with Windows 95 (unicode_file_names, check_gfax...), which has been removed two months ago, see r73603 and r73675. Please remove it! -- nosy: +amaury.forgeotdarc

[issue6804] IDLE: Detect Python files even if name doesn't end in .py

2009-09-08 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc amaur...@gmail.com added the comment: This makes sense, but the code should: - not make the query when the extension is empty - catch the WindowsError raised when the extension is not in the registry. -- nosy: +amaury.forgeotdarc

[issue1578269] Add os.link() and os.symlink() and os.path.islink() support for Windows

2009-09-08 Thread Jason R. Coombs
Jason R. Coombs jar...@jaraco.com added the comment: Indeed. I see that now. I'll track down how that happened and see that we avoid regression. Amaury Forgeot d'Arc amaur...@gmail.com added the comment: Your patch re-adds the compatibility code with Windows 95 (unicode_file_names,

[issue6863] Wrong linker command if CXX set to ccache g++

2009-09-08 Thread Pertti Kellomäki
New submission from Pertti Kellomäki pertti.kellom...@tut.fi: If the compiler command in CXX contains more than one word, e.g. ccache g++, line 256 in distutils/unixccompiler.py only picks the first word as the linker and discards the rest: linker[i] = self.compiler_cxx[i]

[issue6864] IDLE 2.6.1 locks up on Mac OS 10.6

2009-09-08 Thread dpogg1
New submission from dpogg1 dan.po...@gmail.com: IDLE 2.6.1 locks up on Mac OS 10.6 when running using Apple's built-in version of Python (also 2.6.1) when creating a new buffer window or attempting to run/debug an existing file. -- assignee: ronaldoussoren components: IDLE, Macintosh

[issue6864] IDLE 2.6.1 locks up on Mac OS 10.6

2009-09-08 Thread dpogg1
dpogg1 dan.po...@gmail.com added the comment: I can confirm this is the same issue. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6864 ___ ___

[issue6823] time.strftime does unnecessary range check

2009-09-08 Thread Richard Shapiro
Richard Shapiro rashapir...@gmail.com added the comment: Here's a patch to normalize the results of the various system calls which return time information. This was against the source for Python 2.5.1. *** timemodule.cTue Sep 8 10:28:31 2009 ---

[issue4485] fast swap of default Windows python versions

2009-09-08 Thread Matthieu Labbé
Changes by Matthieu Labbé bugs.python@mattlabbe.com: -- nosy: +matthieu.labbe ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4485 ___ ___

[issue1475692] replacing obj.__dict__ with a subclass of dict

2009-09-08 Thread Matthieu Labbé
Changes by Matthieu Labbé bugs.python@mattlabbe.com: -- nosy: +matthieu.labbe versions: +Python 2.4, Python 2.5 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1475692 ___

[issue1475692] replacing obj.__dict__ with a subclass of dict

2009-09-08 Thread Matthieu Labbé
Changes by Matthieu Labbé bugs.python@mattlabbe.com: -- type: feature request - behavior ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1475692 ___

[issue5397] PEP 372: OrderedDict

2009-09-08 Thread Matthieu Labbé
Changes by Matthieu Labbé bugs.python@mattlabbe.com: -- nosy: +matthieu.labbe ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5397 ___ ___

[issue6864] IDLE 2.6.1 locks up on Mac OS 10.6

2009-09-08 Thread Ronald Oussoren
Ronald Oussoren ronaldousso...@mac.com added the comment: If I understand you correctly the same also happens with the current version in subversion. To reproduce: * Start IDLE.app * Open a new window The new window opens, but (1) without a proper titlebar, and (2) this makes it impossible

[issue1475692] replacing obj.__dict__ with a subclass of dict

2009-09-08 Thread R. David Murray
R. David Murray rdmur...@bitdance.com added the comment: 2.5 and 2.4 are in security-fix-only mode, so we don't set them in versions since bugs won't get fixed there. I don't think overridden methods should be called, since that would slow down attribute lookup, which is already a bottleneck in

[issue6239] c_char_p return value returns string, not bytes

2009-09-08 Thread STINNER Victor
STINNER Victor victor.stin...@haypocalc.com added the comment: Commited as svn rev 74664 (py3k) and rev 74665 (release31-maint). @theller: Cool, thanks ;-) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6239

[issue6823] time.strftime does unnecessary range check

2009-09-08 Thread Brett Cannon
Changes by Brett Cannon br...@python.org: -- keywords: +patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6823 ___ ___ Python-bugs-list mailing

[issue6075] Patch for IDLE/OS X to work with Tk-Cocoa

2009-09-08 Thread Ronald Oussoren
Ronald Oussoren ronaldousso...@mac.com added the comment: I'm about to test the patches on a 10.4 system with Tk 8.4 and will report back with the results. These patches might be useful to issue 6864, that issue says IDLE blocks on 10.6 and that problem seems to be fixed in python-trunk +

[issue5621] Add description of special case to Assignment statements section

2009-09-08 Thread John Posner
John Posner jjpos...@optimum.net added the comment: George, here is a patch file for this bug. It modifies file doc/reference/simple_stmts.rst Please let me know if this was the wrong way to submit the patch file. -- keywords: +patch status: pending - open Added file:

[issue6863] Wrong linker command if CXX set to ccache g++

2009-09-08 Thread Pertti Kellomäki
Pertti Kellomäki pertti.kellom...@tut.fi added the comment: This patch seems to solve the problem for me. I think it should also work with the environment variable setting on OS X, but I haven't tested it. -- keywords: +patch Added file:

[issue6071] no longer possible to hash arrays

2009-09-08 Thread Jean-Paul Calderone
Jean-Paul Calderone exar...@divmod.com added the comment: Can this ticket be marked as a release blocker so it's not forgotten about for 2.7? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6071

[issue6865] Refcount error in pwd module

2009-09-08 Thread caglar10ur
New submission from caglar10ur cag...@pardus.org.tr: Fix refcounting problem which causes a segfault for following test code; #include python2.5/Python.h int main(void) { int i; for (i = 0; i 1000; ++i) {

[issue6795] decimal.py: minor issues usability

2009-09-08 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com added the comment: Fixed in r74719 (release26-maint), r74720 (release31-maint). -- resolution: - fixed stage: - committed/rejected status: open - closed versions: +Python 2.6, Python 2.7, Python 3.1, Python 3.2 ___

[issue6857] float().__format__() default alignment

2009-09-08 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com added the comment: I've changed the default alignment for Decimal instances to right-aligned (so that it agrees with floats and ints) in r74723 (trunk), r74725 (py3k), as agreed in the python-dev thread starting at:

[issue6857] float().__format__() default alignment

2009-09-08 Thread Eric Smith
Eric Smith e...@trueblade.com added the comment: Thanks for the decimal work, Mark. I notice that complex is also left aligned, by default. I'll take a look at that. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6857

[issue6163] [HP-UX] ld: Unrecognized argument: +s -Ldir

2009-09-08 Thread Sridhar Ratnakumar
Sridhar Ratnakumar sridh...@activestate.com added the comment: compiler.find(gcc) = 0 or compiler.find(g++) = 0 Why not `(gcc in compiler or g++ in compiler)`? Just curious. -- ___ Python tracker rep...@bugs.python.org

[issue6071] no longer possible to hash arrays

2009-09-08 Thread Georg Brandl
Georg Brandl ge...@python.org added the comment: Can't hurt :) -- nosy: +georg.brandl priority: high - release blocker ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6071 ___

[issue6866] TestLoader.loadTestsFromName does not use suiteClass attribute to create TestSuite instances

2009-09-08 Thread Mark Roddy
Mark Roddy markro...@gmail.com added the comment: The issue appears to be in the other versions mentioned from manual inspection. Also adding another patch as unittest in the trunk has been broken apart into a package with several modules so the original patch will not work there.

[issue6866] TestLoader.loadTestsFromName does not use suiteClass attribute to create TestSuite instances

2009-09-08 Thread R. David Murray
R. David Murray rdmur...@bitdance.com added the comment: I haven't run the tests, but a quick glance at the code makes me think this is still probably an issue in 2.7/3.1. -- assignee: - michael.foord nosy: +michael.foord, r.david.murray priority: - normal stage: - patch review

[issue6866] TestLoader.loadTestsFromName does not use suiteClass attribute to create TestSuite instances

2009-09-08 Thread Mark Roddy
New submission from Mark Roddy markro...@gmail.com: The TestLoader class in unittest.py has an attribute 'suiteClass' that is used to create instances of TestSuite object(s) in the process of loading tests. If it is desired to subclass the TestSuite class then consumers may set this

[issue6822] Error calling .storlines from ftplib

2009-09-08 Thread STINNER Victor
STINNER Victor victor.stin...@haypocalc.com added the comment: Oh yes, FTP.storlines() fails if the file is a text file. Here is a patch. My patch encodes each line with self.encoding, which is latin1 by default. -- keywords: +patch nosy: +haypo Added file:

[issue6822] Error calling .storlines from ftplib

2009-09-08 Thread STINNER Victor
STINNER Victor victor.stin...@haypocalc.com added the comment: @amaury.forgeotdarc: Oops, no, it doesn't. The new patch includes a new test (for the unicode file). -- Added file: http://bugs.python.org/file14867/ftplib-2.patch ___ Python tracker

[issue6822] Error calling .storlines from ftplib

2009-09-08 Thread STINNER Victor
Changes by STINNER Victor victor.stin...@haypocalc.com: Removed file: http://bugs.python.org/file14866/ftplib.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6822 ___

[issue6865] Refcount error in pwd module

2009-09-08 Thread Benjamin Peterson
Benjamin Peterson benja...@python.org added the comment: Fixed in r74727. -- nosy: +benjamin.peterson resolution: - fixed status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6865

[issue6822] Error calling .storlines from ftplib

2009-09-08 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc amaur...@gmail.com added the comment: Does this still pass the test suite? in test_ftplib, storlines() is given a BytesIO object. -- nosy: +amaury.forgeotdarc ___ Python tracker rep...@bugs.python.org

[issue6844] BaseException DeprecationError raises inappropriately

2009-09-08 Thread Jean-Paul Calderone
Jean-Paul Calderone exar...@divmod.com added the comment: Can I add a field to the PyBaseExceptionObject struct? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6844 ___

[issue6867] return value of epoll.register

2009-09-08 Thread shaowei.cui
New submission from shaowei.cui shao...@gmail.com: help(select.epoll) show 'register(fd[, eventmask]) - bool', but it return 'None' actually. I view the source code of selectmodule.c that return None actually. The function pyepoll_internal_ctl(int epfd, int op, PyObject *pfd, unsigned int

[issue6836] Mismatching use of memory APIs

2009-09-08 Thread Tim Peters
Tim Peters tim.pet...@gmail.com added the comment: Right, I /was/ hallucinating about serialno -- good catch. Mysterious little integers still suck, though ;-) If you're going to store it in a byte, then you can #define semi-meaningful letter codes instead; e.g., #define _PYMALLOC_OBJECT_ID

[issue6868] Check errno of epoll_ctrl

2009-09-08 Thread shaowei.cui
New submission from shaowei.cui shao...@gmail.com: in selectmodule.c, I found the code of epoll module 'result = epoll_ctl(epfd, op, fd, ev); if (errno == EBADF) { /* fd already closed */ result = 0; errno = 0; } ' 'man epoll_ctl' show

[issue6844] BaseException DeprecationError raises inappropriately

2009-09-08 Thread Brett Cannon
Brett Cannon br...@python.org added the comment: I had a feeling you were going to ask that. =) I think it's fine, and from what I can tell from PEP 384 it's okay as long as it is in no way publicly exposed. But I have added Martin to the nosy list to make sure I am not messing up the ABI

[issue6163] [HP-UX] ld: Unrecognized argument: +s -Ldir

2009-09-08 Thread Michael Haubenwallner
Michael Haubenwallner michael.haubenwall...@salomon.at added the comment: compiler.find(gcc) = 0 or compiler.find(g++) = 0 Why not `(gcc in compiler or g++ in compiler)`? Just curious. Fine with me too. -- ___ Python tracker