Skip to content

Commit

Permalink
Revert "Patch os.chdir to raise an exception, once twistd is done wit…
Browse files Browse the repository at this point in the history
…h it"

This reverts commit 4f6d211.

Patching os.chdir causes subprocess to fail in the child.  Too bad :(

Refs #1007
  • Loading branch information
Dustin J. Mitchell committed Oct 4, 2010
1 parent d3af15e commit 77ae316
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 11 deletions.
6 changes: 1 addition & 5 deletions master/buildbot/master.py
Expand Up @@ -15,8 +15,8 @@
from twisted.application.internet import TimerService

import buildbot
# sibling imports
from buildbot.util import now, safeTranslate, eventual
from buildbot.util import monkeypatches
from buildbot.pbutil import NewCredPerspective
from buildbot.process.builder import Builder, IDLE
from buildbot.status.builder import Status, BuildSetStatus
Expand Down Expand Up @@ -571,10 +571,6 @@ def startService(self):
b.builder_status.addPointEvent(["master", "started"])
b.builder_status.saveYourself()

# now that we're running a master, don't use os.chdir. Note that this
# will trip up twistd if we do it any earlier
monkeypatches.disable_os_chdir()

def _handleSIGHUP(self, *args):
reactor.callLater(0, self.loadTheConfigFile)

Expand Down
6 changes: 0 additions & 6 deletions master/buildbot/util/monkeypatches.py
@@ -1,11 +1,5 @@
import os
from twisted.trial import unittest

def disable_os_chdir():
def DoNotUseOsChDir(_):
raise ValueError('Do not use os.chdir() in your code. You probably want to use path=foo or cwd=foo argument when calling out subprocesses instead')
os.chdir = DoNotUseOsChDir

def add_debugging_monkeypatches():
"""
DO NOT CALL THIS DIRECTLY
Expand Down

0 comments on commit 77ae316

Please sign in to comment.