View | Details | Raw Unified | Return to bug 1212650
Collapse All | Expand All

(-)seamonkey-2.53.16.orig/build/pymake/mkformat.py (-1 / +1 lines)
Lines 6-12 Link Here
6
filename = sys.argv[1]
6
filename = sys.argv[1]
7
source = None
7
source = None
8
8
9
with open(filename, 'rU') as fh:
9
with open(filename, 'r') as fh:
10
    source = fh.read()
10
    source = fh.read()
11
11
12
statements = pymake.parser.parsestring(source, filename)
12
statements = pymake.parser.parsestring(source, filename)
(-)seamonkey-2.53.16.orig/build/pymake/mkparse.py (-1 / +1 lines)
Lines 5-11 Link Here
5
5
6
for f in sys.argv[1:]:
6
for f in sys.argv[1:]:
7
    print "Parsing %s" % f
7
    print "Parsing %s" % f
8
    fd = open(f, 'rU')
8
    fd = open(f, 'r')
9
    s = fd.read()
9
    s = fd.read()
10
    fd.close()
10
    fd.close()
11
    stmts = pymake.parser.parsestring(s, f)
11
    stmts = pymake.parser.parsestring(s, f)
(-)seamonkey-2.53.16.orig/build/pymake/pymake/parser.py (-1 / +1 lines)
Lines 347-353 Link Here
347
_varsettokens = (':=', '+=', '?=', '=')
347
_varsettokens = (':=', '+=', '?=', '=')
348
348
349
def _parsefile(pathname):
349
def _parsefile(pathname):
350
    fd = open(pathname, "rU")
350
    fd = open(pathname, "r")
351
    stmts = parsestring(fd.read(), pathname)
351
    stmts = parsestring(fd.read(), pathname)
352
    stmts.mtime = os.fstat(fd.fileno()).st_mtime
352
    stmts.mtime = os.fstat(fd.fileno()).st_mtime
353
    fd.close()
353
    fd.close()
(-)seamonkey-2.53.16.orig/build/pymake/tests/formattingtests.py (-1 / +1 lines)
Lines 253-259 Link Here
253
                continue
253
                continue
254
254
255
            source = None
255
            source = None
256
            with open(makefile, 'rU') as fh:
256
            with open(makefile, 'r') as fh:
257
                source = fh.read()
257
                source = fh.read()
258
258
259
            try:
259
            try:
(-)seamonkey-2.53.16.orig/dom/base/usecounters.py (-1 / +1 lines)
Lines 10-16 Link Here
10
10
11
def read_conf(conf_filename):
11
def read_conf(conf_filename):
12
    # Can't read/write from a single StringIO, so make a new one for reading.
12
    # Can't read/write from a single StringIO, so make a new one for reading.
13
    stream = open(conf_filename, 'rU')
13
    stream = open(conf_filename, 'r')
14
14
15
    def parse_counters(stream):
15
    def parse_counters(stream):
16
        for line_num, line in enumerate(stream):
16
        for line_num, line in enumerate(stream):
(-)seamonkey-2.53.16.orig/python/mozbuild/mozbuild/action/process_define_files.py (-1 / +1 lines)
Lines 36-42 Link Here
36
            not config.substs.get('JS_STANDALONE'):
36
            not config.substs.get('JS_STANDALONE'):
37
        config = PartialConfigEnvironment(mozpath.join(topobjdir, 'js', 'src'))
37
        config = PartialConfigEnvironment(mozpath.join(topobjdir, 'js', 'src'))
38
38
39
    with open(path, 'rU') as input:
39
    with open(path, 'r') as input:
40
        r = re.compile('^\s*#\s*(?P<cmd>[a-z]+)(?:\s+(?P<name>\S+)(?:\s+(?P<value>\S+))?)?', re.U)
40
        r = re.compile('^\s*#\s*(?P<cmd>[a-z]+)(?:\s+(?P<name>\S+)(?:\s+(?P<value>\S+))?)?', re.U)
41
        for l in input:
41
        for l in input:
42
            m = r.match(l)
42
            m = r.match(l)
(-)seamonkey-2.53.16.orig/python/mozbuild/mozbuild/backend/base.py (-1 / +1 lines)
Lines 265-271 Link Here
265
        return status
265
        return status
266
266
267
    @contextmanager
267
    @contextmanager
268
    def _write_file(self, path=None, fh=None, readmode='rU'):
268
    def _write_file(self, path=None, fh=None, readmode='r'):
269
        """Context manager to write a file.
269
        """Context manager to write a file.
270
270
271
        This is a glorified wrapper around FileAvoidWrite with integration to
271
        This is a glorified wrapper around FileAvoidWrite with integration to
