<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="utf-8">
  <meta http-equiv="Content-Type" content="text/html" charset="UTF-8" />
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />


  <title>Debugging with PDB and App Engine</title>


  <meta name="HandheldFriendly" content="True" />
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  <meta name="referrer" content="origin" />
  <meta name="generator" content="Pelican" />
  <link href="https://datapythonista.github.io/blog/" rel="canonical" />

  <!-- Feed -->
        <link href="https://datapythonista.github.io/blog/feeds/all.atom.xml" type="application/atom+xml" rel="alternate" title="datapythonista blog Full Atom Feed" />

  <link href="https://datapythonista.github.io/blog/theme/css/style.css" type="text/css" rel="stylesheet" />

  <!-- Code highlight color scheme -->
      <link href="https://datapythonista.github.io/blog/theme/css/code_blocks/github.css" rel="stylesheet">

    <!-- CSS specified by the user -->


    <link href="https://datapythonista.github.io/blog/../static/css/blog.css" type="text/css" rel="stylesheet" />

  <!-- Custom fonts -->
  <link href='https://fonts.googleapis.com/css?family=Montserrat:400,300' rel='stylesheet' type='text/css' />
  <link href="https://fonts.googleapis.com/css?family=Lato" rel="stylesheet" type="text/css" />

  <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
  <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
  <!--[if lt IE 9]>
    <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
    <script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
  <![endif]-->


  <link href="https://datapythonista.github.io/blog/debugging-with-pdb-and-app-engine.html" rel="canonical" />

    <meta name="description" content="Python debugger (pdb) doesn't work on App Engine SDK as usual. After adding to my project: import pdb; pdb.set_trace() I got: Blocking...">

    <meta name="author" content="Marc">

    <meta name="tags" content="Google App Engine">




<!-- Open Graph -->
<meta property="og:site_name" content="datapythonista blog"/>
<meta property="og:title" content="Debugging with PDB and App Engine"/>
<meta property="og:description" content="Python debugger (pdb) doesn't work on App Engine SDK as usual. After adding to my project: import pdb; pdb.set_trace() I got: Blocking..."/>
<meta property="og:locale" content="en_US"/>
<meta property="og:url" content="https://datapythonista.github.io/blog/debugging-with-pdb-and-app-engine.html"/>
<meta property="og:type" content="article"/>
<meta property="article:published_time" content="2010-12-04 23:48:00+00:00"/>
<meta property="article:modified_time" content=""/>
<meta property="article:author" content="https://datapythonista.github.io/blog/author/marc.html">
<meta property="article:section" content="misc"/>
<meta property="article:tag" content="Google App Engine"/>
<meta property="og:image" content="https://datapythonista.github.io/blog/../static/img/bg.jpg">

<!-- Twitter Card -->

<script type="application/ld+json">
{
  "@context": "http://schema.org",
  "@type": "Article",
  "name": "Debugging with PDB and App Engine",
  "headline": "Debugging with PDB and App Engine",
  "datePublished": "2010-12-04 23:48:00+00:00",
  "dateModified": "",
  "author": {
    "@type": "Person",
    "name": "Marc",
    "url": "https://datapythonista.github.io/blog/author/marc.html"
  },
  "image": "https://datapythonista.github.io/blog/../static/img/bg.jpg",
  "url": "https://datapythonista.github.io/blog/debugging-with-pdb-and-app-engine.html",
  "description": "Python debugger (pdb) doesn't work on App Engine SDK as usual. After adding to my project: import pdb; pdb.set_trace() I got: Blocking..."
}
</script>
</head>
<!-- TODO : Body class -->
<body class="home-template">

<nav id="menu">
  <a class="close-button">Close</a>
  <div class="nav-wrapper">
    <p class="nav-label">Menu</p>
    <ul>


    </ul>
  </div>
</nav>
    <!-- Progressbar -->
    <div class="progress-container">
        <span class="progress-bar"></span>
    </div>

    <!-- Page Header -->
    <!-- Set your background image for this header on the line below. -->
    <header id="post-header" class="has-cover">
      <div class="inner">
        <nav id="navigation">
            <span class="blog-logo">
                <a href="https://datapythonista.github.io/blog/"><img src="../static/img/profile.png" alt="Blog Logo" /></a>
            </span>
          <span id="menu-button" class="nav-button">
            <a class="menu-button"><i class="ic ic-menu"></i> Menu</a>
          </span>
        </nav>
        <h1 class="post-title">Debugging with PDB and App Engine</h1>
        <!-- TODO : Proper class for headline -->
        <span class="post-meta">
                <a href="https://datapythonista.github.io/blog/author/marc.html">Marc</a>
            | <time datetime="Sat 04 December 2010">Sat 04 December 2010</time>
        </span>
        <!-- TODO : Modified check -->
            <div class="post-cover cover" style="background-image: url('https://datapythonista.github.io/blog/../static/img/bg.jpg')">
      </div>
    </header>

  <section id="wrapper">
    <a class="hidden-close"></a>

    <!-- Post content -->
    <main class="content" role="main">
        <article class="post">
        <div class="inner">
            <section class="post-content">
                <p>Python debugger (pdb) doesn't work on App Engine SDK as usual. After adding to my project:</p>
