SpiderFoot automates OSINT for threat intelligence and mapping your attack surface.
Python attacksurfacecticybersecurityfootprintinghackinginformation-gatheringinformation-securityinfosecintelligence-gatheringosintosint-frameworkosint-reconnaissanceosint-toolpentestingpythonreconsecurity-toolsthreat-intelligencethreatintel
Reverting 'ext/' Directory Changes
Gormogon78d4ac34bff0
diff --git a/ext/adblockparser/parser.py b/ext/adblockparser/parser.pyindex a796341e..5c9e1eeb 100644--- a/ext/adblockparser/parser.py+++ b/ext/adblockparser/parser.py@@ -98,7 +98,7 @@ class AdblockRule(object):else:self.raw_options = []self.options = {}- self._options_keys = frozenset(self.options.keys()) - {'match-case'}+ self._options_keys = frozenset(self.options.keys()) - set(['match-case'])self.rule_text = rule_textdiff --git a/ext/dns/dnssec.py b/ext/dns/dnssec.pyindex 4707f2d4..084f908d 100644--- a/ext/dns/dnssec.py+++ b/ext/dns/dnssec.py@@ -1,4 +1,3 @@-# -*- coding: utf-8 -*-# Copyright (C) 2003-2007, 2009, 2011 Nominum, Inc.## Permission to use, copy, modify, and distribute this software and its@@ -104,7 +103,7 @@ def key_id(key, origin=None):total += (ord(rdata[2 * i]) << 8) + ord(rdata[2 * i + 1])if len(rdata) % 2 != 0:total += ord(rdata[len(rdata) - 1]) << 8- total += ((total >> 16) & 0xffff)+ total += ((total >> 16) & 0xffff);return total & 0xffffdef make_ds(name, key, algorithm, origin=None):@@ -287,7 +286,7 @@ def _validate_rrsig(rrset, rrsig, keys, origin=None, now=None):rrnamebuf = rrname.to_digestable(origin)rrfixed = struct.pack('!HHI', rdataset.rdtype, rdataset.rdclass,rrsig.original_ttl)- rrlist = sorted(rdataset)+ rrlist = sorted(rdataset);for rr in rrlist:hash.update(rrnamebuf)hash.update(rrfixed)@@ -300,9 +299,9 @@ def _validate_rrsig(rrset, rrsig, keys, origin=None, now=None):if _is_rsa(rrsig.algorithm):# PKCS1 algorithm identifier goop- digest += _make_algorithm_id(rrsig.algorithm)+ digest = _make_algorithm_id(rrsig.algorithm) + digestpadlen = keylen // 8 - len(digest) - 3- digest += chr(0) + chr(1) + chr(0xFF) * padlen + chr(0)+ digest = chr(0) + chr(1) + chr(0xFF) * padlen + chr(0) + digestelif _is_dsa(rrsig.algorithm):passelse:diff --git a/ext/dns/e164.py b/ext/dns/e164.pyindex 42ea0152..68f0a316 100644--- a/ext/dns/e164.py+++ b/ext/dns/e164.py@@ -1,4 +1,3 @@-# -*- coding: utf-8 -*-# Copyright (C) 2006, 2007, 2009, 2011 Nominum, Inc.## Permission to use, copy, modify, and distribute this software and its@@ -59,7 +58,7 @@ def to_e164(name, origin=public_enum_domain, want_plus_prefix=True):dlabels.reverse()text = ''.join(dlabels)if want_plus_prefix:- text += '+'+ text = '+' + textreturn textdef query(number, domains, resolver=None):diff --git a/ext/dns/edns.py b/ext/dns/edns.pyindex 3d838093..e52b6df3 100644--- a/ext/dns/edns.py+++ b/ext/dns/edns.py@@ -1,4 +1,3 @@-# -*- coding: utf-8 -*-# Copyright (C) 2009, 2011 Nominum, Inc.## Permission to use, copy, modify, and distribute this software and itsdiff --git a/ext/dns/entropy.py b/ext/dns/entropy.pyindex f7ea58e8..d380cf8c 100644--- a/ext/dns/entropy.py+++ b/ext/dns/entropy.py@@ -1,4 +1,3 @@-# -*- coding: utf-8 -*-# Copyright (C) 2009, 2011 Nominum, Inc.## Permission to use, copy, modify, and distribute this software and itsdiff --git a/ext/dns/exception.py b/ext/dns/exception.pyindex 88dfaec2..db6ef6e6 100644--- a/ext/dns/exception.py+++ b/ext/dns/exception.py@@ -1,4 +1,3 @@-# -*- coding: utf-8 -*-# Copyright (C) 2003-2007, 2009-2011 Nominum, Inc.## Permission to use, copy, modify, and distribute this software and itsdiff --git a/ext/dns/flags.py b/ext/dns/flags.pyindex e77e65c7..35a8305e 100644--- a/ext/dns/flags.py+++ b/ext/dns/flags.py@@ -1,4 +1,3 @@-# -*- coding: utf-8 -*-# Copyright (C) 2001-2007, 2009-2011 Nominum, Inc.## Permission to use, copy, modify, and distribute this software and itsdiff --git a/ext/dns/grange.py b/ext/dns/grange.pyindex 741950a6..c0607d60 100644--- a/ext/dns/grange.py+++ b/ext/dns/grange.py@@ -1,4 +1,3 @@-# -*- coding: utf-8 -*-# Copyright (C) 2003-2007, 2009-2011 Nominum, Inc.## Permission to use, copy, modify, and distribute this software and its@@ -29,6 +28,7 @@ def from_text(text):"""# TODO, figure out the bounds on start, stop and step.+ import pdbstep = 1cur = ''state = 0diff --git a/ext/dns/hash.py b/ext/dns/hash.pyindex 57012db2..0c708036 100644--- a/ext/dns/hash.py+++ b/ext/dns/hash.py@@ -1,4 +1,3 @@-# -*- coding: utf-8 -*-# Copyright (C) 2011 Nominum, Inc.## Permission to use, copy, modify, and distribute this software and itsdiff --git a/ext/dns/inet.py b/ext/dns/inet.pyindex 44bc0081..3b7e88f7 100644--- a/ext/dns/inet.py+++ b/ext/dns/inet.py@@ -1,4 +1,3 @@-# -*- coding: utf-8 -*-# Copyright (C) 2003-2007, 2009-2011 Nominum, Inc.## Permission to use, copy, modify, and distribute this software and its@@ -99,7 +98,7 @@ def is_multicast(text):"""try:first = ord(dns.ipv4.inet_aton(text)[0])- return (224 <= first <= 239)+ return (first >= 224 and first <= 239)except:try:first = ord(dns.ipv6.inet_aton(text)[0])diff --git a/ext/dns/ipv4.py b/ext/dns/ipv4.pyindex 883243e9..85ab48f7 100644--- a/ext/dns/ipv4.py+++ b/ext/dns/ipv4.py@@ -1,4 +1,3 @@-# -*- coding: utf-8 -*-# Copyright (C) 2003-2007, 2009-2011 Nominum, Inc.## Permission to use, copy, modify, and distribute this software and itsdiff --git a/ext/dns/ipv6.py b/ext/dns/ipv6.pyindex 6900ee5f..1ab00da9 100644--- a/ext/dns/ipv6.py+++ b/ext/dns/ipv6.py@@ -1,4 +1,3 @@-# -*- coding: utf-8 -*-# Copyright (C) 2003-2007, 2009-2011 Nominum, Inc.## Permission to use, copy, modify, and distribute this software and its@@ -149,7 +148,7 @@ def inet_aton(text):if lc > 4:raise dns.exception.SyntaxErrorif lc != 4:- c += ('0' * (4 - lc))+ c = ('0' * (4 - lc)) + ccanonical.append(c)if l < 8 and not seen_empty:raise dns.exception.SyntaxErrordiff --git a/ext/dns/message.py b/ext/dns/message.pyindex 9be37d62..52c0eaea 100644--- a/ext/dns/message.py+++ b/ext/dns/message.py@@ -1,4 +1,3 @@-# -*- coding: utf-8 -*-# Copyright (C) 2001-2007, 2009-2011 Nominum, Inc.## Permission to use, copy, modify, and distribute this software and its@@ -17,6 +16,7 @@"""DNS Messages"""import cStringIO+import randomimport structimport sysimport time@@ -606,7 +606,7 @@ class _WireReader(object):(rdtype, rdclass) = \struct.unpack('!HH',self.wire[self.current:self.current + 4])- self.current += 4+ self.current = self.current + 4self.message.find_rrset(self.message.question, qname,rdclass, rdtype, create=True,force_unique=True)@@ -636,7 +636,7 @@ class _WireReader(object):(rdtype, rdclass, ttl, rdlen) = \struct.unpack('!HHIH',self.wire[self.current:self.current + 10])- self.current += 10+ self.current = self.current + 10if rdtype == dns.rdatatype.OPT:if not section is self.message.additional or seen_opt:raise BadEDNS@@ -650,7 +650,7 @@ class _WireReader(object):(otype, olen) = \struct.unpack('!HH',self.wire[current:current + 4])- current += 4+ current = current + 4opt = dns.edns.option_from_wire(otype, self.wire, current, olen)self.message.options.append(opt)current = current + olen@@ -831,7 +831,8 @@ class _TextReader(object):self.updating = Trueelif what == 'edns':self.message.edns = self.tok.get_int()- self.message.ednsflags |= self.message.edns << 16+ self.message.ednsflags = self.message.ednsflags | \+ (self.message.edns << 16)elif what == 'eflags':if self.message.edns < 0:self.message.edns = 0diff --git a/ext/dns/name.py b/ext/dns/name.pyindex 7bb1835f..293ab951 100644--- a/ext/dns/name.py+++ b/ext/dns/name.py@@ -1,4 +1,3 @@-# -*- coding: utf-8 -*-# Copyright (C) 2001-2007, 2009-2011 Nominum, Inc.## Permission to use, copy, modify, and distribute this software and its@@ -96,7 +95,7 @@ def _escapify(label):for c in label:if c in _escaped:text += '\\' + c- elif 0x20 < ord(c) < 0x7F:+ elif ord(c) > 0x20 and ord(c) < 0x7F:text += celse:text += '\\%03d' % ord(c)diff --git a/ext/dns/namedict.py b/ext/dns/namedict.pyindex 3f7f40ab..9f5a0efb 100644--- a/ext/dns/namedict.py+++ b/ext/dns/namedict.py@@ -1,4 +1,3 @@-# -*- coding: utf-8 -*-# Copyright (C) 2003-2007, 2009-2011 Nominum, Inc.## Permission to use, copy, modify, and distribute this software and itsdiff --git a/ext/dns/node.py b/ext/dns/node.pyindex d2d26ff5..e74004f6 100644--- a/ext/dns/node.py+++ b/ext/dns/node.py@@ -1,4 +1,3 @@-# -*- coding: utf-8 -*-# Copyright (C) 2001-2007, 2009-2011 Nominum, Inc.## Permission to use, copy, modify, and distribute this software and its@@ -36,7 +35,7 @@ class Node(object):"""Initialize a DNS node."""- self.rdatasets = []+ self.rdatasets = [];def to_text(self, name, **kw):"""Convert a node to text format.diff --git a/ext/dns/opcode.py b/ext/dns/opcode.pyindex 3e484f4e..3258c34c 100644--- a/ext/dns/opcode.py+++ b/ext/dns/opcode.py@@ -1,4 +1,3 @@-# -*- coding: utf-8 -*-# Copyright (C) 2001-2007, 2009-2011 Nominum, Inc.## Permission to use, copy, modify, and distribute this software and its@@ -54,7 +53,7 @@ def from_text(text):if text.isdigit():value = int(text)- if 0 <= value <= 15:+ if value >= 0 and value <= 15:return valuevalue = _by_text.get(text.upper())if value is None:diff --git a/ext/dns/query.py b/ext/dns/query.pyindex 5159dd68..7a1b1f49 100644--- a/ext/dns/query.py+++ b/ext/dns/query.py@@ -1,4 +1,3 @@-# -*- coding: utf-8 -*-# Copyright (C) 2003-2007, 2009-2011 Nominum, Inc.## Permission to use, copy, modify, and distribute this software and its@@ -245,7 +244,7 @@ def _net_read(sock, count, expiration):n = sock.recv(count)if n == '':raise EOFError- count -= len(n)+ count = count - len(n)s = s + nreturn sdiff --git a/ext/dns/rcode.py b/ext/dns/rcode.pyindex 1d1c951e..7807782a 100644--- a/ext/dns/rcode.py+++ b/ext/dns/rcode.py@@ -1,4 +1,3 @@-# -*- coding: utf-8 -*-# Copyright (C) 2001-2007, 2009-2011 Nominum, Inc.## Permission to use, copy, modify, and distribute this software and its@@ -68,7 +67,7 @@ def from_text(text):if text.isdigit():v = int(text)- if 0 <= v <= 4095:+ if v >= 0 and v <= 4095:return vv = _by_text.get(text.upper())if v is None:diff --git a/ext/dns/rdata.py b/ext/dns/rdata.pyindex 625305fa..350bf790 100644--- a/ext/dns/rdata.py+++ b/ext/dns/rdata.py@@ -1,4 +1,3 @@-# -*- coding: utf-8 -*-# Copyright (C) 2001-2007, 2009-2011 Nominum, Inc.## Permission to use, copy, modify, and distribute this software and its@@ -105,7 +104,7 @@ def _escapify(qstring):for c in qstring:if c in __escaped:text += '\\' + c- elif 0x20 <= ord(c) < 0x7F:+ elif ord(c) >= 0x20 and ord(c) < 0x7F:text += celse:text += '\\%03d' % ord(c)diff --git a/ext/dns/rdataclass.py b/ext/dns/rdataclass.pyindex ded78efb..7601e70c 100644--- a/ext/dns/rdataclass.py+++ b/ext/dns/rdataclass.py@@ -1,4 +1,3 @@-# -*- coding: utf-8 -*-# Copyright (C) 2001-2007, 2009-2011 Nominum, Inc.## Permission to use, copy, modify, and distribute this software and its@@ -64,7 +63,7 @@ _metaclasses = {ANY : True}-_unknown_class_pattern = re.compile('CLASS([0-9]+)$', re.I)+_unknown_class_pattern = re.compile('CLASS([0-9]+)$', re.I);class UnknownRdataclass(dns.exception.DNSException):"""Raised when a class is unknown."""@@ -82,7 +81,7 @@ def from_text(text):value = _by_text.get(text.upper())if value is None:match = _unknown_class_pattern.match(text)- if match is None:+ if match == None:raise UnknownRdataclassvalue = int(match.group(1))if value < 0 or value > 65535:diff --git a/ext/dns/rdataset.py b/ext/dns/rdataset.pyindex aaa4beb9..dcd2b401 100644--- a/ext/dns/rdataset.py+++ b/ext/dns/rdataset.py@@ -1,4 +1,3 @@-# -*- coding: utf-8 -*-# Copyright (C) 2001-2007, 2009-2011 Nominum, Inc.## Permission to use, copy, modify, and distribute this software and itsdiff --git a/ext/dns/rdatatype.py b/ext/dns/rdatatype.pyindex 6b27546c..f64307a7 100644--- a/ext/dns/rdatatype.py+++ b/ext/dns/rdatatype.py@@ -1,4 +1,3 @@-# -*- coding: utf-8 -*-# Copyright (C) 2001-2007, 2009-2011 Nominum, Inc.## Permission to use, copy, modify, and distribute this software and its@@ -176,7 +175,7 @@ _singletons = {# CNAME is technically a singleton, but we allow multiple CNAMEs.}-_unknown_type_pattern = re.compile('TYPE([0-9]+)$', re.I)+_unknown_type_pattern = re.compile('TYPE([0-9]+)$', re.I);class UnknownRdatatype(dns.exception.DNSException):"""Raised if a type is unknown."""@@ -193,7 +192,7 @@ def from_text(text):value = _by_text.get(text.upper())if value is None:match = _unknown_type_pattern.match(text)- if match is None:+ if match == None:raise UnknownRdatatypevalue = int(match.group(1))if value < 0 or value > 65535:@@ -220,7 +219,7 @@ def is_metatype(rdtype):@type rdtype: int@rtype: bool"""- if TKEY <= rdtype <= ANY or _metatypes.has_key(rdtype):+ if rdtype >= TKEY and rdtype <= ANY or _metatypes.has_key(rdtype):return Truereturn Falsediff --git a/ext/dns/rdtypes/ANY/AFSDB.py b/ext/dns/rdtypes/ANY/AFSDB.pyindex 2dd3aeed..c729789a 100644--- a/ext/dns/rdtypes/ANY/AFSDB.py+++ b/ext/dns/rdtypes/ANY/AFSDB.py@@ -1,4 +1,3 @@-# -*- coding: utf-8 -*-# Copyright (C) 2003-2007, 2009-2011 Nominum, Inc.## Permission to use, copy, modify, and distribute this software and itsdiff --git a/ext/dns/rdtypes/ANY/CERT.py b/ext/dns/rdtypes/ANY/CERT.pyindex f452f981..c102521a 100644--- a/ext/dns/rdtypes/ANY/CERT.py+++ b/ext/dns/rdtypes/ANY/CERT.py@@ -1,4 +1,3 @@-# -*- coding: utf-8 -*-# Copyright (C) 2003-2007, 2009-2011 Nominum, Inc.## Permission to use, copy, modify, and distribute this software and itsdiff --git a/ext/dns/rdtypes/ANY/CNAME.py b/ext/dns/rdtypes/ANY/CNAME.pyindex 06a339ba..fb8e9be4 100644--- a/ext/dns/rdtypes/ANY/CNAME.py+++ b/ext/dns/rdtypes/ANY/CNAME.py@@ -1,4 +1,3 @@-# -*- coding: utf-8 -*-# Copyright (C) 2003-2007, 2009-2011 Nominum, Inc.## Permission to use, copy, modify, and distribute this software and itsdiff --git a/ext/dns/rdtypes/ANY/DLV.py b/ext/dns/rdtypes/ANY/DLV.pyindex 9ca267df..8bd79793 100644--- a/ext/dns/rdtypes/ANY/DLV.py+++ b/ext/dns/rdtypes/ANY/DLV.py@@ -1,4 +1,3 @@-# -*- coding: utf-8 -*-# Copyright (C) 2009-2011 Nominum, Inc.## Permission to use, copy, modify, and distribute this software and itsdiff --git a/ext/dns/rdtypes/ANY/DNAME.py b/ext/dns/rdtypes/ANY/DNAME.pyindex de63483d..d8640011 100644--- a/ext/dns/rdtypes/ANY/DNAME.py+++ b/ext/dns/rdtypes/ANY/DNAME.py@@ -1,4 +1,3 @@-# -*- coding: utf-8 -*-# Copyright (C) 2003-2007, 2009-2011 Nominum, Inc.## Permission to use, copy, modify, and distribute this software and itsdiff --git a/ext/dns/rdtypes/ANY/DNSKEY.py b/ext/dns/rdtypes/ANY/DNSKEY.pyindex 943dd890..1d678d2f 100644--- a/ext/dns/rdtypes/ANY/DNSKEY.py+++ b/ext/dns/rdtypes/ANY/DNSKEY.py@@ -1,4 +1,3 @@-# -*- coding: utf-8 -*-# Copyright (C) 2004-2007, 2009-2011 Nominum, Inc.## Permission to use, copy, modify, and distribute this software and itsdiff --git a/ext/dns/rdtypes/ANY/DS.py b/ext/dns/rdtypes/ANY/DS.pyindex 41d56f52..56b6332d 100644--- a/ext/dns/rdtypes/ANY/DS.py+++ b/ext/dns/rdtypes/ANY/DS.py@@ -1,4 +1,3 @@-# -*- coding: utf-8 -*-# Copyright (C) 2003-2007, 2009-2011 Nominum, Inc.## Permission to use, copy, modify, and distribute this software and itsdiff --git a/ext/dns/rdtypes/ANY/GPOS.py b/ext/dns/rdtypes/ANY/GPOS.pyindex 02f3b53f..38d1d88b 100644--- a/ext/dns/rdtypes/ANY/GPOS.py+++ b/ext/dns/rdtypes/ANY/GPOS.py@@ -1,4 +1,3 @@-# -*- coding: utf-8 -*-# Copyright (C) 2003-2007, 2009-2011 Nominum, Inc.## Permission to use, copy, modify, and distribute this software and itsdiff --git a/ext/dns/rdtypes/ANY/HINFO.py b/ext/dns/rdtypes/ANY/HINFO.pyindex c8795f4a..15fd54e6 100644--- a/ext/dns/rdtypes/ANY/HINFO.py+++ b/ext/dns/rdtypes/ANY/HINFO.py@@ -1,4 +1,3 @@-# -*- coding: utf-8 -*-# Copyright (C) 2003-2007, 2009-2011 Nominum, Inc.## Permission to use, copy, modify, and distribute this software and itsdiff --git a/ext/dns/rdtypes/ANY/HIP.py b/ext/dns/rdtypes/ANY/HIP.pyindex 2e143247..968b36f5 100644--- a/ext/dns/rdtypes/ANY/HIP.py+++ b/ext/dns/rdtypes/ANY/HIP.py@@ -1,4 +1,3 @@-# -*- coding: utf-8 -*-# Copyright (C) 2010, 2011 Nominum, Inc.## Permission to use, copy, modify, and distribute this software and its@@ -15,6 +14,7 @@# OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.import cStringIO+import stringimport structimport dns.exceptiondiff --git a/ext/dns/rdtypes/ANY/ISDN.py b/ext/dns/rdtypes/ANY/ISDN.pyindex b5366333..0c2d3cd0 100644--- a/ext/dns/rdtypes/ANY/ISDN.py+++ b/ext/dns/rdtypes/ANY/ISDN.py@@ -1,4 +1,3 @@-# -*- coding: utf-8 -*-# Copyright (C) 2003-2007, 2009-2011 Nominum, Inc.## Permission to use, copy, modify, and distribute this software and itsdiff --git a/ext/dns/rdtypes/ANY/LOC.py b/ext/dns/rdtypes/ANY/LOC.pyindex 27379eb3..154546d7 100644--- a/ext/dns/rdtypes/ANY/LOC.py+++ b/ext/dns/rdtypes/ANY/LOC.py@@ -1,4 +1,3 @@-# -*- coding: utf-8 -*-# Copyright (C) 2003-2007, 2009-2011 Nominum, Inc.## Permission to use, copy, modify, and distribute this software and its@@ -62,7 +61,7 @@ def _tuple_to_float(what):return sign * valuedef _encode_size(what, desc):- what = long(what)+ what = long(what);exponent = _exponent_of(what, desc) & 0xFbase = what // pow(10, exponent) & 0xFreturn base * 16 + exponentdiff --git a/ext/dns/rdtypes/ANY/MX.py b/ext/dns/rdtypes/ANY/MX.pyindex 1f173633..92f41532 100644--- a/ext/dns/rdtypes/ANY/MX.py+++ b/ext/dns/rdtypes/ANY/MX.py@@ -1,4 +1,3 @@-# -*- coding: utf-8 -*-# Copyright (C) 2003-2007, 2009-2011 Nominum, Inc.## Permission to use, copy, modify, and distribute this software and itsdiff --git a/ext/dns/rdtypes/ANY/NS.py b/ext/dns/rdtypes/ANY/NS.pyindex 2f2acf5d..6b45d4d4 100644--- a/ext/dns/rdtypes/ANY/NS.py+++ b/ext/dns/rdtypes/ANY/NS.py@@ -1,4 +1,3 @@-# -*- coding: utf-8 -*-# Copyright (C) 2003-2007, 2009-2011 Nominum, Inc.## Permission to use, copy, modify, and distribute this software and itsdiff --git a/ext/dns/rdtypes/ANY/NSEC.py b/ext/dns/rdtypes/ANY/NSEC.pyindex bb422976..ad113a4b 100644--- a/ext/dns/rdtypes/ANY/NSEC.py+++ b/ext/dns/rdtypes/ANY/NSEC.py@@ -1,4 +1,3 @@-# -*- coding: utf-8 -*-# Copyright (C) 2004-2007, 2009-2011 Nominum, Inc.## Permission to use, copy, modify, and distribute this software and itsdiff --git a/ext/dns/rdtypes/ANY/NSEC3.py b/ext/dns/rdtypes/ANY/NSEC3.pyindex 3f4a4666..b42fe4c8 100644--- a/ext/dns/rdtypes/ANY/NSEC3.py+++ b/ext/dns/rdtypes/ANY/NSEC3.py@@ -1,4 +1,3 @@-# -*- coding: utf-8 -*-# Copyright (C) 2004-2007, 2009-2011 Nominum, Inc.## Permission to use, copy, modify, and distribute this software and itsdiff --git a/ext/dns/rdtypes/ANY/NSEC3PARAM.py b/ext/dns/rdtypes/ANY/NSEC3PARAM.pyindex dd5df4a0..4e687825 100644--- a/ext/dns/rdtypes/ANY/NSEC3PARAM.py+++ b/ext/dns/rdtypes/ANY/NSEC3PARAM.py@@ -1,4 +1,3 @@-# -*- coding: utf-8 -*-# Copyright (C) 2004-2007, 2009-2011 Nominum, Inc.## Permission to use, copy, modify, and distribute this software and itsdiff --git a/ext/dns/rdtypes/ANY/PTR.py b/ext/dns/rdtypes/ANY/PTR.pyindex 18a9eb29..4a037537 100644--- a/ext/dns/rdtypes/ANY/PTR.py+++ b/ext/dns/rdtypes/ANY/PTR.py@@ -1,4 +1,3 @@-# -*- coding: utf-8 -*-# Copyright (C) 2003-2007, 2009-2011 Nominum, Inc.## Permission to use, copy, modify, and distribute this software and itsdiff --git a/ext/dns/rdtypes/ANY/RP.py b/ext/dns/rdtypes/ANY/RP.pyindex 5e413212..26c55314 100644--- a/ext/dns/rdtypes/ANY/RP.py+++ b/ext/dns/rdtypes/ANY/RP.py@@ -1,4 +1,3 @@-# -*- coding: utf-8 -*-# Copyright (C) 2003-2007, 2009-2011 Nominum, Inc.## Permission to use, copy, modify, and distribute this software and itsdiff --git a/ext/dns/rdtypes/ANY/RRSIG.py b/ext/dns/rdtypes/ANY/RRSIG.pyindex 046c35bb..63d389cd 100644--- a/ext/dns/rdtypes/ANY/RRSIG.py+++ b/ext/dns/rdtypes/ANY/RRSIG.py@@ -1,4 +1,3 @@-# -*- coding: utf-8 -*-# Copyright (C) 2004-2007, 2009-2011 Nominum, Inc.## Permission to use, copy, modify, and distribute this software and itsdiff --git a/ext/dns/rdtypes/ANY/RT.py b/ext/dns/rdtypes/ANY/RT.pyindex 20663803..f9653fdb 100644--- a/ext/dns/rdtypes/ANY/RT.py+++ b/ext/dns/rdtypes/ANY/RT.py@@ -1,4 +1,3 @@-# -*- coding: utf-8 -*-# Copyright (C) 2003-2007, 2009-2011 Nominum, Inc.## Permission to use, copy, modify, and distribute this software and itsdiff --git a/ext/dns/rdtypes/ANY/SOA.py b/ext/dns/rdtypes/ANY/SOA.pyindex 3a81cb57..2d6f21b5 100644--- a/ext/dns/rdtypes/ANY/SOA.py+++ b/ext/dns/rdtypes/ANY/SOA.py@@ -1,4 +1,3 @@-# -*- coding: utf-8 -*-# Copyright (C) 2003-2007, 2009-2011 Nominum, Inc.## Permission to use, copy, modify, and distribute this software and itsdiff --git a/ext/dns/rdtypes/ANY/SPF.py b/ext/dns/rdtypes/ANY/SPF.pyindex dc96a06e..8860dd72 100644--- a/ext/dns/rdtypes/ANY/SPF.py+++ b/ext/dns/rdtypes/ANY/SPF.py@@ -1,4 +1,3 @@-# -*- coding: utf-8 -*-# Copyright (C) 2006, 2007, 2009-2011 Nominum, Inc.## Permission to use, copy, modify, and distribute this software and itsdiff --git a/ext/dns/rdtypes/ANY/SSHFP.py b/ext/dns/rdtypes/ANY/SSHFP.pyindex be5345d4..4c439511 100644--- a/ext/dns/rdtypes/ANY/SSHFP.py+++ b/ext/dns/rdtypes/ANY/SSHFP.py@@ -1,4 +1,3 @@-# -*- coding: utf-8 -*-# Copyright (C) 2005-2007, 2009-2011 Nominum, Inc.## Permission to use, copy, modify, and distribute this software and itsdiff --git a/ext/dns/rdtypes/ANY/TLSA.py b/ext/dns/rdtypes/ANY/TLSA.pyindex 143f6749..6ca8c0a5 100644--- a/ext/dns/rdtypes/ANY/TLSA.py+++ b/ext/dns/rdtypes/ANY/TLSA.py@@ -1,4 +1,3 @@-# -*- coding: utf-8 -*-# Copyright (C) 2005-2007, 2009-2011 Nominum, Inc.## Permission to use, copy, modify, and distribute this software and itsdiff --git a/ext/dns/rdtypes/ANY/TXT.py b/ext/dns/rdtypes/ANY/TXT.pyindex 751fe997..604fd0f4 100644--- a/ext/dns/rdtypes/ANY/TXT.py+++ b/ext/dns/rdtypes/ANY/TXT.py@@ -1,4 +1,3 @@-# -*- coding: utf-8 -*-# Copyright (C) 2003-2007, 2009-2011 Nominum, Inc.## Permission to use, copy, modify, and distribute this software and itsdiff --git a/ext/dns/rdtypes/ANY/X25.py b/ext/dns/rdtypes/ANY/X25.pyindex 0d944c6f..ae91295f 100644--- a/ext/dns/rdtypes/ANY/X25.py+++ b/ext/dns/rdtypes/ANY/X25.py@@ -1,4 +1,3 @@-# -*- coding: utf-8 -*-# Copyright (C) 2003-2007, 2009-2011 Nominum, Inc.## Permission to use, copy, modify, and distribute this software and itsdiff --git a/ext/dns/rdtypes/IN/A.py b/ext/dns/rdtypes/IN/A.pyindex ec80626e..372d3332 100644--- a/ext/dns/rdtypes/IN/A.py+++ b/ext/dns/rdtypes/IN/A.py@@ -1,4 +1,3 @@-# -*- coding: utf-8 -*-# Copyright (C) 2003-2007, 2009-2011 Nominum, Inc.## Permission to use, copy, modify, and distribute this software and itsdiff --git a/ext/dns/rdtypes/IN/AAAA.py b/ext/dns/rdtypes/IN/AAAA.pyindex 23cf55f3..e131bd50 100644--- a/ext/dns/rdtypes/IN/AAAA.py+++ b/ext/dns/rdtypes/IN/AAAA.py@@ -1,4 +1,3 @@-# -*- coding: utf-8 -*-# Copyright (C) 2003-2007, 2009-2011 Nominum, Inc.## Permission to use, copy, modify, and distribute this software and itsdiff --git a/ext/dns/rdtypes/IN/APL.py b/ext/dns/rdtypes/IN/APL.pyindex 26c8d5b5..260fd6f3 100644--- a/ext/dns/rdtypes/IN/APL.py+++ b/ext/dns/rdtypes/IN/APL.py@@ -1,4 +1,3 @@-# -*- coding: utf-8 -*-# Copyright (C) 2003-2007, 2009-2011 Nominum, Inc.## Permission to use, copy, modify, and distribute this software and itsdiff --git a/ext/dns/rdtypes/IN/DHCID.py b/ext/dns/rdtypes/IN/DHCID.pyindex 8819d703..5524bead 100644--- a/ext/dns/rdtypes/IN/DHCID.py+++ b/ext/dns/rdtypes/IN/DHCID.py@@ -1,4 +1,3 @@-# -*- coding: utf-8 -*-# Copyright (C) 2006, 2007, 2009-2011 Nominum, Inc.## Permission to use, copy, modify, and distribute this software and itsdiff --git a/ext/dns/rdtypes/IN/IPSECKEY.py b/ext/dns/rdtypes/IN/IPSECKEY.pyindex ab96587b..d85b6fe9 100644--- a/ext/dns/rdtypes/IN/IPSECKEY.py+++ b/ext/dns/rdtypes/IN/IPSECKEY.py@@ -1,4 +1,3 @@-# -*- coding: utf-8 -*-# Copyright (C) 2006, 2007, 2009-2011 Nominum, Inc.## Permission to use, copy, modify, and distribute this software and itsdiff --git a/ext/dns/rdtypes/IN/KX.py b/ext/dns/rdtypes/IN/KX.pyindex e0605624..c7bd5bbe 100644--- a/ext/dns/rdtypes/IN/KX.py+++ b/ext/dns/rdtypes/IN/KX.py@@ -1,4 +1,3 @@-# -*- coding: utf-8 -*-# Copyright (C) 2003-2007, 2009-2011 Nominum, Inc.## Permission to use, copy, modify, and distribute this software and itsdiff --git a/ext/dns/rdtypes/IN/NAPTR.py b/ext/dns/rdtypes/IN/NAPTR.pyindex 7b10813d..7fe04308 100644--- a/ext/dns/rdtypes/IN/NAPTR.py+++ b/ext/dns/rdtypes/IN/NAPTR.py@@ -1,4 +1,3 @@-# -*- coding: utf-8 -*-# Copyright (C) 2003-2007, 2009-2011 Nominum, Inc.## Permission to use, copy, modify, and distribute this software and itsdiff --git a/ext/dns/rdtypes/IN/NSAP.py b/ext/dns/rdtypes/IN/NSAP.pyindex ca5f6d15..216cb0a8 100644--- a/ext/dns/rdtypes/IN/NSAP.py+++ b/ext/dns/rdtypes/IN/NSAP.py@@ -1,4 +1,3 @@-# -*- coding: utf-8 -*-# Copyright (C) 2003-2007, 2009-2011 Nominum, Inc.## Permission to use, copy, modify, and distribute this software and itsdiff --git a/ext/dns/rdtypes/IN/NSAP_PTR.py b/ext/dns/rdtypes/IN/NSAP_PTR.pyindex 1e3704a1..df5b989a 100644--- a/ext/dns/rdtypes/IN/NSAP_PTR.py+++ b/ext/dns/rdtypes/IN/NSAP_PTR.py@@ -1,4 +1,3 @@-# -*- coding: utf-8 -*-# Copyright (C) 2003-2007, 2009-2011 Nominum, Inc.## Permission to use, copy, modify, and distribute this software and itsdiff --git a/ext/dns/rdtypes/IN/PX.py b/ext/dns/rdtypes/IN/PX.pyindex f4206240..1422b834 100644--- a/ext/dns/rdtypes/IN/PX.py+++ b/ext/dns/rdtypes/IN/PX.py@@ -1,4 +1,3 @@-# -*- coding: utf-8 -*-# Copyright (C) 2003-2007, 2009-2011 Nominum, Inc.## Permission to use, copy, modify, and distribute this software and itsdiff --git a/ext/dns/rdtypes/IN/SRV.py b/ext/dns/rdtypes/IN/SRV.pyindex 0d38611b..e101b26b 100644--- a/ext/dns/rdtypes/IN/SRV.py+++ b/ext/dns/rdtypes/IN/SRV.py@@ -1,4 +1,3 @@-# -*- coding: utf-8 -*-# Copyright (C) 2003-2007, 2009-2011 Nominum, Inc.## Permission to use, copy, modify, and distribute this software and itsdiff --git a/ext/dns/rdtypes/IN/WKS.py b/ext/dns/rdtypes/IN/WKS.pyindex 4e5674a9..04c3054e 100644--- a/ext/dns/rdtypes/IN/WKS.py+++ b/ext/dns/rdtypes/IN/WKS.py@@ -1,4 +1,3 @@-# -*- coding: utf-8 -*-# Copyright (C) 2003-2007, 2009-2011 Nominum, Inc.## Permission to use, copy, modify, and distribute this software and itsdiff --git a/ext/dns/rdtypes/dsbase.py b/ext/dns/rdtypes/dsbase.pyindex dea50a30..6f5559a7 100644--- a/ext/dns/rdtypes/dsbase.py+++ b/ext/dns/rdtypes/dsbase.py@@ -1,4 +1,3 @@-# -*- coding: utf-8 -*-# Copyright (C) 2010, 2011 Nominum, Inc.## Permission to use, copy, modify, and distribute this software and itsdiff --git a/ext/dns/rdtypes/mxbase.py b/ext/dns/rdtypes/mxbase.pyindex 0d4e7ec2..abc6a9ed 100644--- a/ext/dns/rdtypes/mxbase.py+++ b/ext/dns/rdtypes/mxbase.py@@ -1,4 +1,3 @@-# -*- coding: utf-8 -*-# Copyright (C) 2003-2007, 2009-2011 Nominum, Inc.## Permission to use, copy, modify, and distribute this software and itsdiff --git a/ext/dns/rdtypes/nsbase.py b/ext/dns/rdtypes/nsbase.pyindex 1db7fd0c..fbd5ef1e 100644--- a/ext/dns/rdtypes/nsbase.py+++ b/ext/dns/rdtypes/nsbase.py@@ -1,4 +1,3 @@-# -*- coding: utf-8 -*-# Copyright (C) 2003-2007, 2009-2011 Nominum, Inc.## Permission to use, copy, modify, and distribute this software and itsdiff --git a/ext/dns/rdtypes/txtbase.py b/ext/dns/rdtypes/txtbase.pyindex 17a99f5a..580f056e 100644--- a/ext/dns/rdtypes/txtbase.py+++ b/ext/dns/rdtypes/txtbase.py@@ -1,4 +1,3 @@-# -*- coding: utf-8 -*-# Copyright (C) 2006, 2007, 2009-2011 Nominum, Inc.## Permission to use, copy, modify, and distribute this software and itsdiff --git a/ext/dns/renderer.py b/ext/dns/renderer.pyindex 05cea0ec..1708e92a 100644--- a/ext/dns/renderer.py+++ b/ext/dns/renderer.py@@ -1,4 +1,3 @@-# -*- coding: utf-8 -*-# Copyright (C) 2001-2007, 2009-2011 Nominum, Inc.## Permission to use, copy, modify, and distribute this software and itsdiff --git a/ext/dns/resolver.py b/ext/dns/resolver.pyindex d695abb0..934d39bd 100644--- a/ext/dns/resolver.py+++ b/ext/dns/resolver.py@@ -1,4 +1,3 @@-# -*- coding: utf-8 -*-# Copyright (C) 2003-2007, 2009-2011 Nominum, Inc.## Permission to use, copy, modify, and distribute this software and itsdiff --git a/ext/dns/reversename.py b/ext/dns/reversename.pyindex 94ed6ab1..4925cfd6 100644--- a/ext/dns/reversename.py+++ b/ext/dns/reversename.py@@ -1,4 +1,3 @@-# -*- coding: utf-8 -*-# Copyright (C) 2006, 2007, 2009-2011 Nominum, Inc.## Permission to use, copy, modify, and distribute this software and itsdiff --git a/ext/dns/rrset.py b/ext/dns/rrset.pyindex c119ab0b..f6051fea 100644--- a/ext/dns/rrset.py+++ b/ext/dns/rrset.py@@ -1,4 +1,3 @@-# -*- coding: utf-8 -*-# Copyright (C) 2003-2007, 2009-2011 Nominum, Inc.## Permission to use, copy, modify, and distribute this software and itsdiff --git a/ext/dns/set.py b/ext/dns/set.pyindex 960123c0..14c76a05 100644--- a/ext/dns/set.py+++ b/ext/dns/set.py@@ -1,4 +1,3 @@-# -*- coding: utf-8 -*-# Copyright (C) 2003-2007, 2009-2011 Nominum, Inc.## Permission to use, copy, modify, and distribute this software and itsdiff --git a/ext/dns/tokenizer.py b/ext/dns/tokenizer.pyindex 6cd608f9..ab568731 100644--- a/ext/dns/tokenizer.py+++ b/ext/dns/tokenizer.py@@ -1,4 +1,3 @@-# -*- coding: utf-8 -*-# Copyright (C) 2003-2007, 2009-2011 Nominum, Inc.## Permission to use, copy, modify, and distribute this software and itsdiff --git a/ext/dns/tsig.py b/ext/dns/tsig.pyindex f5d81006..6e97dcea 100644--- a/ext/dns/tsig.py+++ b/ext/dns/tsig.py@@ -1,4 +1,3 @@-# -*- coding: utf-8 -*-# Copyright (C) 2001-2007, 2009-2011 Nominum, Inc.## Permission to use, copy, modify, and distribute this software and itsdiff --git a/ext/dns/tsigkeyring.py b/ext/dns/tsigkeyring.pyindex 45c66451..10de4db5 100644--- a/ext/dns/tsigkeyring.py+++ b/ext/dns/tsigkeyring.py@@ -1,4 +1,3 @@-# -*- coding: utf-8 -*-# Copyright (C) 2003-2007, 2009-2011 Nominum, Inc.## Permission to use, copy, modify, and distribute this software and itsdiff --git a/ext/dns/ttl.py b/ext/dns/ttl.pyindex 85708714..ab6ddf4e 100644--- a/ext/dns/ttl.py+++ b/ext/dns/ttl.py@@ -1,4 +1,3 @@-# -*- coding: utf-8 -*-# Copyright (C) 2003-2007, 2009-2011 Nominum, Inc.## Permission to use, copy, modify, and distribute this software and itsdiff --git a/ext/dns/update.py b/ext/dns/update.pyindex ee2017bb..e6922269 100644--- a/ext/dns/update.py+++ b/ext/dns/update.py@@ -1,4 +1,3 @@-# -*- coding: utf-8 -*-# Copyright (C) 2003-2007, 2009-2011 Nominum, Inc.## Permission to use, copy, modify, and distribute this software and itsdiff --git a/ext/dns/version.py b/ext/dns/version.pyindex eeb6fbe4..c3d305e2 100644--- a/ext/dns/version.py+++ b/ext/dns/version.py@@ -1,4 +1,3 @@-# -*- coding: utf-8 -*-# Copyright (C) 2003-2007, 2009-2011 Nominum, Inc.## Permission to use, copy, modify, and distribute this software and itsdiff --git a/ext/dns/wiredata.py b/ext/dns/wiredata.pyindex 9b0cc4c7..86d954a9 100644--- a/ext/dns/wiredata.py+++ b/ext/dns/wiredata.py@@ -1,4 +1,3 @@-# -*- coding: utf-8 -*-# Copyright (C) 2011 Nominum, Inc.## Permission to use, copy, modify, and distribute this software and itsdiff --git a/ext/dns/zone.py b/ext/dns/zone.pyindex 0d61ce66..9efcf437 100644--- a/ext/dns/zone.py+++ b/ext/dns/zone.py@@ -1,4 +1,3 @@-# -*- coding: utf-8 -*-# Copyright (C) 2003-2007, 2009-2011 Nominum, Inc.## Permission to use, copy, modify, and distribute this software and itsdiff --git a/ext/exifread/classes.py b/ext/exifread/classes.pyindex bb1f1efd..0876b4ce 100644--- a/ext/exifread/classes.py+++ b/ext/exifread/classes.py@@ -1,4 +1,3 @@-# -*- coding: utf-8 -*-import structimport re@@ -91,8 +90,8 @@ class ExifHeader:if self.endian == 'I':s += chr(offset & 0xFF)else:- s += chr(offset & 0xFF)- offset >>= 8+ s = chr(offset & 0xFF) + s+ offset = offset >> 8return sdef _first_ifd(self):diff --git a/ext/exifread/exif_log.py b/ext/exifread/exif_log.pyindex b86e95a7..82d5aea2 100644--- a/ext/exifread/exif_log.py+++ b/ext/exifread/exif_log.py@@ -1,4 +1,3 @@-# -*- coding: utf-8 -*-"""Custom log output"""diff --git a/ext/exifread/tags/exif.py b/ext/exifread/tags/exif.pyindex a145b799..4b0d9336 100644--- a/ext/exifread/tags/exif.py+++ b/ext/exifread/tags/exif.py@@ -1,4 +1,3 @@-# -*- coding: utf-8 -*-"""Standard tag definitions."""diff --git a/ext/exifread/tags/makernote.py b/ext/exifread/tags/makernote.pyindex 8923c37c..71701476 100644--- a/ext/exifread/tags/makernote.py+++ b/ext/exifread/tags/makernote.py@@ -1,4 +1,3 @@-# -*- coding: utf-8 -*-"""Makernote tag definitions."""diff --git a/ext/exifread/tags/makernote_canon.py b/ext/exifread/tags/makernote_canon.pyindex 14b118c7..7b465357 100644--- a/ext/exifread/tags/makernote_canon.py+++ b/ext/exifread/tags/makernote_canon.py@@ -1,4 +1,3 @@-# -*- coding: utf-8 -*-"""Makernote (proprietary) tag definitions for Canon.diff --git a/ext/exifread/utils.py b/ext/exifread/utils.pyindex dc01755c..f5e0d7fe 100644--- a/ext/exifread/utils.py+++ b/ext/exifread/utils.py@@ -1,4 +1,3 @@-# -*- coding: utf-8 -*-"""Misc utilities."""@@ -18,7 +17,7 @@ def make_string(seq):for c in seq:# Screen out non-printing characterstry:- if 32 <= c < 256:+ if 32 <= c and c < 256:string += chr(c)except TypeError:pass@@ -52,7 +51,7 @@ def s2n_intel(string):x = 0y = 0for c in string:- x |= ord_(c) << y+ x = x | (ord_(c) << y)y += + 8return xdiff --git a/ext/pyPdf/filters.py b/ext/pyPdf/filters.pyindex f669d0e9..7fe10fb4 100644--- a/ext/pyPdf/filters.py+++ b/ext/pyPdf/filters.py@@ -1,4 +1,3 @@-# -*- coding: utf-8 -*-# vim: sw=4:expandtab:foldmethod=marker## Copyright (c) 2006, Mathieu Fenniak@@ -107,7 +106,7 @@ class FlateDecode(object):if predictor != 1:columns = decodeParms["/Columns"]# PNG prediction:- if 10 <= predictor <= 15:+ if predictor >= 10 and predictor <= 15:output = StringIO()# PNG prediction can vary from row to rowrowlength = columns + 1@@ -192,7 +191,7 @@ class ASCII85Decode(object):breakelse:c = ord(c) - 33- assert 0 <= c < 85+ assert c >= 0 and c < 85group += [ c ]if len(group) >= 5:b = group[0] * (85**4) + \diff --git a/ext/pyPdf/generic.py b/ext/pyPdf/generic.pyindex 93af47e2..aaf50318 100644--- a/ext/pyPdf/generic.py+++ b/ext/pyPdf/generic.py@@ -1,4 +1,3 @@-# -*- coding: utf-8 -*-# vim: sw=4:expandtab:foldmethod=marker## Copyright (c) 2006, Mathieu Fenniak@@ -82,7 +81,7 @@ def readObject(stream, pdf):return NumberObject.readFromStream(stream)peek = stream.read(20)stream.seek(-len(peek), 1) # reset to start- if re.match(r"(\d+)\s(\d+)\sR[^a-zA-Z]", peek) is not None:+ if re.match(r"(\d+)\s(\d+)\sR[^a-zA-Z]", peek) != None:return IndirectObject.readFromStream(stream, pdf)else:return NumberObject.readFromStream(stream)@@ -170,7 +169,7 @@ class IndirectObject(PdfObject):def __eq__(self, other):return (- other is not None and+ other != None andisinstance(other, IndirectObject) andself.idnum == other.idnum andself.generation == other.generation and@@ -490,7 +489,7 @@ class DictionaryObject(dict, PdfObject):# return None if no metadata was found on the document root.def getXmpMetadata(self):metadata = self.get("/Metadata", None)- if metadata is None:+ if metadata == None:return Nonemetadata = metadata.getObject()import xmpdiff --git a/ext/pyPdf/pdf.py b/ext/pyPdf/pdf.pyindex 7e18bb8e..bf60d015 100644--- a/ext/pyPdf/pdf.py+++ b/ext/pyPdf/pdf.py@@ -48,6 +48,9 @@ try:except ImportError:from StringIO import StringIO+import filters+import utils+import warningsfrom generic import *from utils import readNonWhitespace, readUntilWhitespace, ConvertFunctionsToVirtualList@@ -195,7 +198,7 @@ class PdfFileWriter(object):# flag is on.def encrypt(self, user_pwd, owner_pwd = None, use_128bit = True):import time, random- if owner_pwd is None:+ if owner_pwd == None:owner_pwd = user_pwdif use_128bit:V = 2@@ -249,7 +252,7 @@ class PdfFileWriter(object):# copying in a new copy of the page object.for objIndex in xrange(len(self._objects)):obj = self._objects[objIndex]- if isinstance(obj, PageObject) and obj.indirectRef is not None:+ if isinstance(obj, PageObject) and obj.indirectRef != None:data = obj.indirectRefif not externalReferenceMap.has_key(data.pdf):externalReferenceMap[data.pdf] = {}@@ -338,7 +341,7 @@ class PdfFileWriter(object):return dataelse:newobj = externMap.get(data.pdf, {}).get(data.generation, {}).get(data.idnum, None)- if newobj is None:+ if newobj == None:newobj = data.pdf.getObject(data)self._objects.append(None) # placeholderidnum = len(self._objects)@@ -424,7 +427,7 @@ class PdfFileReader(object):# Stability: Added in v1.0, will exist for all v1.x releases.# @return Returns an integer.def getNumPages(self):- if self.flattenedPages is None:+ if self.flattenedPages == None:self._flatten()return len(self.flattenedPages)@@ -443,7 +446,7 @@ class PdfFileReader(object):def getPage(self, pageNumber):## ensure that we're not trying to access an encrypted PDF#assert not self.trailer.has_key("/Encrypt")- if self.flattenedPages is None:+ if self.flattenedPages == None:self._flatten()return self.flattenedPages[pageNumber]@@ -463,7 +466,7 @@ class PdfFileReader(object):# @return Returns a dict which maps names to {@link #Destination# destinations}.def getNamedDestinations(self, tree=None, retval=None):- if retval is None:+ if retval == None:retval = {}catalog = self.trailer["/Root"]@@ -475,7 +478,7 @@ class PdfFileReader(object):if names.has_key("/Dests"):tree = names['/Dests']- if tree is None:+ if tree == None:return retvalif tree.has_key("/Kids"):@@ -491,7 +494,7 @@ class PdfFileReader(object):if isinstance(val, DictionaryObject) and val.has_key('/D'):val = val['/D']dest = self._buildDestination(key, val)- if dest is not None:+ if dest != None:retval[key] = destreturn retval@@ -509,7 +512,7 @@ class PdfFileReader(object):# Stability: Added in v1.10, will exist for all future v1.x releases.# @return Returns a nested list of {@link #Destination destinations}.def getOutlines(self, node=None, outlines=None):- if outlines is None:+ if outlines == None:outlines = []catalog = self.trailer["/Root"]@@ -520,7 +523,7 @@ class PdfFileReader(object):node = lines["/First"]self._namedDests = self.getNamedDestinations()- if node is None:+ if node == None:return outlines# see if there are any more outlines@@ -586,9 +589,9 @@ class PdfFileReader(object):NameObject("/Resources"), NameObject("/MediaBox"),NameObject("/CropBox"), NameObject("/Rotate"))- if inherit is None:+ if inherit == None:inherit = dict()- if pages is None:+ if pages == None:self.flattenedPages = []catalog = self.trailer["/Root"].getObject()pages = catalog["/Pages"].getObject()@@ -614,7 +617,7 @@ class PdfFileReader(object):def getObject(self, indirectReference):retval = self.resolvedObjects.get(indirectReference.generation, {}).get(indirectReference.idnum, None)- if retval is not None:+ if retval != None:return retvalif indirectReference.generation == 0 and \self.xref_objStm.has_key(indirectReference.idnum):@@ -957,10 +960,10 @@ def getRectangle(self, name, defaults):retval = self.get(name)if isinstance(retval, RectangleObject):return retval- if retval is None:+ if retval == None:for d in defaults:retval = self.get(d)- if retval is not None:+ if retval != None:breakif isinstance(retval, IndirectObject):retval = self.pdf.getObject(retval)@@ -1692,7 +1695,7 @@ class Destination(DictionaryObject):def convertToInt(d, size):if size > 8:raise utils.PdfReadError("invalid size in convertToInt")- d += "\x00\x00\x00\x00\x00\x00\x00\x00"+ d = "\x00\x00\x00\x00\x00\x00\x00\x00" + dd = d[-8:]return struct.unpack(">q", d)[0]diff --git a/ext/pyPdf/utils.py b/ext/pyPdf/utils.pyindex 35670088..7c1d472d 100644--- a/ext/pyPdf/utils.py+++ b/ext/pyPdf/utils.py@@ -1,4 +1,3 @@-# -*- coding: utf-8 -*-# vim: sw=4:expandtab:foldmethod=marker## Copyright (c) 2006, Mathieu Fenniak@@ -79,7 +78,7 @@ class ConvertFunctionsToVirtualList(object):len_self = len(self)if index < 0:# support negative indexes- index += len_self+ index = len_self + indexif index < 0 or index >= len_self:raise IndexError, "sequence index out of range"return self.getFunction(index)diff --git a/ext/pyPdf/xmp.py b/ext/pyPdf/xmp.pyindex aa1e9c09..b070df90 100644--- a/ext/pyPdf/xmp.py+++ b/ext/pyPdf/xmp.py@@ -1,8 +1,8 @@-# -*- coding: utf-8 -*-import reimport datetimeimport decimalfrom generic import PdfObject+from xml.dom import getDOMImplementationfrom xml.dom.minidom import parseStringRDF_NAMESPACE = "http://www.w3.org/1999/02/22-rdf-syntax-ns#"@@ -66,7 +66,7 @@ class XmpInformation(PdfObject):for desc in self.rdfRoot.getElementsByTagNameNS(RDF_NAMESPACE, "Description"):if desc.getAttributeNS(RDF_NAMESPACE, "about") == aboutUri:attr = desc.getAttributeNodeNS(namespace, name)- if attr is not None:+ if attr != None:yield attrfor element in desc.getElementsByTagNameNS(namespace, name):yield element@@ -187,7 +187,7 @@ class XmpInformation(PdfObject):else:value = self._getText(element)break- if value is not None:+ if value != None:value = converter(value)ns_cache = self.cache.setdefault(namespace, {})ns_cache[name] = valuediff --git a/ext/pythonwhois/net.py b/ext/pythonwhois/net.pyindex 8e04fe78..53f87baf 100644--- a/ext/pythonwhois/net.py+++ b/ext/pythonwhois/net.py@@ -1,4 +1,3 @@-# -*- coding: utf-8 -*-import socket, re, sysfrom codecs import encode, decodefrom . import shared@@ -30,7 +29,7 @@ def get_whois_raw(domain, server="", previous=None, rfc3490=True, never_cut=Falsis_exception = Truetarget_server = exc_servbreak- if not is_exception:+ if is_exception == False:target_server = get_root_server(domain)else:target_server = server@@ -58,7 +57,7 @@ def get_whois_raw(domain, server="", previous=None, rfc3490=True, never_cut=Falsif re.search("Domain Name: %s\n" % domain.upper(), record):response = recordbreak- if not never_cut:+ if never_cut == False:new_list = [response] + previousserver_list.append(target_server)for line in [x.strip() for x in response.splitlines()]:diff --git a/ext/pythonwhois/parse.py b/ext/pythonwhois/parse.pyindex bc255e9d..66217d60 100644--- a/ext/pythonwhois/parse.py+++ b/ext/pythonwhois/parse.py@@ -1,4 +1,3 @@-# -*- coding: utf-8 -*-from __future__ import print_functionimport re, sys, datetime, csv, pkgutilfrom . import net, shared@@ -439,7 +438,7 @@ def parse_raw_whois(raw_data, normalized=None, never_query_handles=True, handle_for segment in raw_data:for rule_key, rule_regexes in grammar['_data'].items():- if not (rule_key in data):+ if (rule_key in data) == False:for line in segment.splitlines():for regex in rule_regexes:result = re.search(regex, line)@@ -891,11 +890,11 @@ def parse_registrants(data, never_query_handles=True, handle_server=""):if contact["handle"] == data_reference["handle"]:found = Truedata_reference.update(contact)- if not found:+ if found == False:# The contact definition was not found in the supplied raw WHOIS data. If the# method has been called with never_query_handles=False, we can use the supplied# WHOIS server for looking up the handle information separately.- if not never_query_handles:+ if never_query_handles == False:try:contact = fetch_nic_contact(data_reference["handle"], handle_server)data_reference.update(contact)diff --git a/ext/pythonwhois/shared.py b/ext/pythonwhois/shared.pyindex 7d20d478..0075da34 100644--- a/ext/pythonwhois/shared.py+++ b/ext/pythonwhois/shared.py@@ -1,3 +1,2 @@-# -*- coding: utf-8 -*-class WhoisException(Exception):passdiff --git a/ext/socks.py b/ext/socks.pyindex a32aa5a1..308eb783 100644--- a/ext/socks.py+++ b/ext/socks.py@@ -1,4 +1,3 @@-# -*- coding: utf-8 -*-"""SocksiPy - Python SOCKS module.Version 1.00@@ -46,6 +45,7 @@ to add getaddrinfo, as per http://stackoverflow.com/questions/13184205/dns-over-import socketimport struct+import sysPROXY_TYPE_SOCKS4 = 1PROXY_TYPE_SOCKS5 = 2@@ -114,7 +114,7 @@ def wrapmodule(module):This will only work on modules that import socket directly into the namespace;most of the Python Standard Library falls into this category."""- if _defaultproxy is not None:+ if _defaultproxy != None:module.socket.socket = socksocketelse:raise GeneralProxyError((4, "no proxy specified"))@@ -128,7 +128,7 @@ class socksocket(socket.socket):def __init__(self, family=socket.AF_INET, type=socket.SOCK_STREAM, proto=0, _sock=None):_orgsocket.__init__(self, family, type, proto, _sock)- if _defaultproxy is not None:+ if _defaultproxy != None:self.__proxy = _defaultproxyelse:self.__proxy = (None, None, None, None, None, None)@@ -171,7 +171,7 @@ class socksocket(socket.socket):Negotiates a connection through a SOCKS5 server."""# First we'll send the authentication packages we support.- if (self.__proxy[4] is not None) and (self.__proxy[5] is not None):+ if (self.__proxy[4]!=None) and (self.__proxy[5]!=None):# The username/password details were supplied to the# setproxy method so we support the USERNAME/PASSWORD# authentication (in addition to the standard none).@@ -228,7 +228,7 @@ class socksocket(socket.socket):# Resolve locallyipaddr = socket.inet_aton(socket.gethostbyname(destaddr))req = req + chr(0x01).encode() + ipaddr- req += struct.pack(">H", destport)+ req = req + struct.pack(">H", destport)self.sendall(req)# Get the responseresp = self.__recvall(4)@@ -253,7 +253,7 @@ class socksocket(socket.socket):raise GeneralProxyError((1,_generalerrors[1]))boundport = struct.unpack(">H", self.__recvall(2))[0]self.__proxysockname = (boundaddr, boundport)- if ipaddr is not None:+ if ipaddr != None:self.__proxypeername = (socket.inet_ntoa(ipaddr), destport)else:self.__proxypeername = (destaddr, destport)@@ -295,9 +295,9 @@ class socksocket(socket.socket):# Construct the request packetreq = struct.pack(">BBH", 0x04, 0x01, destport) + ipaddr# The username parameter is considered userid for SOCKS4- if self.__proxy[4] is not None:+ if self.__proxy[4] != None:req = req + self.__proxy[4]- req += chr(0x00).encode()+ req = req + chr(0x00).encode()# DNS name if remote resolving is required# NOTE: This is actually an extension to the SOCKS4 protocol# called SOCKS4A and may not be supported in all cases.@@ -320,7 +320,7 @@ class socksocket(socket.socket):raise Socks4Error((94, _socks4errors[4]))# Get the bound address/portself.__proxysockname = (socket.inet_ntoa(resp[4:]), struct.unpack(">H", resp[2:4])[0])- if rmtrslv is not None:+ if rmtrslv != None:self.__proxypeername = (socket.inet_ntoa(ipaddr), destport)else:self.__proxypeername = (destaddr, destport)@@ -367,27 +367,27 @@ class socksocket(socket.socket):if (not type(destpair) in (list,tuple)) or (len(destpair) < 2) or (type(destpair[0]) != type('')) or (type(destpair[1]) != int):raise GeneralProxyError((5, _generalerrors[5]))if self.__proxy[0] == PROXY_TYPE_SOCKS5:- if self.__proxy[2] is not None:+ if self.__proxy[2] != None:portnum = self.__proxy[2]else:portnum = 1080_orgsocket.connect(self, (self.__proxy[1], portnum))self.__negotiatesocks5(destpair[0], destpair[1])elif self.__proxy[0] == PROXY_TYPE_SOCKS4:- if self.__proxy[2] is not None:+ if self.__proxy[2] != None:portnum = self.__proxy[2]else:portnum = 1080_orgsocket.connect(self,(self.__proxy[1], portnum))self.__negotiatesocks4(destpair[0], destpair[1])elif self.__proxy[0] == PROXY_TYPE_HTTP:- if self.__proxy[2] is not None:+ if self.__proxy[2] != None:portnum = self.__proxy[2]else:portnum = 8080_orgsocket.connect(self,(self.__proxy[1], portnum))self.__negotiatehttp(destpair[0], destpair[1])- elif self.__proxy[0] is None:+ elif self.__proxy[0] == None:_orgsocket.connect(self, (destpair[0], destpair[1]))else:raise GeneralProxyError((4, _generalerrors[4]))