(-)seamonkey-2.53.16.orig/python/mozbuild/mozbuild/preprocessor.py (-3 / +3 lines)
Lines 517-523 Link Here
517
517
518
        if args:
518
        if args:
519
            for f in args:
519
            for f in args:
520
                with io.open(f, 'rU', encoding='utf-8') as input:
520
                with io.open(f, 'r', encoding='utf-8') as input:
521
                    self.processFile(input=input, output=out)
521
                    self.processFile(input=input, output=out)
522
            if depfile:
522
            if depfile:
523
                mk = Makefile()
523
                mk = Makefile()
Lines 806-812 Link Here
806
                    args = self.applyFilters(args)
806
                    args = self.applyFilters(args)
807
                if not os.path.isabs(args):
807
                if not os.path.isabs(args):
808
                    args = os.path.join(self.curdir, args)
808
                    args = os.path.join(self.curdir, args)
809
                args = io.open(args, 'rU', encoding='utf-8')
809
                args = io.open(args, 'r', encoding='utf-8')
810
            except Preprocessor.Error:
810
            except Preprocessor.Error:
811
                raise
811
                raise
812
            except Exception:
812
            except Exception:
Lines 861-867 Link Here
861
    pp = Preprocessor(defines=defines,
861
    pp = Preprocessor(defines=defines,
862
                      marker=marker)
862
                      marker=marker)
863
    for f in includes:
863
    for f in includes:
864
        with io.open(f, 'rU', encoding='utf-8') as input:
864
        with io.open(f, 'r', encoding='utf-8') as input:
865
            pp.processFile(input=input, output=output)
865
            pp.processFile(input=input, output=output)
866
    return pp.includes
866
    return pp.includes
867
867
(-)seamonkey-2.53.16.orig/python/mozbuild/mozbuild/util.py (-1 / +1 lines)
Lines 227-233 Link Here
227
    still occur, as well as diff capture if requested.
227
    still occur, as well as diff capture if requested.
228
    """
228
    """
229
229
230
    def __init__(self, filename, capture_diff=False, dry_run=False, readmode='rU'):
230
    def __init__(self, filename, capture_diff=False, dry_run=False, readmode='r'):
231
        BytesIO.__init__(self)
231
        BytesIO.__init__(self)
232
        self.name = filename
232
        self.name = filename
233
        assert type(capture_diff) == bool
233
        assert type(capture_diff) == bool
(-)seamonkey-2.53.16.orig/python/mozbuild/mozbuild/virtualenv.py (-1 / +1 lines)
Lines 255-261 Link Here
255
        return self.virtualenv_root
255
        return self.virtualenv_root
256
256
257
    def packages(self):
257
    def packages(self):
258
        mode = 'rU' if PY2 else 'r'
258
        mode = 'r' if PY2 else 'r'
259
        with open(self.manifest_path, mode) as fh:
259
        with open(self.manifest_path, mode) as fh:
260
            packages = [line.rstrip().split(':')
260
            packages = [line.rstrip().split(':')
261
                        for line in fh]
261
                        for line in fh]
(-)seamonkey-2.53.16.orig/python/mozbuild/mozpack/files.py (-2 / +2 lines)
Lines 522-528 Link Here
522
        pp = Preprocessor(defines=self.defines, marker=self.marker)
522
        pp = Preprocessor(defines=self.defines, marker=self.marker)
523
        pp.setSilenceDirectiveWarnings(self.silence_missing_directive_warnings)
523
        pp.setSilenceDirectiveWarnings(self.silence_missing_directive_warnings)
524
524
525
        with open(self.path, 'rU') as input:
525
        with open(self.path, 'r') as input:
526
            with open(os.devnull, 'w') as output:
526
            with open(os.devnull, 'w') as output:
527
                pp.processFile(input=input, output=output)
527
                pp.processFile(input=input, output=output)
528
528
Lines 578-584 Link Here
578
        pp = Preprocessor(defines=self.defines, marker=self.marker)
578
        pp = Preprocessor(defines=self.defines, marker=self.marker)
579
        pp.setSilenceDirectiveWarnings(self.silence_missing_directive_warnings)
579
        pp.setSilenceDirectiveWarnings(self.silence_missing_directive_warnings)
580
580
581
        with open(self.path, 'rU') as input:
581
        with open(self.path, 'r') as input:
582
            pp.processFile(input=input, output=dest, depfile=deps_out)
582
            pp.processFile(input=input, output=dest, depfile=deps_out)
583
583
584
        dest.close()
584
        dest.close()
(-)seamonkey-2.53.16.orig/testing/mozharness/external_tools/virtualenv/site.py (-2 / +2 lines)
Lines 163-169 Link Here
163
        reset = 0
163
        reset = 0
164
    fullname = os.path.join(sitedir, name)
