You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Ben Collins-Sussman <su...@collab.net> on 2001/05/08 22:46:12 UTC
Re: Fix the current test suite
Sam TH <sa...@uchicago.edu> writes:
> Attached is a minor patch to get local_tests.py to work properly. I'm
> not sure if it's the right fix, though. Ben, what do you think?
Was it broken for you? What I checked in "works for me" on Python
2.0 (FreeBSD 4.2). :)
> +import sys
...
> - exit(1)
> + sys.exit(1)
Is the "sys" module not automatically loaded in all Python
distributions? To be safe, must we always explicitly import it?
(gstein?)
> # Create a tree by scanning the working copy
> - mytree = svn_tree.build_tree_from_wc (wc_dir_name)
> + mytree = svn_tree.build_tree_from_wc (os.path.join(wc_dir_name, "greekfiles"))
> +
Ahhhh. These changes, plus the patches below, indicate to me that
you're not using the latest libsvn_client, Sam. When
guarantee_greek_repository() runs 'svn import', the "greekfiles"
directory should *not* be added to the repository's root dir anymore.
Do a make clean && make, and try again.
>
> - wc_dir = os.path.join (general_wc_dir, 'basic-status')
> + wc_dir = os.path.join (general_wc_dir, 'basic-status/greekfiles')
...
> - wc_dir = os.path.join (general_wc_dir, 'basic-commit')
> + wc_dir = os.path.join (general_wc_dir, 'basic-commit/greekfiles')
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: Fix the current test suite
Posted by Greg Stein <gs...@lyra.org>.
On Tue, May 08, 2001 at 05:46:12PM -0500, Ben Collins-Sussman wrote:
>...
> > +import sys
> ...
> > - exit(1)
> > + sys.exit(1)
>
> Is the "sys" module not automatically loaded in all Python
> distributions? To be safe, must we always explicitly import it?
> (gstein?)
Python never monkeys with your namespace behind your back. If you want a
name in your namespace, then you must put it there. Thus, you need to do the
"import sys" to make the "sys" available.
[ yes, the module was probably loaded by something else, but that doesn't
magically create names in random namespaces (such as that of your script) ]
In general, Python takes great care with not polluting namespaces. That is
why the form:
from some_module import *
Is so frowned upon. Who knows what names will be created in your namespace?
"Proper" style is to just do "import some_module" and then refer to the
various symbols using "some_module.some_name".
As an anology, in C/C++, doing #include <header.h> will inject all kinds of
symbols into your namespace. This is why we have the SVN_ and svn_ prefixes
-- it's a way to prevent conflicts. In Python, we'd be using the module
namespaces for protection.
Cheers,
-g
--
Greg Stein, http://www.lyra.org/
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: Fix the current test suite
Posted by Tripp Lilley <tl...@perspex.com>.
On Wed, 9 May 2001, Sam TH wrote:
> But isn't there some stuff that gets loaded only for the
> read-eval-print interpreter? I thought there was a flag for that.
Yeah, it loads whatever's referred to by PYTHONSTARTUP, but that's for
user customization, not really for Python to customize itself. You're
right, though. It is a little silly putting that interactive-ism into the
namespace of random scripts :)
--
Tripp Lilley * http://stargate.eheart.sg505.net/~tlilley/
--------------------------------------------------------------------------
"If people would stop behaving like greedy idiots, I'd be sweetness
and light every fucking day." - Dave Winer, Scripting News, 2001-04-11
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: Fix the current test suite
Posted by Sam TH <sa...@uchicago.edu>.
On Wed, May 09, 2001 at 09:31:01AM +0000, Tripp Lilley wrote:
> On Wed, 9 May 2001, Sam TH wrote:
>
> > Seriously, is there any justification for having that in the global
> > namespace?
>
> [tlilley@charmin WebKit]$ python
> Python 2.0 (#1, Oct 16 2000, 18:10:03)
> [GCC 2.95.2 19991024 (release)] on linux2
> Type "copyright", "credits" or "license" for more information.
> >>> exit
> 'Use Ctrl-D (i.e. EOF) to exit.'
> >>>
Ah.
But isn't there some stuff that gets loaded only for the
read-eval-print interpreter? I thought there was a flag for that.
sam th --- sam@uchicago.edu --- http://www.abisource.com/~sam/
OpenPGP Key: CABD33FC --- http://samth.dyndns.org/key
DeCSS: http://samth.dynds.org/decss
Re: Fix the current test suite
Posted by Greg Stein <gs...@lyra.org>.
*bing*
On Wed, May 09, 2001 at 09:31:01AM +0000, Tripp Lilley wrote:
> On Wed, 9 May 2001, Sam TH wrote:
>
> > Seriously, is there any justification for having that in the global
> > namespace?
>
> [tlilley@charmin WebKit]$ python
> Python 2.0 (#1, Oct 16 2000, 18:10:03)
> [GCC 2.95.2 19991024 (release)] on linux2
> Type "copyright", "credits" or "license" for more information.
> >>> exit
> 'Use Ctrl-D (i.e. EOF) to exit.'
> >>>
>
>
> --
> Tripp Lilley * http://stargate.eheart.sg505.net/~tlilley/
> --------------------------------------------------------------------------
> "If people would stop behaving like greedy idiots, I'd be sweetness
> and light every fucking day." - Dave Winer, Scripting News, 2001-04-11
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
> For additional commands, e-mail: dev-help@subversion.tigris.org
--
Greg Stein, http://www.lyra.org/
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: Fix the current test suite
Posted by Tripp Lilley <tl...@perspex.com>.
On Wed, 9 May 2001, Sam TH wrote:
> Seriously, is there any justification for having that in the global
> namespace?
[tlilley@charmin WebKit]$ python
Python 2.0 (#1, Oct 16 2000, 18:10:03)
[GCC 2.95.2 19991024 (release)] on linux2
Type "copyright", "credits" or "license" for more information.
>>> exit
'Use Ctrl-D (i.e. EOF) to exit.'
>>>
--
Tripp Lilley * http://stargate.eheart.sg505.net/~tlilley/
--------------------------------------------------------------------------
"If people would stop behaving like greedy idiots, I'd be sweetness
and light every fucking day." - Dave Winer, Scripting News, 2001-04-11
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: Fix the current test suite
Posted by Sam TH <sa...@uchicago.edu>.
On Wed, May 09, 2001 at 02:11:55AM -0700, Greg Stein wrote:
> On Wed, May 09, 2001 at 03:38:39AM -0500, Sam TH wrote:
> > On Tue, May 08, 2001 at 05:46:12PM -0500, Ben Collins-Sussman wrote:
> > > Sam TH <sa...@uchicago.edu> writes:
> > > > +import sys
> > > ...
> > > > - exit(1)
> > > > + sys.exit(1)
> > >
> > > Is the "sys" module not automatically loaded in all Python
> > > distributions? To be safe, must we always explicitly import it?
> > > (gstein?)
> >
> > Yup. Weird that it got automatically imported for you.
>
> Nothing got imported for him. He just never executed the exit(1) code. That
> would have thrown an error if he had.
>
> (exit is a builtin; somewhat bogus value, but there nonetheless)
>
> exit == 'Use Ctrl-D (i.e. EOF) to exit.'
Ah, that explains that error message. That has to have been the
weirdest error message python ever gave me. Now I know.
Seriously, is there any justification for having that in the global
namespace?
sam th --- sam@uchicago.edu --- http://www.abisource.com/~sam/
OpenPGP Key: CABD33FC --- http://samth.dyndns.org/key
DeCSS: http://samth.dynds.org/decss
Re: Fix the current test suite
Posted by Greg Stein <gs...@lyra.org>.
On Wed, May 09, 2001 at 03:38:39AM -0500, Sam TH wrote:
> On Tue, May 08, 2001 at 05:46:12PM -0500, Ben Collins-Sussman wrote:
> > Sam TH <sa...@uchicago.edu> writes:
> > > +import sys
> > ...
> > > - exit(1)
> > > + sys.exit(1)
> >
> > Is the "sys" module not automatically loaded in all Python
> > distributions? To be safe, must we always explicitly import it?
> > (gstein?)
>
> Yup. Weird that it got automatically imported for you.
Nothing got imported for him. He just never executed the exit(1) code. That
would have thrown an error if he had.
(exit is a builtin; somewhat bogus value, but there nonetheless)
exit == 'Use Ctrl-D (i.e. EOF) to exit.'
Cheers,
-g
--
Greg Stein, http://www.lyra.org/
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: Fix the current test suite
Posted by Sam TH <sa...@uchicago.edu>.
On Tue, May 08, 2001 at 05:46:12PM -0500, Ben Collins-Sussman wrote:
> Sam TH <sa...@uchicago.edu> writes:
> > +import sys
> ...
> > - exit(1)
> > + sys.exit(1)
>
> Is the "sys" module not automatically loaded in all Python
> distributions? To be safe, must we always explicitly import it?
> (gstein?)
Yup. Weird that it got automatically imported for you.
>
>
> > # Create a tree by scanning the working copy
> > - mytree = svn_tree.build_tree_from_wc (wc_dir_name)
> > + mytree = svn_tree.build_tree_from_wc (os.path.join(wc_dir_name, "greekfiles"))
> > +
>
> Ahhhh. These changes, plus the patches below, indicate to me that
> you're not using the latest libsvn_client, Sam. When
> guarantee_greek_repository() runs 'svn import', the "greekfiles"
> directory should *not* be added to the repository's root dir anymore.
> Do a make clean && make, and try again.
>
Yeah, that was the problem. Sorry. Forget those patches.
sam th --- sam@uchicago.edu --- http://www.abisource.com/~sam/
OpenPGP Key: CABD33FC --- http://samth.dyndns.org/key
DeCSS: http://samth.dynds.org/decss