rem stringlengths 1 322k | add stringlengths 0 2.05M | context stringlengths 4 228k | meta stringlengths 156 215 |
|---|---|---|---|
raise norm_error, 'Cannot use :: immedeately after volume name' | raise norm_error, 'Cannot use :: immediately after volume name' | def normpath(s): """Normalize a pathname. Will return the same result for equivalent paths.""" if ":" not in s: return ":"+s comps = s.split(":") i = 1 while i < len(comps)-1: if comps[i] == "" and comps[i-1] != "": if i > 1: del comps[i-1:i+1] i = i - 1 else: # best way to handle this is to raise an exception raise... | 034cbf135049fc74218a0daeb555ed597d991f3a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/034cbf135049fc74218a0daeb555ed597d991f3a/macpath.py |
if hasattr(x, 'im_func'): x = x.im_func if hasattr(x, 'func_code'): x = x.func_code if hasattr(x, 'co_code'): disassemble(x) else: raise TypeError, \ "don't know how to disassemble %s objects" % \ type(x).__name__ | raise TypeError, \ "don't know how to disassemble %s objects" % \ type(x).__name__ | def dis(x=None): """Disassemble classes, methods, functions, or code. With no argument, disassemble the last traceback. """ if not x: distb() return if type(x) is types.InstanceType: x = x.__class__ if hasattr(x, '__dict__'): items = x.__dict__.items() items.sort() for name, x1 in items: if type(x1) in (types.MethodT... | fc53c13dd5de26fa862c812a18b6f36bbee60ea0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/fc53c13dd5de26fa862c812a18b6f36bbee60ea0/dis.py |
if sys.platform == 'win32': | if sys.platform == 'win32' or sys.platform.startswith('os2'): | def getpager(): """Decide what method to use for paging through text.""" if type(sys.stdout) is not types.FileType: return plainpager if not sys.stdin.isatty() or not sys.stdout.isatty(): return plainpager if os.environ.get('TERM') in ['dumb', 'emacs']: return plainpager if os.environ.has_key('PAGER'): if sys.platform ... | 54e0eabc2d3343c1ab71f5fb90fdda2f06b606e1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/54e0eabc2d3343c1ab71f5fb90fdda2f06b606e1/pydoc.py |
if chunks[0].strip() == '': | if chunks[0].strip() == '' and lines: | def _wrap_chunks(self, chunks): """_wrap_chunks(chunks : [string]) -> [string] | ab73d46e45eae94fb8be040ccb32d3510b8f58fa /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/ab73d46e45eae94fb8be040ccb32d3510b8f58fa/textwrap.py |
"unsupported format character '\000' (0x3000) at index 5") | "unsupported format character '?' (0x3000) at index 5") | def test_exc(formatstr, args, exception, excmsg): try: testformat(formatstr, args) except exception, exc: if str(exc) == excmsg: if verbose: print "yes" else: if verbose: print 'no' print 'Unexpected ', exception, ':', repr(str(exc)) except: if verbose: print 'no' print 'Unexpected exception' raise | c867f74a102a8df376ff55ca4dd9dc9055d16141 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/c867f74a102a8df376ff55ca4dd9dc9055d16141/test_format.py |
ofp.write("-%s\n" % encode(text)) | ofp.write("- %s \n" % encode(text)) | def subconvert(line, ofp, table, discards, autoclosing, knownempty, endchar=None): stack = [] while line: if line[0] == endchar and not stack: return line[1:] m = _comment_rx.match(line) if m: text = m.group(1) if text: ofp.write("(COMMENT\n") ofp.write("-%s\n" % encode(text)) ofp.write(")COMMENT\n") ofp.write("-\\n\n"... | 96b07a9453cea31e40ee00a69838d4fc29ad3d66 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/96b07a9453cea31e40ee00a69838d4fc29ad3d66/latex2esis.py |
line = r"\%s%s" % (m.group(1), line[m.end():]) | line = r"\%s %s" % (m.group(1), line[m.end():]) | def subconvert(line, ofp, table, discards, autoclosing, knownempty, endchar=None): stack = [] while line: if line[0] == endchar and not stack: return line[1:] m = _comment_rx.match(line) if m: text = m.group(1) if text: ofp.write("(COMMENT\n") ofp.write("-%s\n" % encode(text)) ofp.write(")COMMENT\n") ofp.write("-\\n\n"... | 96b07a9453cea31e40ee00a69838d4fc29ad3d66 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/96b07a9453cea31e40ee00a69838d4fc29ad3d66/latex2esis.py |
def subconvert(line, ofp, table, discards, autoclosing, knownempty, endchar=None): stack = [] while line: if line[0] == endchar and not stack: return line[1:] m = _comment_rx.match(line) if m: text = m.group(1) if text: ofp.write("(COMMENT\n") ofp.write("-%s\n" % encode(text)) ofp.write(")COMMENT\n") ofp.write("-\\n\n"... | 96b07a9453cea31e40ee00a69838d4fc29ad3d66 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/96b07a9453cea31e40ee00a69838d4fc29ad3d66/latex2esis.py | ||
real_ofp = ofp | def subconvert(line, ofp, table, discards, autoclosing, knownempty, endchar=None): stack = [] while line: if line[0] == endchar and not stack: return line[1:] m = _comment_rx.match(line) if m: text = m.group(1) if text: ofp.write("(COMMENT\n") ofp.write("-%s\n" % encode(text)) ofp.write(")COMMENT\n") ofp.write("-\\n\n"... | 96b07a9453cea31e40ee00a69838d4fc29ad3d66 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/96b07a9453cea31e40ee00a69838d4fc29ad3d66/latex2esis.py | |
if type(conversion) is type(""): line = "&%s;%s" % (conversion, line[m.end(1):]) continue | def subconvert(line, ofp, table, discards, autoclosing, knownempty, endchar=None): stack = [] while line: if line[0] == endchar and not stack: return line[1:] m = _comment_rx.match(line) if m: text = m.group(1) if text: ofp.write("(COMMENT\n") ofp.write("-%s\n" % encode(text)) ofp.write(")COMMENT\n") ofp.write("-\\n\n"... | 96b07a9453cea31e40ee00a69838d4fc29ad3d66 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/96b07a9453cea31e40ee00a69838d4fc29ad3d66/latex2esis.py | |
line = line[m.end() - 1:] | line = line[m.end(1):] elif empty: line = line[m.end(1):] | def subconvert(line, ofp, table, discards, autoclosing, knownempty, endchar=None): stack = [] while line: if line[0] == endchar and not stack: return line[1:] m = _comment_rx.match(line) if m: text = m.group(1) if text: ofp.write("(COMMENT\n") ofp.write("-%s\n" % encode(text)) ofp.write(")COMMENT\n") ofp.write("-\\n\n"... | 96b07a9453cea31e40ee00a69838d4fc29ad3d66 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/96b07a9453cea31e40ee00a69838d4fc29ad3d66/latex2esis.py |
if type(conversion) is not type(""): ofp.write("(%s\n" % macroname) | ofp.write("(%s\n" % macroname) | def subconvert(line, ofp, table, discards, autoclosing, knownempty, endchar=None): stack = [] while line: if line[0] == endchar and not stack: return line[1:] m = _comment_rx.match(line) if m: text = m.group(1) if text: ofp.write("(COMMENT\n") ofp.write("-%s\n" % encode(text)) ofp.write(")COMMENT\n") ofp.write("-\\n\n"... | 96b07a9453cea31e40ee00a69838d4fc29ad3d66 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/96b07a9453cea31e40ee00a69838d4fc29ad3d66/latex2esis.py |
def subconvert(line, ofp, table, discards, autoclosing, knownempty, endchar=None): stack = [] while line: if line[0] == endchar and not stack: return line[1:] m = _comment_rx.match(line) if m: text = m.group(1) if text: ofp.write("(COMMENT\n") ofp.write("-%s\n" % encode(text)) ofp.write(")COMMENT\n") ofp.write("-\\n\n"... | 96b07a9453cea31e40ee00a69838d4fc29ad3d66 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/96b07a9453cea31e40ee00a69838d4fc29ad3d66/latex2esis.py | ||
return subconvert(ifp.read(), ofp, table, discards, autoclosing, d.has_key) | try: subconvert(ifp.read(), ofp, table, discards, autoclosing, d.has_key) except IOError, (err, msg): if err != errno.EPIPE: raise | def convert(ifp, ofp, table={}, discards=(), autoclosing=(), knownempties=()): d = {} for gi in knownempties: d[gi] = gi return subconvert(ifp.read(), ofp, table, discards, autoclosing, d.has_key) | 96b07a9453cea31e40ee00a69838d4fc29ad3d66 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/96b07a9453cea31e40ee00a69838d4fc29ad3d66/latex2esis.py |
"ABC": "ABC", "ASCII": "ASCII", "C": "C", "Cpp": "Cpp", "EOF": "EOF", "e": "backslash", "ldots": "ldots", "NULL": "NULL", "POSIX": "POSIX", "UNIX": "Unix", | "ABC": ([], 0, 1), "ASCII": ([], 0, 1), "C": ([], 0, 1), "Cpp": ([], 0, 1), "EOF": ([], 0, 1), "e": ([], 0, 1), "ldots": ([], 0, 1), "NULL": ([], 0, 1), "POSIX": ([], 0, 1), "UNIX": ([], 0, 1), | def main(): if len(sys.argv) == 2: ifp = open(sys.argv[1]) ofp = sys.stdout elif len(sys.argv) == 3: ifp = open(sys.argv[1]) ofp = open(sys.argv[2], "w") else: usage() sys.exit(2) convert(ifp, ofp, { # entries are name # -> ([list of attribute names], first_is_optional, empty) "cfuncdesc": (["type", "name", ("... | 96b07a9453cea31e40ee00a69838d4fc29ad3d66 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/96b07a9453cea31e40ee00a69838d4fc29ad3d66/latex2esis.py |
knownempties=["rfc", "declaremodule", "appendix", | knownempties=["appendix", | def main(): if len(sys.argv) == 2: ifp = open(sys.argv[1]) ofp = sys.stdout elif len(sys.argv) == 3: ifp = open(sys.argv[1]) ofp = open(sys.argv[2], "w") else: usage() sys.exit(2) convert(ifp, ofp, { # entries are name # -> ([list of attribute names], first_is_optional, empty) "cfuncdesc": (["type", "name", ("... | 96b07a9453cea31e40ee00a69838d4fc29ad3d66 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/96b07a9453cea31e40ee00a69838d4fc29ad3d66/latex2esis.py |
"localmoduletable", "manpage", "input"]) | "localmoduletable"]) | def main(): if len(sys.argv) == 2: ifp = open(sys.argv[1]) ofp = sys.stdout elif len(sys.argv) == 3: ifp = open(sys.argv[1]) ofp = open(sys.argv[2], "w") else: usage() sys.exit(2) convert(ifp, ofp, { # entries are name # -> ([list of attribute names], first_is_optional, empty) "cfuncdesc": (["type", "name", ("... | 96b07a9453cea31e40ee00a69838d4fc29ad3d66 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/96b07a9453cea31e40ee00a69838d4fc29ad3d66/latex2esis.py |
raise ValueError, "overflow in number field" | raise ValueError("overflow in number field") | def itn(n, digits=8, posix=False): """Convert a python number to a number field. """ # POSIX 1003.1-1988 requires numbers to be encoded as a string of # octal digits followed by a null-byte, this allows values up to # (8**(digits-1))-1. GNU tar allows storing numbers greater than # that if necessary. A leading 0200 byt... | e4751e3cdc8c271f24e46a6155f255b6e33da158 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/e4751e3cdc8c271f24e46a6155f255b6e33da158/tarfile.py |
raise IOError, "end of file reached" | raise IOError("end of file reached") | def copyfileobj(src, dst, length=None): """Copy length bytes from fileobj src to fileobj dst. If length is None, copy the entire content. """ if length == 0: return if length is None: shutil.copyfileobj(src, dst) return BUFSIZE = 16 * 1024 blocks, remainder = divmod(length, BUFSIZE) for b in xrange(blocks): buf = src.... | e4751e3cdc8c271f24e46a6155f255b6e33da158 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/e4751e3cdc8c271f24e46a6155f255b6e33da158/tarfile.py |
raise IOError, "end of file reached" | raise IOError("end of file reached") | def copyfileobj(src, dst, length=None): """Copy length bytes from fileobj src to fileobj dst. If length is None, copy the entire content. """ if length == 0: return if length is None: shutil.copyfileobj(src, dst) return BUFSIZE = 16 * 1024 blocks, remainder = divmod(length, BUFSIZE) for b in xrange(blocks): buf = src.... | e4751e3cdc8c271f24e46a6155f255b6e33da158 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/e4751e3cdc8c271f24e46a6155f255b6e33da158/tarfile.py |
raise CompressionError, "zlib module is not available" | raise CompressionError("zlib module is not available") | def __init__(self, name, mode, comptype, fileobj, bufsize): """Construct a _Stream object. """ self._extfileobj = True if fileobj is None: fileobj = _LowLevelFile(name, mode) self._extfileobj = False | e4751e3cdc8c271f24e46a6155f255b6e33da158 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/e4751e3cdc8c271f24e46a6155f255b6e33da158/tarfile.py |
raise CompressionError, "bz2 module is not available" | raise CompressionError("bz2 module is not available") | def __init__(self, name, mode, comptype, fileobj, bufsize): """Construct a _Stream object. """ self._extfileobj = True if fileobj is None: fileobj = _LowLevelFile(name, mode) self._extfileobj = False | e4751e3cdc8c271f24e46a6155f255b6e33da158 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/e4751e3cdc8c271f24e46a6155f255b6e33da158/tarfile.py |
raise ReadError, "not a gzip file" | raise ReadError("not a gzip file") | def _init_read_gz(self): """Initialize for reading a gzip compressed fileobj. """ self.cmp = self.zlib.decompressobj(-self.zlib.MAX_WBITS) self.dbuf = "" | e4751e3cdc8c271f24e46a6155f255b6e33da158 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/e4751e3cdc8c271f24e46a6155f255b6e33da158/tarfile.py |
raise CompressionError, "unsupported compression method" | raise CompressionError("unsupported compression method") | def _init_read_gz(self): """Initialize for reading a gzip compressed fileobj. """ self.cmp = self.zlib.decompressobj(-self.zlib.MAX_WBITS) self.dbuf = "" | e4751e3cdc8c271f24e46a6155f255b6e33da158 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/e4751e3cdc8c271f24e46a6155f255b6e33da158/tarfile.py |
raise StreamError, "seeking backwards is not allowed" | raise StreamError("seeking backwards is not allowed") | def seek(self, pos=0): """Set the stream's file pointer to pos. Negative seeking is forbidden. """ if pos - self.pos >= 0: blocks, remainder = divmod(pos - self.pos, self.bufsize) for i in xrange(blocks): self.read(self.bufsize) self.read(remainder) else: raise StreamError, "seeking backwards is not allowed" return sel... | e4751e3cdc8c271f24e46a6155f255b6e33da158 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/e4751e3cdc8c271f24e46a6155f255b6e33da158/tarfile.py |
raise ValueError, "file is closed" | raise ValueError("file is closed") | def _readnormal(self, size=None): """Read operation for regular files. """ if self.closed: raise ValueError, "file is closed" self.fileobj.seek(self.offset + self.pos) bytesleft = self.size - self.pos if size is None: bytestoread = bytesleft else: bytestoread = min(size, bytesleft) self.pos += bytestoread return self._... | e4751e3cdc8c271f24e46a6155f255b6e33da158 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/e4751e3cdc8c271f24e46a6155f255b6e33da158/tarfile.py |
raise ValueError, "file is closed" | raise ValueError("file is closed") | def _readsparse(self, size=None): """Read operation for sparse files. """ if self.closed: raise ValueError, "file is closed" | e4751e3cdc8c271f24e46a6155f255b6e33da158 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/e4751e3cdc8c271f24e46a6155f255b6e33da158/tarfile.py |
raise ValueError, "I/O operation on closed file" | raise ValueError("I/O operation on closed file") | def __iter__(self): """Get an iterator over the file object. """ if self.closed: raise ValueError, "I/O operation on closed file" return self | e4751e3cdc8c271f24e46a6155f255b6e33da158 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/e4751e3cdc8c271f24e46a6155f255b6e33da158/tarfile.py |
raise ValueError, "truncated header" | raise ValueError("truncated header") | def frombuf(cls, buf): """Construct a TarInfo object from a 512 byte string buffer. """ if len(buf) != BLOCKSIZE: raise ValueError, "truncated header" if buf.count(NUL) == BLOCKSIZE: raise ValueError, "empty header" | e4751e3cdc8c271f24e46a6155f255b6e33da158 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/e4751e3cdc8c271f24e46a6155f255b6e33da158/tarfile.py |
raise ValueError, "empty header" | raise ValueError("empty header") | def frombuf(cls, buf): """Construct a TarInfo object from a 512 byte string buffer. """ if len(buf) != BLOCKSIZE: raise ValueError, "truncated header" if buf.count(NUL) == BLOCKSIZE: raise ValueError, "empty header" | e4751e3cdc8c271f24e46a6155f255b6e33da158 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/e4751e3cdc8c271f24e46a6155f255b6e33da158/tarfile.py |
raise ValueError, "invalid header" | raise ValueError("invalid header") | def frombuf(cls, buf): """Construct a TarInfo object from a 512 byte string buffer. """ if len(buf) != BLOCKSIZE: raise ValueError, "truncated header" if buf.count(NUL) == BLOCKSIZE: raise ValueError, "empty header" | e4751e3cdc8c271f24e46a6155f255b6e33da158 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/e4751e3cdc8c271f24e46a6155f255b6e33da158/tarfile.py |
raise ValueError, "mode must be 'r', 'a' or 'w'" | raise ValueError("mode must be 'r', 'a' or 'w'") | def __init__(self, name=None, mode="r", fileobj=None): """Open an (uncompressed) tar archive `name'. `mode' is either 'r' to read from an existing archive, 'a' to append data to an existing file or 'w' to create a new file overwriting an existing one. `mode' defaults to 'r'. If `fileobj' is given, it is used for readin... | e4751e3cdc8c271f24e46a6155f255b6e33da158 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/e4751e3cdc8c271f24e46a6155f255b6e33da158/tarfile.py |
raise ValueError, "nothing to open" | raise ValueError("nothing to open") | def open(cls, name=None, mode="r", fileobj=None, bufsize=20*512): """Open a tar archive for reading, writing or appending. Return an appropriate TarFile class. | e4751e3cdc8c271f24e46a6155f255b6e33da158 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/e4751e3cdc8c271f24e46a6155f255b6e33da158/tarfile.py |
raise ReadError, "file could not be opened successfully" | raise ReadError("file could not be opened successfully") | def open(cls, name=None, mode="r", fileobj=None, bufsize=20*512): """Open a tar archive for reading, writing or appending. Return an appropriate TarFile class. | e4751e3cdc8c271f24e46a6155f255b6e33da158 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/e4751e3cdc8c271f24e46a6155f255b6e33da158/tarfile.py |
raise CompressionError, "unknown compression type %r" % comptype | raise CompressionError("unknown compression type %r" % comptype) | def open(cls, name=None, mode="r", fileobj=None, bufsize=20*512): """Open a tar archive for reading, writing or appending. Return an appropriate TarFile class. | e4751e3cdc8c271f24e46a6155f255b6e33da158 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/e4751e3cdc8c271f24e46a6155f255b6e33da158/tarfile.py |
raise ValueError, "mode must be 'r' or 'w'" | raise ValueError("mode must be 'r' or 'w'") | def open(cls, name=None, mode="r", fileobj=None, bufsize=20*512): """Open a tar archive for reading, writing or appending. Return an appropriate TarFile class. | e4751e3cdc8c271f24e46a6155f255b6e33da158 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/e4751e3cdc8c271f24e46a6155f255b6e33da158/tarfile.py |
raise ValueError, "undiscernible mode" | raise ValueError("undiscernible mode") | def open(cls, name=None, mode="r", fileobj=None, bufsize=20*512): """Open a tar archive for reading, writing or appending. Return an appropriate TarFile class. | e4751e3cdc8c271f24e46a6155f255b6e33da158 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/e4751e3cdc8c271f24e46a6155f255b6e33da158/tarfile.py |
raise ValueError, "mode must be 'r', 'a' or 'w'" | raise ValueError("mode must be 'r', 'a' or 'w'") | def taropen(cls, name, mode="r", fileobj=None): """Open uncompressed tar archive name for reading or writing. """ if len(mode) > 1 or mode not in "raw": raise ValueError, "mode must be 'r', 'a' or 'w'" return cls(name, mode, fileobj) | e4751e3cdc8c271f24e46a6155f255b6e33da158 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/e4751e3cdc8c271f24e46a6155f255b6e33da158/tarfile.py |
raise ValueError, "mode must be 'r' or 'w'" | raise ValueError("mode must be 'r' or 'w'") | def gzopen(cls, name, mode="r", fileobj=None, compresslevel=9): """Open gzip compressed tar archive name for reading or writing. Appending is not allowed. """ if len(mode) > 1 or mode not in "rw": raise ValueError, "mode must be 'r' or 'w'" | e4751e3cdc8c271f24e46a6155f255b6e33da158 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/e4751e3cdc8c271f24e46a6155f255b6e33da158/tarfile.py |
raise CompressionError, "gzip module is not available" | raise CompressionError("gzip module is not available") | def gzopen(cls, name, mode="r", fileobj=None, compresslevel=9): """Open gzip compressed tar archive name for reading or writing. Appending is not allowed. """ if len(mode) > 1 or mode not in "rw": raise ValueError, "mode must be 'r' or 'w'" | e4751e3cdc8c271f24e46a6155f255b6e33da158 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/e4751e3cdc8c271f24e46a6155f255b6e33da158/tarfile.py |
raise ReadError, "not a gzip file" | raise ReadError("not a gzip file") | def gzopen(cls, name, mode="r", fileobj=None, compresslevel=9): """Open gzip compressed tar archive name for reading or writing. Appending is not allowed. """ if len(mode) > 1 or mode not in "rw": raise ValueError, "mode must be 'r' or 'w'" | e4751e3cdc8c271f24e46a6155f255b6e33da158 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/e4751e3cdc8c271f24e46a6155f255b6e33da158/tarfile.py |
raise ValueError, "mode must be 'r' or 'w'." | raise ValueError("mode must be 'r' or 'w'.") | def bz2open(cls, name, mode="r", fileobj=None, compresslevel=9): """Open bzip2 compressed tar archive name for reading or writing. Appending is not allowed. """ if len(mode) > 1 or mode not in "rw": raise ValueError, "mode must be 'r' or 'w'." | e4751e3cdc8c271f24e46a6155f255b6e33da158 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/e4751e3cdc8c271f24e46a6155f255b6e33da158/tarfile.py |
raise CompressionError, "bz2 module is not available" | raise CompressionError("bz2 module is not available") | def bz2open(cls, name, mode="r", fileobj=None, compresslevel=9): """Open bzip2 compressed tar archive name for reading or writing. Appending is not allowed. """ if len(mode) > 1 or mode not in "rw": raise ValueError, "mode must be 'r' or 'w'." | e4751e3cdc8c271f24e46a6155f255b6e33da158 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/e4751e3cdc8c271f24e46a6155f255b6e33da158/tarfile.py |
raise ReadError, "not a bzip2 file" | raise ReadError("not a bzip2 file") | def bz2open(cls, name, mode="r", fileobj=None, compresslevel=9): """Open bzip2 compressed tar archive name for reading or writing. Appending is not allowed. """ if len(mode) > 1 or mode not in "rw": raise ValueError, "mode must be 'r' or 'w'." | e4751e3cdc8c271f24e46a6155f255b6e33da158 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/e4751e3cdc8c271f24e46a6155f255b6e33da158/tarfile.py |
raise KeyError, "filename %r not found" % name | raise KeyError("filename %r not found" % name) | def getmember(self, name): """Return a TarInfo object for member `name'. If `name' can not be found in the archive, KeyError is raised. If a member occurs more than once in the archive, its last occurence is assumed to be the most up-to-date version. """ tarinfo = self._getmember(name) if tarinfo is None: raise KeyErro... | e4751e3cdc8c271f24e46a6155f255b6e33da158 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/e4751e3cdc8c271f24e46a6155f255b6e33da158/tarfile.py |
raise ValueError, "file is too large (>= 8 GB)" | raise ValueError("file is too large (>= 8 GB)") | def addfile(self, tarinfo, fileobj=None): """Add the TarInfo object `tarinfo' to the archive. If `fileobj' is given, tarinfo.size bytes are read from it and added to the archive. You can create TarInfo objects using gettarinfo(). On Windows platforms, `fileobj' should always be opened with mode 'rb' to avoid irritation... | e4751e3cdc8c271f24e46a6155f255b6e33da158 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/e4751e3cdc8c271f24e46a6155f255b6e33da158/tarfile.py |
raise ValueError, "linkname is too long (>%d)" \ % (LENGTH_LINK) | raise ValueError("linkname is too long (>%d)" % (LENGTH_LINK)) | def addfile(self, tarinfo, fileobj=None): """Add the TarInfo object `tarinfo' to the archive. If `fileobj' is given, tarinfo.size bytes are read from it and added to the archive. You can create TarInfo objects using gettarinfo(). On Windows platforms, `fileobj' should always be opened with mode 'rb' to avoid irritation... | e4751e3cdc8c271f24e46a6155f255b6e33da158 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/e4751e3cdc8c271f24e46a6155f255b6e33da158/tarfile.py |
raise ValueError, "name is too long (>%d)" \ % (LENGTH_NAME) | raise ValueError("name is too long (>%d)" % (LENGTH_NAME)) | def addfile(self, tarinfo, fileobj=None): """Add the TarInfo object `tarinfo' to the archive. If `fileobj' is given, tarinfo.size bytes are read from it and added to the archive. You can create TarInfo objects using gettarinfo(). On Windows platforms, `fileobj' should always be opened with mode 'rb' to avoid irritation... | e4751e3cdc8c271f24e46a6155f255b6e33da158 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/e4751e3cdc8c271f24e46a6155f255b6e33da158/tarfile.py |
raise StreamError, "cannot extract (sym)link as file object" | raise StreamError("cannot extract (sym)link as file object") | def extractfile(self, member): """Extract a member from the archive as a file object. `member' may be a filename or a TarInfo object. If `member' is a regular file, a file-like object is returned. If `member' is a link, a file-like object is constructed from the link's target. If `member' is none of the above, None is ... | e4751e3cdc8c271f24e46a6155f255b6e33da158 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/e4751e3cdc8c271f24e46a6155f255b6e33da158/tarfile.py |
raise ExtractError, "fifo not supported by system" | raise ExtractError("fifo not supported by system") | def makefifo(self, tarinfo, targetpath): """Make a fifo called targetpath. """ if hasattr(os, "mkfifo"): os.mkfifo(targetpath) else: raise ExtractError, "fifo not supported by system" | e4751e3cdc8c271f24e46a6155f255b6e33da158 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/e4751e3cdc8c271f24e46a6155f255b6e33da158/tarfile.py |
raise ExtractError, "special devices not supported by system" | raise ExtractError("special devices not supported by system") | def makedev(self, tarinfo, targetpath): """Make a character or block device called targetpath. """ if not hasattr(os, "mknod") or not hasattr(os, "makedev"): raise ExtractError, "special devices not supported by system" | e4751e3cdc8c271f24e46a6155f255b6e33da158 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/e4751e3cdc8c271f24e46a6155f255b6e33da158/tarfile.py |
raise IOError, "link could not be created" | raise IOError("link could not be created") | def makelink(self, tarinfo, targetpath): """Make a (symbolic) link called targetpath. If it cannot be created (platform limitation), we try to make a copy of the referenced file instead of a link. """ linkpath = tarinfo.linkname try: if tarinfo.issym(): os.symlink(linkpath, targetpath) else: # See extract(). os.link(ta... | e4751e3cdc8c271f24e46a6155f255b6e33da158 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/e4751e3cdc8c271f24e46a6155f255b6e33da158/tarfile.py |
raise ExtractError, "could not change owner" | raise ExtractError("could not change owner") | def chown(self, tarinfo, targetpath): """Set owner of targetpath according to tarinfo. """ if pwd and hasattr(os, "geteuid") and os.geteuid() == 0: # We have to be root to do so. try: g = grp.getgrnam(tarinfo.gname)[2] except KeyError: try: g = grp.getgrgid(tarinfo.gid)[2] except KeyError: g = os.getgid() try: u = pwd.... | e4751e3cdc8c271f24e46a6155f255b6e33da158 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/e4751e3cdc8c271f24e46a6155f255b6e33da158/tarfile.py |
raise ExtractError, "could not change mode" | raise ExtractError("could not change mode") | def chmod(self, tarinfo, targetpath): """Set file permissions of targetpath according to tarinfo. """ if hasattr(os, 'chmod'): try: os.chmod(targetpath, tarinfo.mode) except EnvironmentError, e: raise ExtractError, "could not change mode" | e4751e3cdc8c271f24e46a6155f255b6e33da158 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/e4751e3cdc8c271f24e46a6155f255b6e33da158/tarfile.py |
raise ExtractError, "could not change modification time" | raise ExtractError("could not change modification time") | def utime(self, tarinfo, targetpath): """Set modification time of targetpath according to tarinfo. """ if not hasattr(os, 'utime'): return if sys.platform == "win32" and tarinfo.isdir(): # According to msdn.microsoft.com, it is an error (EACCES) # to use utime() on directories. return try: os.utime(targetpath, (tarinfo... | e4751e3cdc8c271f24e46a6155f255b6e33da158 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/e4751e3cdc8c271f24e46a6155f255b6e33da158/tarfile.py |
self._dbg(2, "0x%X: %s" % (self.offset, e)) | self._dbg(2, "0x%X: empty or invalid block: %s" % (self.offset, e)) | def next(self): """Return the next member of the archive as a TarInfo object, when TarFile is opened for reading. Return None if there is no more available. """ self._check("ra") if self.firstmember is not None: m = self.firstmember self.firstmember = None return m | e4751e3cdc8c271f24e46a6155f255b6e33da158 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/e4751e3cdc8c271f24e46a6155f255b6e33da158/tarfile.py |
raise ReadError, str(e) | raise ReadError("empty, unreadable or compressed " "file: %s" % e) | def next(self): """Return the next member of the archive as a TarInfo object, when TarFile is opened for reading. Return None if there is no more available. """ self._check("ra") if self.firstmember is not None: m = self.firstmember self.firstmember = None return m | e4751e3cdc8c271f24e46a6155f255b6e33da158 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/e4751e3cdc8c271f24e46a6155f255b6e33da158/tarfile.py |
raise IOError, "%s is closed" % self.__class__.__name__ | raise IOError("%s is closed" % self.__class__.__name__) | def _check(self, mode=None): """Check if TarFile is still open, and if the operation's mode corresponds to TarFile's mode. """ if self.closed: raise IOError, "%s is closed" % self.__class__.__name__ if mode is not None and self._mode not in mode: raise IOError, "bad operation for mode %r" % self._mode | e4751e3cdc8c271f24e46a6155f255b6e33da158 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/e4751e3cdc8c271f24e46a6155f255b6e33da158/tarfile.py |
raise IOError, "bad operation for mode %r" % self._mode | raise IOError("bad operation for mode %r" % self._mode) | def _check(self, mode=None): """Check if TarFile is still open, and if the operation's mode corresponds to TarFile's mode. """ if self.closed: raise IOError, "%s is closed" % self.__class__.__name__ if mode is not None and self._mode not in mode: raise IOError, "bad operation for mode %r" % self._mode | e4751e3cdc8c271f24e46a6155f255b6e33da158 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/e4751e3cdc8c271f24e46a6155f255b6e33da158/tarfile.py |
raise ValueError, "unknown compression constant" | raise ValueError("unknown compression constant") | def __init__(self, file, mode="r", compression=TAR_PLAIN): if compression == TAR_PLAIN: self.tarfile = TarFile.taropen(file, mode) elif compression == TAR_GZIPPED: self.tarfile = TarFile.gzopen(file, mode) else: raise ValueError, "unknown compression constant" if mode[0:1] == "r": members = self.tarfile.getmembers() fo... | e4751e3cdc8c271f24e46a6155f255b6e33da158 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/e4751e3cdc8c271f24e46a6155f255b6e33da158/tarfile.py |
if "badsyntax" in basename: | if "badsyntax" in basename or "bad_coding" in basename: | def testCompileLibrary(self): # A simple but large test. Compile all the code in the # standard library and its test suite. This doesn't verify # that any of the code is correct, merely the compiler is able # to generate some kind of code for it. | f8950654e3747d569144781bba5281b1551b176c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/f8950654e3747d569144781bba5281b1551b176c/test_compiler.py |
current_lang = locale.getlocale(locale.LC_TIME)[0] if current_lang: self.__lang = current_lang else: current_lang = locale.getdefaultlocale()[0] if current_lang: self.__lang = current_lang else: self.__lang = '' | self.__lang = _getlang() | def __calc_lang(self): # Set self.__lang by using locale.getlocale() or # locale.getdefaultlocale(). If both turn up empty, set the attribute # to ''. This is to stop calls to this method and to make sure # strptime() can produce an re object correctly. current_lang = locale.getlocale(locale.LC_TIME)[0] if current_la... | 80cebc16aa800ec5740e4b9c8b6508bae4cca434 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/80cebc16aa800ec5740e4b9c8b6508bae4cca434/_strptime.py |
for whitespace in whitespace_string: format = format.replace(whitespace, r'\s*') | whitespace_replacement = re_compile('\s+') format = whitespace_replacement.sub('\s*', format) | def pattern(self, format): """Return re pattern for the format string.""" processed_format = '' for whitespace in whitespace_string: format = format.replace(whitespace, r'\s*') while format.find('%') != -1: directive_index = format.index('%')+1 processed_format = "%s%s%s" % (processed_format, format[:directive_index-1]... | 80cebc16aa800ec5740e4b9c8b6508bae4cca434 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/80cebc16aa800ec5740e4b9c8b6508bae4cca434/_strptime.py |
format = "(? | def compile(self, format): """Return a compiled re object for the format string.""" format = "(?#%s)%s" % (self.locale_time.lang,format) return re_compile(self.pattern(format), IGNORECASE) | 80cebc16aa800ec5740e4b9c8b6508bae4cca434 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/80cebc16aa800ec5740e4b9c8b6508bae4cca434/_strptime.py | |
locale_time = LocaleTime() compiled_re = TimeRE(locale_time).compile(format) found = compiled_re.match(data_string) | global _locale_cache global _regex_cache locale_time = _locale_cache.locale_time if locale_time.lang != _getlang(): _locale_cache = TimeRE() _regex_cache.clear() format_regex = _regex_cache.get(format) if not format_regex: if len(_regex_cache) > 5: _regex_cache.clear() format_regex = _locale_cache.compile(format) _r... | def strptime(data_string, format="%a %b %d %H:%M:%S %Y"): """Return a time struct based on the input data and the format string.""" locale_time = LocaleTime() compiled_re = TimeRE(locale_time).compile(format) found = compiled_re.match(data_string) if not found: raise ValueError("time data did not match format") year = ... | 80cebc16aa800ec5740e4b9c8b6508bae4cca434 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/80cebc16aa800ec5740e4b9c8b6508bae4cca434/_strptime.py |
return mbcs_encode(input,self.errors)[0] | return mbcs_encode(input, self.errors)[0] | def encode(self, input, final=False): return mbcs_encode(input,self.errors)[0] | 961b91bd3c48af639acbf20bbf15a85e7152ff6e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/961b91bd3c48af639acbf20bbf15a85e7152ff6e/mbcs.py |
def _buffer_decode(self, input, errors, final): return mbcs_decode(input,self.errors,final) | _buffer_decode = mbcs_decode | def _buffer_decode(self, input, errors, final): return mbcs_decode(input,self.errors,final) | 961b91bd3c48af639acbf20bbf15a85e7152ff6e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/961b91bd3c48af639acbf20bbf15a85e7152ff6e/mbcs.py |
class StreamWriter(Codec,codecs.StreamWriter): pass | class StreamWriter(codecs.StreamWriter): encode = mbcs_encode | def _buffer_decode(self, input, errors, final): return mbcs_decode(input,self.errors,final) | 961b91bd3c48af639acbf20bbf15a85e7152ff6e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/961b91bd3c48af639acbf20bbf15a85e7152ff6e/mbcs.py |
class StreamReader(Codec,codecs.StreamReader): pass class StreamConverter(StreamWriter,StreamReader): encode = codecs.mbcs_decode decode = codecs.mbcs_encode | class StreamReader(codecs.StreamReader): decode = mbcs_decode | def _buffer_decode(self, input, errors, final): return mbcs_decode(input,self.errors,final) | 961b91bd3c48af639acbf20bbf15a85e7152ff6e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/961b91bd3c48af639acbf20bbf15a85e7152ff6e/mbcs.py |
if '@' in localename: | if '@' in code: | def _parse_localename(localename): """ Parses the locale code for localename and returns the result as tuple (language code, encoding). The localename is normalized and passed through the locale alias engine. A ValueError is raised in case the locale name cannot be parsed. The language code corresponds to RFC 1766. ... | b709c2caba3c781d0f4602f28227993e565f0a87 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/b709c2caba3c781d0f4602f28227993e565f0a87/locale.py |
def getpreferredencoding(do_setlocale = True): """Return the charset that the user is likely using, according to the system configuration.""" if do_setlocale: oldloc = setlocale(LC_CTYPE) setlocale(LC_CTYPE, "") result = nl_langinfo(CODESET) setlocale(LC_CTYPE, oldloc) return result else: return nl_langinfo(CODESET) | b709c2caba3c781d0f4602f28227993e565f0a87 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/b709c2caba3c781d0f4602f28227993e565f0a87/locale.py | ||
def getpreferredencoding(do_setlocale = True): """Return the charset that the user is likely using, according to the system configuration.""" if do_setlocale: oldloc = setlocale(LC_CTYPE) setlocale(LC_CTYPE, "") result = nl_langinfo(CODESET) setlocale(LC_CTYPE, oldloc) return result else: return nl_langinfo(CODESET) | b709c2caba3c781d0f4602f28227993e565f0a87 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/b709c2caba3c781d0f4602f28227993e565f0a87/locale.py | ||
0x0404: "zh_TW", 0x0804: "zh_CN", | 0x0436: "af_ZA", 0x041c: "sq_AL", 0x0401: "ar_SA", 0x0801: "ar_IQ", 0x0c01: "ar_EG", 0x1001: "ar_LY", 0x1401: "ar_DZ", 0x1801: "ar_MA", 0x1c01: "ar_TN", 0x2001: "ar_OM", 0x2401: "ar_YE", 0x2801: "ar_SY", 0x2c01: "ar_JO", 0x3001: "ar_LB", 0x3401: "ar_KW", 0x3801: "ar_AE", 0x3c01: "ar_BH", 0x4001: "ar_QA", 0x042b: "hy_AM... | def getpreferredencoding(do_setlocale = True): """Return the charset that the user is likely using, according to the system configuration.""" if do_setlocale: oldloc = setlocale(LC_CTYPE) setlocale(LC_CTYPE, "") result = nl_langinfo(CODESET) setlocale(LC_CTYPE, oldloc) return result else: return nl_langinfo(CODESET) | b709c2caba3c781d0f4602f28227993e565f0a87 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/b709c2caba3c781d0f4602f28227993e565f0a87/locale.py |
0x0413: "nl_NL", 0x0409: "en_US", 0x0809: "en_UK", 0x0c09: "en_AU", 0x1009: "en_CA", 0x1409: "en_NZ", 0x1809: "en_IE", 0x1c09: "en_ZA", | 0x048c: "gbz_AF", 0x0465: "div_MV", 0x0413: "nl_NL", 0x0813: "nl_BE", 0x0409: "en_US", 0x0809: "en_GB", 0x0c09: "en_AU", 0x1009: "en_CA", 0x1409: "en_NZ", 0x1809: "en_IE", 0x1c09: "en_ZA", 0x2009: "en_JA", 0x2409: "en_CB", 0x2809: "en_BZ", 0x2c09: "en_TT", 0x3009: "en_ZW", 0x3409: "en_PH", 0x0425: "et_EE", 0x0438: "fo_... | def getpreferredencoding(do_setlocale = True): """Return the charset that the user is likely using, according to the system configuration.""" if do_setlocale: oldloc = setlocale(LC_CTYPE) setlocale(LC_CTYPE, "") result = nl_langinfo(CODESET) setlocale(LC_CTYPE, oldloc) return result else: return nl_langinfo(CODESET) | b709c2caba3c781d0f4602f28227993e565f0a87 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/b709c2caba3c781d0f4602f28227993e565f0a87/locale.py |
0x040c: "fr_FR", 0x080c: "fr_BE", 0x0c0c: "fr_CA", 0x100c: "fr_CH", 0x0407: "de_DE", | 0x040c: "fr_FR", 0x080c: "fr_BE", 0x0c0c: "fr_CA", 0x100c: "fr_CH", 0x140c: "fr_LU", 0x180c: "fr_MC", 0x0462: "fy_NL", 0x0456: "gl_ES", 0x0437: "ka_GE", 0x0407: "de_DE", 0x0807: "de_CH", 0x0c07: "de_AT", 0x1007: "de_LU", 0x1407: "de_LI", | def getpreferredencoding(do_setlocale = True): """Return the charset that the user is likely using, according to the system configuration.""" if do_setlocale: oldloc = setlocale(LC_CTYPE) setlocale(LC_CTYPE, "") result = nl_langinfo(CODESET) setlocale(LC_CTYPE, oldloc) return result else: return nl_langinfo(CODESET) | b709c2caba3c781d0f4602f28227993e565f0a87 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/b709c2caba3c781d0f4602f28227993e565f0a87/locale.py |
0x040d: "iw_IL", | 0x0447: "gu_IN", 0x040d: "he_IL", 0x0439: "hi_IN", 0x040e: "hu_HU", | def getpreferredencoding(do_setlocale = True): """Return the charset that the user is likely using, according to the system configuration.""" if do_setlocale: oldloc = setlocale(LC_CTYPE) setlocale(LC_CTYPE, "") result = nl_langinfo(CODESET) setlocale(LC_CTYPE, oldloc) return result else: return nl_langinfo(CODESET) | b709c2caba3c781d0f4602f28227993e565f0a87 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/b709c2caba3c781d0f4602f28227993e565f0a87/locale.py |
0x0410: "it_IT", 0x0411: "ja_JA", 0x0414: "no_NO", 0x0816: "pt_PT", 0x0c0a: "es_ES", 0x0441: "sw_KE", 0x041d: "sv_SE", 0x081d: "sv_FI", | 0x0421: "id_ID", 0x045d: "iu_CA", 0x085d: "iu_CA", 0x083c: "ga_IE", 0x0434: "xh_ZA", 0x0435: "zu_ZA", 0x0410: "it_IT", 0x0810: "it_CH", 0x0411: "ja_JP", 0x044b: "kn_IN", 0x043f: "kk_KZ", 0x0457: "kok_IN", 0x0412: "ko_KR", 0x0440: "ky_KG", 0x0426: "lv_LV", 0x0427: "lt_LT", 0x046e: "lb_LU", 0x042f: "mk_MK", 0x043e: "ms_M... | def getpreferredencoding(do_setlocale = True): """Return the charset that the user is likely using, according to the system configuration.""" if do_setlocale: oldloc = setlocale(LC_CTYPE) setlocale(LC_CTYPE, "") result = nl_langinfo(CODESET) setlocale(LC_CTYPE, oldloc) return result else: return nl_langinfo(CODESET) | b709c2caba3c781d0f4602f28227993e565f0a87 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/b709c2caba3c781d0f4602f28227993e565f0a87/locale.py |
return self.socket.recvfrom(max_packet_size) | return self.socket.recvfrom(self.max_packet_size) | def get_request(self): | db2b70cb99377ced6bca4ef96fcfbc1eaa83e0d3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/db2b70cb99377ced6bca4ef96fcfbc1eaa83e0d3/SocketServer.py |
if userhome.endswith('/'): i += 1 | userhome = userhome.rstrip('/') | def expanduser(path): """Expand ~ and ~user constructions. If user or $HOME is unknown, do nothing.""" if not path.startswith('~'): return path i = path.find('/', 1) if i < 0: i = len(path) if i == 1: if 'HOME' not in os.environ: import pwd userhome = pwd.getpwuid(os.getuid()).pw_dir else: userhome = os.environ['HOME'... | 8d1e5bffc1249cdb5a8ced25e6f89328e7366290 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/8d1e5bffc1249cdb5a8ced25e6f89328e7366290/posixpath.py |
tmp = [] def callit(func=func, args=args, self=self, tmp=tmp): | def callit(): | def after(self, ms, func=None, *args): """Call function once after given time. | 4696ffbf0935519eb457ea6a786f22631a63ffda /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/4696ffbf0935519eb457ea6a786f22631a63ffda/Tkinter.py |
self.deletecommand(tmp[0]) | self.deletecommand(name) | def callit(func=func, args=args, self=self, tmp=tmp): try: func(*args) finally: try: self.deletecommand(tmp[0]) except TclError: pass | 4696ffbf0935519eb457ea6a786f22631a63ffda /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/4696ffbf0935519eb457ea6a786f22631a63ffda/Tkinter.py |
tmp.append(name) | def callit(func=func, args=args, self=self, tmp=tmp): try: func(*args) finally: try: self.deletecommand(tmp[0]) except TclError: pass | 4696ffbf0935519eb457ea6a786f22631a63ffda /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/4696ffbf0935519eb457ea6a786f22631a63ffda/Tkinter.py | |
if auth: h.putheader('Authorization: Basic %s' % auth) | if auth: h.putheader('Authorization', 'Basic %s' % auth) | def open_http(self, url): import httplib if type(url) is type(""): host, selector = splithost(url) user_passwd, host = splituser(host) else: host, selector = url urltype, rest = splittype(selector) if string.lower(urltype) == 'http': realhost, rest = splithost(rest) user_passwd, realhost = splituser(realhost) if user_p... | c5d7e80739fdaed472955ca2d3d4933c27ab879b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/c5d7e80739fdaed472955ca2d3d4933c27ab879b/urllib.py |
return EOFError, "Reached EOF" | raise EOFError, "Reached EOF" | def _read(self, size=1024): if self.fileobj is None: raise EOFError, "Reached EOF" | 2d813e514020a9cf74a19e8b4ba0b98996bb24eb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/2d813e514020a9cf74a19e8b4ba0b98996bb24eb/gzip.py |
key = user, passwd, host, port | key = user, host, port, '/'.join(dirs) | def connect_ftp(self, user, passwd, host, port, dirs): key = user, passwd, host, port if key in self.cache: self.timeout[key] = time.time() + self.delay else: self.cache[key] = ftpwrapper(user, passwd, host, port, dirs) self.timeout[key] = time.time() + self.delay self.check_cache() return self.cache[key] | c533c986e8c2a009d3eb49a44c1b6de28fcd982c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/c533c986e8c2a009d3eb49a44c1b6de28fcd982c/urllib2.py |
test_classes = (TestBasicOps, TestVariousIteratorArgs, TestGC) | test_classes = (TestBasicOps, TestVariousIteratorArgs, TestGC, RegressionTests) | def test_main(verbose=None): test_classes = (TestBasicOps, TestVariousIteratorArgs, TestGC) test_support.run_unittest(*test_classes) # verify reference counting if verbose and hasattr(sys, "gettotalrefcount"): import gc counts = [None] * 5 for i in xrange(len(counts)): test_support.run_unittest(*test_classes) gc.colle... | a56f6b6600ea8906562cfaa31859b72a53a8c0d7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/a56f6b6600ea8906562cfaa31859b72a53a8c0d7/test_itertools.py |
class _MultiCallMethod: def __init__(self, call_list, name): self.__call_list = call_list self.__name = name def __getattr__(self, name): return _MultiCallMethod(self.__call_list, "%s.%s" % (self.__name, name)) def __call__(self, *args): self.__call_list.append((self.__name, args)) def MultiCallIterator(results):... | def end_methodName(self, data): if self._encoding: data = _decode(data, self._encoding) self._methodname = data self._type = "methodName" # no params | 45394c281d09de67e16be0d56ff04ddb5b6f6011 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/45394c281d09de67e16be0d56ff04ddb5b6f6011/xmlrpclib.py | |
def __repr__(self): return ( "<ServerProxy for %s%s>" % (self.__host, self.__handler) ) | 45394c281d09de67e16be0d56ff04ddb5b6f6011 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/45394c281d09de67e16be0d56ff04ddb5b6f6011/xmlrpclib.py | ||
self.libs = None | self.libraries = None | self.undef = None | cdb20ba56d1c14cdf5a90df2b0cfc94d869c2e55 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/cdb20ba56d1c14cdf5a90df2b0cfc94d869c2e55/build_ext.py |
if type (self.libs) is StringType: self.libs = [self.libs] | if type (self.libraries) is StringType: self.libraries = [self.libraries] | def finalize_options (self): from distutils import sysconfig | cdb20ba56d1c14cdf5a90df2b0cfc94d869c2e55 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/cdb20ba56d1c14cdf5a90df2b0cfc94d869c2e55/build_ext.py |
if self.libs is not None: self.compiler.set_libraries (self.libs) | if self.libraries is not None: self.compiler.set_libraries (self.libraries) | if self.undef is not None: for macro in self.undef: self.compiler.undefine_macro (macro) | cdb20ba56d1c14cdf5a90df2b0cfc94d869c2e55 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/cdb20ba56d1c14cdf5a90df2b0cfc94d869c2e55/build_ext.py |
if self.distribution.libraries: build_clib = self.find_peer ('build_clib') self.libraries = build_clib.get_library_names () or [] self.library_dirs = [build_clib.build_clib] else: self.libraries = [] self.library_dirs = [] | if self.undef is not None: for macro in self.undef: self.compiler.undefine_macro (macro) | cdb20ba56d1c14cdf5a90df2b0cfc94d869c2e55 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/cdb20ba56d1c14cdf5a90df2b0cfc94d869c2e55/build_ext.py | |
libraries = (self.libraries + (build_info.get ('libraries') or [])) library_dirs = (self.library_dirs + (build_info.get ('library_dirs') or [])) | libraries = build_info.get ('libraries') library_dirs = build_info.get ('library_dirs') rpath = build_info.get ('rpath') | def build_extensions (self, extensions): | cdb20ba56d1c14cdf5a90df2b0cfc94d869c2e55 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/cdb20ba56d1c14cdf5a90df2b0cfc94d869c2e55/build_ext.py |
self.compiler = new_compiler (compiler=self.compiler, | self.compiler = new_compiler ( compiler="msvc", | def run (self): | f46a688e847dfc6a560ada112c1b3eec1fb74c4d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/f46a688e847dfc6a560ada112c1b3eec1fb74c4d/build_ext.py |
self.precompile_hook() | def build_extensions (self): | f46a688e847dfc6a560ada112c1b3eec1fb74c4d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/f46a688e847dfc6a560ada112c1b3eec1fb74c4d/build_ext.py | |
self.prelink_hook() | if self.compiler.compiler_type == 'msvc': self.msvc_prelink_hack(sources, ext, extra_args) | def build_extensions (self): | f46a688e847dfc6a560ada112c1b3eec1fb74c4d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/f46a688e847dfc6a560ada112c1b3eec1fb74c4d/build_ext.py |
def precompile_hook (self): pass def prelink_hook (self): | def msvc_prelink_hack (self, sources, ext, extra_args): | def find_swig (self): """Return the name of the SWIG executable. On Unix, this is just "swig" -- it should be in the PATH. Tries a bit harder on Windows. """ | f46a688e847dfc6a560ada112c1b3eec1fb74c4d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/f46a688e847dfc6a560ada112c1b3eec1fb74c4d/build_ext.py |
if self.compiler.compiler_type == 'msvc': def_file = ext.export_symbol_file if def_file is None: source_dir = os.path.dirname (sources[0]) ext_base = (string.split (ext.name, '.'))[-1] def_file = os.path.join (source_dir, "%s.def" % ext_base) if not os.path.exists (def_file): def_file = None if def_file is not None: e... | def_file = ext.export_symbol_file if def_file is None: source_dir = os.path.dirname (sources[0]) ext_base = (string.split (ext.name, '.'))[-1] def_file = os.path.join (source_dir, "%s.def" % ext_base) if not os.path.exists (def_file): def_file = None if def_file is not None: extra_args.append ('/DEF:' + def_file) els... | def prelink_hook (self): | f46a688e847dfc6a560ada112c1b3eec1fb74c4d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/f46a688e847dfc6a560ada112c1b3eec1fb74c4d/build_ext.py |
effective = (effective / tabwidth + 1) * tabwidth | effective = (int(effective / tabwidth) + 1) * tabwidth | def classifyws(s, tabwidth): raw = effective = 0 for ch in s: if ch == ' ': raw = raw + 1 effective = effective + 1 elif ch == '\t': raw = raw + 1 effective = (effective / tabwidth + 1) * tabwidth else: break return raw, effective | d91b0d6a65a0b6d0935a4e3ea131fa78c43a690d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/d91b0d6a65a0b6d0935a4e3ea131fa78c43a690d/AutoIndent.py |
self.sock.send(data) | bytes = len(data) while bytes > 0: sent = self.sock.send(data) if sent == bytes: break data = data[sent:] bytes = bytes - sent | def send(self, data): """Send data to remote.""" self.sock.send(data) | 0402dd18cb025b7510760142087c97729702e23a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/0402dd18cb025b7510760142087c97729702e23a/imaplib.py |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.