Re: How to get the realpath of a symbolic link?

2009-10-31 Thread Terry Reedy
Peng Yu wrote: I find the following two files that define realpath. But I don't find 'realpath' in os.py. I looked at 'os.py'. But I don't understand how the function realpath is introduced in the name space in os.path. Would you please let me know? gfind . ! -path '*backup*' -name *.py -type

Re: import bug

2009-10-31 Thread Gabriel Genellina
En Sat, 31 Oct 2009 12:12:21 -0300, kj no.em...@please.post escribió: I'm running into an ugly bug, which, IMHO, is really a bug in the design of Python's module import scheme. The basic problem is that the import scheme was not designed in advance. It was a very simple thing at first. Then

Re: list comprehension problem

2009-10-31 Thread Steven D'Aprano
On Sat, 31 Oct 2009 14:12:40 -0400, Terry Reedy wrote: alex23 wrote: Terry Reedy tjre...@udel.edu wrote: alex23 wrote: You're completely wrong. Immutability has nothing to do with identity, ... I'm honestly not getting your point here. Let me try again, a bit differently. I claim

Re: How to import only one module in a package when the package __init__.py has already imports the modules?

2009-10-31 Thread Steven D'Aprano
On Sat, 31 Oct 2009 22:29:12 -0500, Peng Yu wrote: In my question, module A and B exist just for the sake of implementation. Even if I have module A and B, I don't want the user feel the existence of module A and B. I want them feel exact like class A and B are defined in module 'test'

Re: How to import only one module in a package when the package __init__.py has already imports the modules?

2009-10-31 Thread Steven D'Aprano
On Sat, 31 Oct 2009 22:48:10 -0500, Peng Yu wrote: Variables in a function are already private.  How can the names in one function be affected by other functions in the same module? You misunderstood me. If there are multiple functions or classes in a file, when I change variables in a

Re: How to import only one module in a package when the package __init__.py has already imports the modules?

2009-10-31 Thread Steven D'Aprano
On Sat, 31 Oct 2009 22:54:47 -0500, Peng Yu wrote: So python would not be able to accommodate my preference one class/function per file? Of course it does! You can do that RIGHT NOW -- just put one class per file. I.e., I have to use something like 'from spam import spam' or

[issue1628484] Python 2.5 64 bit compile fails on Solaris 10/gcc 4.1.1

2009-10-31 Thread Martin v . Löwis
Martin v. Löwis mar...@v.loewis.de added the comment: Martin, can you please elaborate on this? I never heard of such standards in OSS. MAL already gave the link. From the link: Sometimes package developers are tempted to set user variables such as CFLAGS because it appears to make their job

[issue7244] itertools.zip_longest behaves strangely with an iterable class

2009-10-31 Thread Daniel Urban
New submission from Daniel Urban urban.dani...@gmail.com: I'm trying to write an iterable class, and it behaves strangely with itertools.zip_longest. The following example demonstrates this: class Repeater: # this class is similar to itertools.repeat def __init__(self, o, t): self.o =

[issue7117] Backport py3k float repr to trunk

2009-10-31 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com added the comment: r75979: Deprecate PyOS_ascii_atof and PyOS_ascii_strtod; document PyOS_double_to_string. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7117

[issue7244] itertools.zip_longest behaves strangely with an iterable class

2009-10-31 Thread Hirokazu Yamamoto
Hirokazu Yamamoto ocean-c...@m2.ccsnet.ne.jp added the comment: I saw strange thing with following code + release26-maint/trunk. from itertools import * class Repeater(object): # this class is similar to itertools.repeat def __init__(self, o, t): self.o = o self.t = int(t)

[issue7244] itertools.zip_longest behaves strangely with an iterable class

2009-10-31 Thread Hirokazu Yamamoto
Hirokazu Yamamoto ocean-c...@m2.ccsnet.ne.jp added the comment: I hope an attached patch will fix this issue. (this patch is for trunk) I think PyErr_Clear() is needed to clear StopIteration there. -- keywords: +patch versions: +Python 2.6, Python 2.7, Python 3.2 Added file:

[issue6603] Compilation error if configuref --with-computed-gotos

2009-10-31 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com added the comment: Applied to 2.7, 2.6, 3.2, 3.1 in r75982 through r75985. -- stage: patch review - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6603

[issue7244] itertools.zip_longest behaves strangely with an iterable class

2009-10-31 Thread Georg Brandl
Georg Brandl ge...@python.org added the comment: The patch is incorrect; tp_iternext can raise exceptions other than StopIteration which must be let through. -- assignee: - rhettinger nosy: +georg.brandl, rhettinger ___ Python tracker

[issue7042] test_signal fails on os x 10.6

2009-10-31 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com added the comment: I've fixed test_itimer_virtual and test_itimer_prof to use a timeout instead of an xrange/range(1) loop, in r75986 through r75989. -- status: open - closed ___ Python tracker

[issue3864] 26.rc1: test_signal issue on FreeBSD 6.3

2009-10-31 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com added the comment: I'm hoping (though it's only a faint hope) that the change in r75986 might allow the test suite to run to completion on the FreeBSD buildslave. -- nosy: +mark.dickinson ___ Python tracker

[issue7244] itertools.zip_longest behaves strangely with an iterable class

2009-10-31 Thread Daniel Urban
Daniel Urban urban.dani...@gmail.com added the comment: I saw strange thing with following code + release26-maint/trunk. I tried your code (with the new-style class) with Python 2.6.4 and 2.7a0 (trunk), and both worked fine. I built them with GCC 4.2.4 on Ubuntu 8.04. --

[issue7195] Value error 'path is on drive c: start on drive d:' in os.path.relpath

2009-10-31 Thread Jason R. Coombs
Jason R. Coombs jar...@jaraco.com added the comment: Based on the response, then the documentation is inadequate. I don't want to make a stink about this, but I think the issue is still unresolved. If it would be better to discuss this elsewhere, please advise. The documentation says Return a

[issue7228] %lld for PyErr_Format (Modules/_io/bufferedio.c)

2009-10-31 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com added the comment: Patch to add %lld support to PyString_FromFormat(V). (Against the trunk.) -- keywords: +patch stage: - patch review type: - feature request Added file: http://bugs.python.org/file15240/add_lld_format.patch

[issue7210] Proposed Syntax Checks in Test Suite

2009-10-31 Thread Chuck Rhode
Chuck Rhode crh...@lacusveris.com added the comment: Thanks. -ccr- -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7210 ___ ___ Python-bugs-list

[issue7195] Value error 'path is on drive c: start on drive d:' in os.path.relpath

2009-10-31 Thread Nick Coghlan
Nick Coghlan ncogh...@gmail.com added the comment: The path *returned* is relative to the start point. The target path is figured out normally (i.e. relative to the current directory if an absolute path is not given). In your example, you aren't passing in an absolute Windows path - you give a

[issue7195] Value error 'path is on drive c: start on drive d:' in os.path.relpath