<p><code>
import pdb; pdb.set_trace()
</code></p>
<p>I got:</p>
<p><code>
Blocking access to skipped file "<my_path>/.pdbrc"</p>
<p>File "/usr/lib/python2.6/bdb.py", line 46, in trace_dispatch
    return self.dispatch_line(frame)
File "/usr/lib/python2.6/bdb.py", line 65, in dispatch_line
    if self.quitting: raise BdbQuit
</code></p>
<p>But, as posted in <a href="http://morethanseven.net/2009/02/07/pdb-and-appengine.html">morethanseven</a>, it's easy to make it work using:</p>
<p><code>
import pdb 
import sys 
for attr in ('stdin', 'stdout', 'stderr'):
    setattr(sys, attr, getattr(sys, '<strong>%s</strong>' % attr))
pdb.set_trace()
</code></p>
            </section>

            <section class="post-info">
                <div class="post-share">
                    <a class="twitter" href="https://twitter.com/share?text=Debugging with PDB and App Engine&amp;url=https://datapythonista.github.io/blog/debugging-with-pdb-and-app-engine.html" onclick="window.open(this.href, 'twitter-share', 'width=550,height=235');return false;">
                    <i class="ic ic-twitter"></i><span class="hidden">Twitter</span>
                    </a>
                    <a class="facebook" href="https://www.facebook.com/sharer/sharer.php?u=https://datapythonista.github.io/blog/debugging-with-pdb-and-app-engine.html" onclick="window.open(this.href, 'facebook-share','width=580,height=296');return false;">
                    <i class="ic ic-facebook"></i><span class="hidden">Facebook</span>
                    </a>
                    <a class="googleplus" href="https://plus.google.com/share?url=https://datapythonista.github.io/blog/debugging-with-pdb-and-app-engine.html" onclick="window.open(this.href, 'google-plus-share', 'width=490,height=530');return false;">
                    <i class="ic ic-googleplus"></i><span class="hidden">Google+</span>
                    </a>
                    <div class="clear"></div>
                </div>

                <aside class="post-tags">
<a href="https://datapythonista.github.io/blog/tag/google-app-engine.html">Google App Engine</a>                </aside>

                <div class="clear"></div>


                </section>

                <script type="text/javascript">
                    var disqus = 'datapythonista';
                    var disqus_shortname = 'datapythonista';
                    var disqus_identifier = '/debugging-with-pdb-and-app-engine.html';
                    var disqus_url = 'https://datapythonista.github.io/blog/debugging-with-pdb-and-app-engine.html';
                </script>
                <noscript>Please enable JavaScript to view the comments.</noscript>
                <section class="post-comments">
                        <a id="show-disqus" class="post-comments-activate" data-disqus-identifier="/debugging-with-pdb-and-app-engine.html" >Show Comments</a>
                    <div id="disqus_thread"></div>
                </section>

                <aside class="post-nav">
                    <div class="clear"></div>
                </aside>

            </div>
        </article>
    </main>
      <!-- TODO : Body class -->
    <div id="body-class" style="display: none;" class=""></div>

    <footer id="footer">
      <div class="inner">
        <section class="credits">


          <span class="credits-theme">Theme <a href="https://github.com/arulrajnet/attila" rel="nofollow">Attila</a></span>
          <span class="credits-software">Published with <a href="https://github.com/getpelican/pelican" rel="nofollow">Pelican</a></span>
        </section>
      </div>
    </footer>
  </section>

  <script type="text/javascript" src="https://datapythonista.github.io/blog/theme/js/script.js"></script>

    <!-- Script specified by the user -->
    <script type="text/javascript"  src="https://datapythonista.github.io/blog/../static/js/blog.js"></script>
    <!-- Global Site Tag (gtag.js) - Google Analytics -->
    <script async src="https://www.googletagmanager.com/gtag/js?id=UA-1635939-25"></script>
    <script>
        window.dataLayer = window.dataLayer || [];
        function gtag(){dataLayer.push(arguments);}
        gtag('js', new Date());
        gtag('config', 'UA-1635939-25', { 'anonymize_ip': true });
    </script>
<script type="text/javascript">
    var disqus_shortname = 'datapythonista';
    (function () {
        var s = document.createElement('script'); s.async = true;
        s.type = 'text/javascript';
        s.src = '//' + disqus_shortname + '.disqus.com/count.js';
        (document.getElementsByTagName('HEAD')[0] || document.getElementsByTagName('BODY')[0]).appendChild(s);
    }());
</script>
</body>
</html>