164
    fullname = os.path.join(sitedir, name)
165
    try:
165
    try:
166
        f = open(fullname, "rU")
166
        f = open(fullname, "r")
167
    except IOError:
167
    except IOError:
168
        return
168
        return
169
    try:
169
    try:
Lines 427-433 Link Here
427
            for filename in self.__files:
427
            for filename in self.__files:
428
                filename = os.path.join(dir, filename)
428
                filename = os.path.join(dir, filename)
429
                try:
429
                try:
430
                    fp = open(filename, "rU")
430
                    fp = open(filename, "r")
431
                    data = fp.read()
431
                    data = fp.read()
432
                    fp.close()
432
                    fp.close()
433
                    break
433
                    break
(-)seamonkey-2.53.16.orig/testing/mozharness/external_tools/virtualenv/virtualenv_embedded/site.py (-2 / +2 lines)
Lines 162-168 Link Here
162
        reset = 0
162
        reset = 0
163
    fullname = os.path.join(sitedir, name)
163
    fullname = os.path.join(sitedir, name)
164
    try:
164
    try:
165
        f = open(fullname, "rU")
165
        f = open(fullname, "r")
166
    except IOError:
166
    except IOError:
167
        return
167
        return
168
    try:
168
    try:
Lines 426-432 Link Here
426
            for filename in self.__files:
426
            for filename in self.__files:
427
                filename = os.path.join(dir, filename)
427
                filename = os.path.join(dir, filename)
428
                try:
428
                try:
429
                    fp = open(filename, "rU")
429
                    fp = open(filename, "r")
430
                    data = fp.read()
430
                    data = fp.read()
431
                    fp.close()
431
                    fp.close()
432
                    break
432
                    break
(-)seamonkey-2.53.16.orig/testing/web-platform/tests/tools/py/py/_path/common.py (-2 / +2 lines)
Lines 136-145 Link Here
136
        """ read and return a list of lines from the path. if cr is False, the
136
        """ read and return a list of lines from the path. if cr is False, the
137
newline will be removed from the end of each line. """
137
newline will be removed from the end of each line. """
138
        if not cr:
138
        if not cr:
139
            content = self.read('rU')
139
            content = self.read('r')
140
            return content.split('\n')
140
            return content.split('\n')
141
        else:
141
        else:
142
            f = self.open('rU')
142
            f = self.open('r')
143
            try:
143
            try:
144
                return f.readlines()
144
                return f.readlines()
145
            finally:
145
            finally:
(-)seamonkey-2.53.16.orig/testing/web-platform/tests/tools/py/py/_path/svnurl.py (-1 / +1 lines)
Lines 97-103 Link Here
97
97
98
    def open(self, mode='r'):
98
    def open(self, mode='r'):
99
        """ return an opened file with the given mode. """
99
        """ return an opened file with the given mode. """
100
        if mode not in ("r", "rU",):
100
        if mode not in ("r", "r",):
101
            raise ValueError("mode %r not supported" % (mode,))
101
            raise ValueError("mode %r not supported" % (mode,))
102
        assert self.check(file=1) # svn cat returns an empty file otherwise
102
        assert self.check(file=1) # svn cat returns an empty file otherwise
103
        if self.rev is None:
103
        if self.rev is None:
(-)seamonkey-2.53.16.orig/third_party/python/py/py/_path/common.py (-1 / +1 lines)
Lines 174-180 Link Here
174
        """ read and return a list of lines from the path. if cr is False, the
174
        """ read and return a list of lines from the path. if cr is False, the
175
newline will be removed from the end of each line. """
175
newline will be removed from the end of each line. """
176
        if sys.version_info < (3, ):
176
        if sys.version_info < (3, ):
177
            mode = 'rU'
177
            mode = 'r'
178
        else:  # python 3 deprecates mode "U" in favor of "newline" option
178
        else:  # python 3 deprecates mode "U" in favor of "newline" option
179
            mode = 'r'
179
            mode = 'r'
180
180
(-)seamonkey-2.53.16.orig/third_party/python/py/py/_path/svnurl.py (-1 / +1 lines)
Lines 97-103 Link Here
97
97
98
    def open(self, mode='r'):
98
    def open(self, mode='r'):
99
        """ return an opened file with the given mode. """
99
        """ return an opened file with the given mode. """
100
        if mode not in ("r", "rU",):
100
        if mode not in ("r", "r",):
101
            raise ValueError("mode %r not supported" % (mode,))
101
            raise ValueError("mode %r not supported" % (mode,))
102
        assert self.check(file=1) # svn cat returns an empty file otherwise
102
        assert self.check(file=1) # svn cat returns an empty file otherwise
103
        if self.rev is None:
103
        if self.rev is None:

Return to bug 1212650