2009-10-31 Thread Jason R. Coombs
Jason R. Coombs jar...@jaraco.com added the comment: The documentation changes I suggested make no mention to Windows pathing quirks. They instead clarify two aspects: 1) cross-platform behavior (how the path is interpreted) and 2) platform-specific implementation of relpath (what Python

[issue7228] %lld for PyErr_Format (Modules/_io/bufferedio.c)

2009-10-31 Thread Hirokazu Yamamoto
Hirokazu Yamamoto ocean-c...@m2.ccsnet.ne.jp added the comment: I tried your patch on windows, your patch worked great. One little thing: I think line 346 of patch can be wrapped with #ifdef HAVE_LONG_LONG. -- ___ Python tracker

[issue7244] itertools.zip_longest behaves strangely with an iterable class

2009-10-31 Thread Georg Brandl
Georg Brandl ge...@python.org added the comment: I tried your code (with the new-style class) with Python 2.6.4 and 2.7a0 (trunk), and both worked fine. I built them with GCC 4.2.4 on Ubuntu 8.04. The problem seems to only show up in debug builds on 2.x, but it is there. --

[issue5972] Failing test_signal.py on Redhat 4.1.2-44

2009-10-31 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com added the comment: I think this failure may now be fixed in svn: see issue #7042. dmauldin, are you in a position to test this on Red Hat with a recent svn checkout? (Either trunk or release26-maint, it doesn't matter which.) --

[issue7244] itertools.zip_longest behaves strangely with an iterable class

2009-10-31 Thread Raymond Hettinger
Raymond Hettinger rhettin...@users.sourceforge.net added the comment: I've got it from here. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7244 ___

[issue7245] better Ctrl-C support in pdb (program can be resumed)

2009-10-31 Thread Ilya Sandler
New submission from Ilya Sandler ilya.sand...@gmail.com: Currently, pressing Ctrl-C in pdb will terminate the program and throw the user into post-mortem debugging. Other debuggers (e.g gdb and pydb) treat Ctrl-C differently: Ctrl-C only stops the program and the user can resume it if needed.

[issue7242] Forking in a thread raises RuntimeError

2009-10-31 Thread Gregory P. Smith
Gregory P. Smith g...@krypto.org added the comment: This only appears to happen on Solaris. What version of Solaris are you using? (i doubt that matters, i expect it happens on all versions) I haven't look closely enough at the code yet, but reinitializing the import lock in the child

[issue7208] Getpass echo's password to screen on 2.6, but not on 2.5 or 3.1

2009-10-31 Thread Gregory P. Smith
Changes by Gregory P. Smith g...@krypto.org: -- assignee: - gregory.p.smith nosy: +gregory.p.smith -gps ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7208 ___

[issue6748] test_debuglevel from test_telnetlib.py fails

2009-10-31 Thread Ezio Melotti
Changes by Ezio Melotti ezio.melo...@gmail.com: -- nosy: +ezio.melotti priority: - normal ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6748 ___

[issue7208] Getpass echo's password to screen on 2.6, but not on 2.5 or 3.1

2009-10-31 Thread Gregory P. Smith
Gregory P. Smith g...@krypto.org added the comment: Peter - can you apply the patch from svn r76000 and test that it works properly on Solaris? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7208

[issue7208] Getpass echo's password to screen on 2.6, but not on 2.5 or 3.1

2009-10-31 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: Regarding your comment in r76000: NOTE: The Python C API calls flockfile() (and unlock) during readline. This may be true in 2.x but not in 3.x. Does it have any security implication? -- ___ Python

[issue6748] test_debuglevel from test_telnetlib.py fails

2009-10-31 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: This failure actually still happens quite regularly (on the buildbots and also on my Mandriva system). Judging from a quick Google search, errno 104 (ECONNRESET) should be treated as a case of EOF (it means the TCP connection was reset using RST

[issue6748] test_debuglevel from test_telnetlib.py fails

2009-10-31 Thread Derk Drukker
Derk Drukker derk.druk...@gmail.com added the comment: This patch fixes the issue. -- keywords: +patch nosy: +drukker Added file: http://bugs.python.org/file15242/issue6748.patch ___ Python tracker rep...@bugs.python.org

[issue6748] test_debuglevel from test_telnetlib.py fails

2009-10-31 Thread Eric Smith
Eric Smith e...@trueblade.com added the comment: I still get 'Connection reset by peer' on OS/X 10.5.8 with this patch (http://bugs.python.org/file15242/issue6748.patch). -- nosy: +eric.smith ___ Python tracker rep...@bugs.python.org

[issue6748] test_debuglevel from test_telnetlib.py fails

2009-10-31 Thread Jack Diederich
Jack Diederich jackd...@gmail.com added the comment: Antoine Pitrou: Besides, the test flow in test_telnetlib really is a mess (setUp and tearDown getting called multiple times, for example), could you clean it up? Yes, I'm working on refactoring the test server and separating out testing that

[issue6896] Intermittent failures in test_mailbox

2009-10-31 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: Looking at the frequent buildbot failures, they always seem to happen in TestMaildir. Therefore, it may have to do with the metadata-updating behaviour of the filesystem (since maildir uses one file per message). Unfortunately, while I tried to

[issue7208] Getpass echo's password to screen on 2.6, but not on 2.5 or 3.1

2009-10-31 Thread Gregory P. Smith
Gregory P. Smith g...@krypto.org added the comment: It might mean that other threads with access to the same file handle could interfere and intercept part of the password entry if they wanted to but thats not too concerning. py3k/Modules/_io/bufferedio.c which is presumably used when input

[issue6748] test_debuglevel from test_telnetlib.py fails

2009-10-31 Thread Derk Drukker
Derk Drukker derk.druk...@gmail.com added the comment: The change in the patch worked for me on py3k on Ubuntu 9.10. It makes sense, though, that it could still fail: conn can get closed too soon. -- ___ Python tracker rep...@bugs.python.org

[issue1006238] cross compile patch

2009-10-31 Thread Garrett Cooper
Garrett Cooper yaneg...@gmail.com added the comment: I'm trying to resolve this issue on: 2.6-releasemaint trunk 3.1-releasemaint py3k first by resolving issues configure.in, but there are a TON of AC_TRY_RUN's, which means that this code cannot be cross-compiled as-is (25 on 2.x -- 27 on

[issue1006238] cross compile patch

2009-10-31 Thread Gregory P. Smith
Gregory P. Smith g...@krypto.org added the comment: Documenting the parameters needed to avoid all AC_TRY_RUNs is a good first step for any that are not obvious how to convert from AC_TRY_RUN into something else. -- ___ Python tracker

[issue6896] Intermittent failures in test_mailbox

2009-10-31 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: Ezio, could you give a try to the following patch? -- keywords: +patch Added file: http://bugs.python.org/file15243/test_mailbox.patch ___ Python tracker rep...@bugs.python.org

[issue6896] Intermittent failures in test_mailbox

2009-10-31 Thread Antoine Pitrou
Changes by Antoine Pitrou pit...@free.fr: -- nosy: +r.david.murray ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6896 ___ ___ Python-bugs-list

[issue6896] Intermittent failures in test_mailbox

2009-10-31 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: Another possible explanation is that the logic for computing Maildir._last_time is wrong. It should be computed before refreshing the internal cache, not after. Here is a patch. -- Added file:

[issue6896] Intermittent failures in test_mailbox

2009-10-31 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: According to testers, both patches fail at addressing the issue. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6896 ___

[issue6896] Intermittent failures in test_mailbox

2009-10-31 Thread Antoine Pitrou
Changes by Antoine Pitrou pit...@free.fr: Removed file: http://bugs.python.org/file15243/test_mailbox.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6896 ___

[issue6896] Intermittent failures in test_mailbox

2009-10-31 Thread Antoine Pitrou
Changes by Antoine Pitrou pit...@free.fr: Removed file: http://bugs.python.org/file15244/test_mailbox2.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6896 ___

[issue7195] Value error 'path is on drive c: start on drive d:' in os.path.relpath

2009-10-31 Thread Nick Coghlan
Nick Coghlan ncogh...@gmail.com added the comment: os.relpath *does* give you a relative path between two directories. The problem you are encountering is that, on Windows, a relative path doesn't even *exist* if the two directories are on different drives (which is exactly what the error

[issue6896] Intermittent failures in test_mailbox

2009-10-31 Thread R. David Murray
R. David Murray rdmur...@bitdance.com added the comment: I hacked mailbox.py so that a _toc refresh is always done and ran the tests in a loop, and did not get a failure in 30+ runs, whereas without that hack I would get failures almost every run. So I think Antoine is on the right track.

[issue7245] better Ctrl-C support in pdb (program can be resumed)

2009-10-31 Thread Raghuram Devarakonda
Raghuram Devarakonda draghu...@gmail.com added the comment: It is better for this functionality to be added in Cmd module as that will benefit all users of that module. Please see bug #1294 which has a patch for this purpose. It would be nice if you can test with that patch and see if pdb works

<    1   2