diff --git a/src/python/grpcio/commands.py b/src/python/grpcio/commands.py
index 89c0fbf0f3f1abb0facb26d7eadf6bada3909d40..8a2f2d6283edcb13806aec5f0d94ff5c2c9a1f4c 100644
--- a/src/python/grpcio/commands.py
+++ b/src/python/grpcio/commands.py
@@ -64,7 +64,7 @@ class SphinxDocumentation(setuptools.Command):
     import sphinx.apidoc
     metadata = self.distribution.metadata
     src_dir = os.path.join(
-        os.getcwd(), self.distribution.package_dir['grpc'])
+        os.getcwd(), self.distribution.package_dir[''], 'grpc')
     sys.path.append(src_dir)
     sphinx.apidoc.main([
         '', '--force', '--full', '-H', metadata.name, '-A', metadata.author,
diff --git a/tools/distrib/python/docgen.py b/tools/distrib/python/docgen.py
index d76792c56f418733099ddee90273e70e7cf1a8a2..2acd3cc12f27e76749afd8bc2c02b7957805bc98 100755
--- a/tools/distrib/python/docgen.py
+++ b/tools/distrib/python/docgen.py
@@ -81,7 +81,7 @@ if args.submit:
   assert args.doc_branch
   github_user = args.gh_user
   github_repository_owner = (
-      args.gh_repo_owner if args.gh_repo_owner else gh_user)
+      args.gh_repo_owner if args.gh_repo_owner else args.gh_user)
   # Create a temporary directory out of tree, checkout gh-pages from the
   # specified repository, edit it, and push it. It's up to the user to then go
   # onto GitHub and make a PR against grpc/grpc:gh-pages.