sys.path after the script

5 views
Skip to first unread message

Sebastien Douche

unread,
Jul 11, 2013, 12:24:40 PM7/11/13
to buildout-d...@googlegroups.com
Hello,
on Buildout 2.2, I installed Buildbot who generate the script ./bin/buildbot:


-----------------------------------------------------------
#!/usr/bin/python

from buildbot.scripts import runner
runner.run()


import sys
sys.path[0:0] = [
'/srv/buildbot/eggs/buildbot-0.8.7p1-py2.7.egg',
'/srv/buildbot/eggs/buildbot_slave-0.8.7-py2.7.egg',
'/srv/buildbot/eggs/sact.buildbot.custom-0.3.0-py2.7.egg',
'/srv/buildbot/eggs/Fabric-1.6.1-py2.7.egg',
'/srv/buildbot/eggs/paramiko-1.10.1-py2.7.egg',
'/srv/buildbot/eggs/setuptools-0.8-py2.7.egg',
'/srv/buildbot/eggs/Twisted-13.0.0-py2.7-linux-x86_64.egg',
'/srv/buildbot/eggs/python_dateutil-1.5-py2.7.egg',
'/srv/buildbot/eggs/sqlalchemy_migrate-0.7.2-py2.7.egg',
'/srv/buildbot/eggs/SQLAlchemy-0.7.10-py2.7-linux-x86_64.egg',
'/srv/buildbot/eggs/Jinja2-2.7-py2.7.egg',
'/srv/buildbot/eggs/pycrypto-2.6-py2.7-linux-x86_64.egg',
'/srv/buildbot/eggs/zope.interface-4.0.5-py2.7-linux-x86_64.egg',
'/srv/buildbot/eggs/Tempita-0.5.1-py2.7.egg',
'/srv/buildbot/eggs/decorator-3.4.0-py2.7.egg',
'/srv/buildbot/eggs/MarkupSafe-0.18-py2.7-linux-x86_64.egg',
]
------------------------------------------------------------------

As you can see, the sys.path is after the import. Missed something or
I fill a bug?



--
Sebastien Douche <sdo...@gmail.com>
Twitter: @sdouche / G+: +sdouche

Jonathan Ballet

unread,
Jul 11, 2013, 12:40:22 PM7/11/13
to buildout-d...@googlegroups.com
I believe this is a bug due to this line [1]. It should be instead:

if not (line.startswith('import') or line.startswith('from')):


Jonathan


[1]: https://github.com/buildout/buildout/blob/master/src/zc/buildout/easy_install.py#L1110

Reinout van Rees

unread,
Jul 11, 2013, 6:08:00 PM7/11/13
to buildout-d...@googlegroups.com, buildout-d...@googlegroups.com
There is already a pull request that fixes it. It just misses a test. I'll try to add a test tomorrow morning so that it can be accepted.


Reinout van Rees
http://reinout.vanrees.org/
(Sent from my iPad, so it is probably short)
> --
> You received this message because you are subscribed to the Google Groups "Buildout Development" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to buildout-develop...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>

Reinout van Rees

unread,
Jul 12, 2013, 5:06:17 AM7/12/13
to buildout-d...@googlegroups.com
On 11-07-13 18:40, Jonathan Ballet wrote:
> I believe this is a bug due to this line [1]. It should be instead:
>
> if not (line.startswith('import') or line.startswith('from')):

The pull request
https://github.com/buildout/buildout/pull/134
has a fix. And also a test, which looks good.

So... it is ready for merging, I'd say


Reinout

--
Reinout van Rees rei...@vanrees.org
http://reinout.vanrees.org/
"Military engineers build missiles. Civil engineers build targets."

Sebastien Douche

unread,
Jul 12, 2013, 12:13:32 PM7/12/13
to buildout-d...@googlegroups.com
On Fri, Jul 12, 2013 at 11:06 AM, Reinout van Rees <rei...@vanrees.org> wrote:
> The pull request
> https://github.com/buildout/buildout/pull/134
> has a fix. And also a test, which looks good.
>
> So... it is ready for merging, I'd say

Thanks Reinout!

Jim Fulton

unread,
Jul 12, 2013, 12:42:42 PM7/12/13
to buildout-d...@googlegroups.com
On Fri, Jul 12, 2013 at 5:06 AM, Reinout van Rees <rei...@vanrees.org> wrote:
> On 11-07-13 18:40, Jonathan Ballet wrote:
>>
>> I believe this is a bug due to this line [1]. It should be instead:
>>
>> if not (line.startswith('import') or line.startswith('from')):
>
>
> The pull request
> https://github.com/buildout/buildout/pull/134
> has a fix. And also a test, which looks good.
>
> So... it is ready for merging, I'd say

Merged.

(You could have merged it. :)

Jim


--
Jim Fulton
http://www.linkedin.com/in/jimfulton

Reinout van Rees

unread,
Jul 12, 2013, 4:03:10 PM7/12/13
to buildout-d...@googlegroups.com
On 12-07-13 18:42, Jim Fulton wrote:
> (You could have merged it.:)

Actually I cannot (I just double-checked).
I wouldn't mind being added, of course :-)

Sebastien Douche

unread,
Aug 19, 2013, 7:48:37 PM8/19/13
to buildout-d...@googlegroups.com
On Fri, Jul 12, 2013 at 10:03 PM, Reinout van Rees <rei...@vanrees.org> wrote:
> On 12-07-13 18:42, Jim Fulton wrote:
>>
>> (You could have merged it.:)
>
>
> Actually I cannot (I just double-checked).
> I wouldn't mind being added, of course :-)

A new release with the bugfix would be cool :).
Reply all
Reply to author
Forward
0 new messages