Commit 4cd3525f authored by Tristan Seligmann's avatar Tristan Seligmann

Imported Debian patch 0.7.4-1

Metadata-Version: 1.0 Metadata-Version: 1.0
Name: rply Name: rply
Version: 0.7.3 Version: 0.7.4
Summary: A pure Python Lex/Yacc that works with RPython Summary: A pure Python Lex/Yacc that works with RPython
Home-page: UNKNOWN Home-page: UNKNOWN
Author: Alex Gaynor Author: Alex Gaynor
...@@ -10,7 +10,7 @@ Description: RPLY ...@@ -10,7 +10,7 @@ Description: RPLY
==== ====
.. image:: https://secure.travis-ci.org/alex/rply.png .. image:: https://secure.travis-ci.org/alex/rply.png
:target: http://travis-ci.org/alex/rply :target: https://travis-ci.org/alex/rply
Welcome to RPLY! A pure python parser generator, that also works with RPython. Welcome to RPLY! A pure python parser generator, that also works with RPython.
It is a more-or-less direct port of David Beazley's awesome PLY, with a new It is a more-or-less direct port of David Beazley's awesome PLY, with a new
......
...@@ -2,7 +2,7 @@ RPLY ...@@ -2,7 +2,7 @@ RPLY
==== ====
.. image:: https://secure.travis-ci.org/alex/rply.png .. image:: https://secure.travis-ci.org/alex/rply.png
:target: http://travis-ci.org/alex/rply :target: https://travis-ci.org/alex/rply
Welcome to RPLY! A pure python parser generator, that also works with RPython. Welcome to RPLY! A pure python parser generator, that also works with RPython.
It is a more-or-less direct port of David Beazley's awesome PLY, with a new It is a more-or-less direct port of David Beazley's awesome PLY, with a new
......
python-rply (0.7.4-1) unstable; urgency=medium
* New upstream release.
- Stop using /tmp entirely; this fixes the remaining insecure handling
issue (Closes: #737627).
-- Tristan Seligmann <mithrandi@debian.org> Fri, 04 Sep 2015 07:16:00 +0200
python-rply (0.7.3-3) unstable; urgency=medium python-rply (0.7.3-3) unstable; urgency=medium
* Drop 2001_dont_use_setuptools.patch as pypy-setuptools now exists. * Drop 2001_dont_use_setuptools.patch as pypy-setuptools now exists.
......
...@@ -13,8 +13,11 @@ Build-Depends: cdbs (>= 0.4.97~), ...@@ -13,8 +13,11 @@ Build-Depends: cdbs (>= 0.4.97~),
pypy, pypy,
dh-python, dh-python,
python-setuptools, python-setuptools,
python-appdirs,
python3-setuptools, python3-setuptools,
pypy-setuptools python3-appdirs,
pypy-setuptools,
pypy-appdirs
Standards-Version: 3.9.6 Standards-Version: 3.9.6
Homepage: https://github.com/alex/rply Homepage: https://github.com/alex/rply
Vcs-Svn: svn://anonscm.debian.org/python-modules/packages/python-rply/trunk/ Vcs-Svn: svn://anonscm.debian.org/python-modules/packages/python-rply/trunk/
......
appdirs pypy-appdirs; PEP386
Metadata-Version: 1.0 Metadata-Version: 1.0
Name: rply Name: rply
Version: 0.7.3 Version: 0.7.4
Summary: A pure Python Lex/Yacc that works with RPython Summary: A pure Python Lex/Yacc that works with RPython
Home-page: UNKNOWN Home-page: UNKNOWN
Author: Alex Gaynor Author: Alex Gaynor
...@@ -10,7 +10,7 @@ Description: RPLY ...@@ -10,7 +10,7 @@ Description: RPLY
==== ====
.. image:: https://secure.travis-ci.org/alex/rply.png .. image:: https://secure.travis-ci.org/alex/rply.png
:target: http://travis-ci.org/alex/rply :target: https://travis-ci.org/alex/rply
Welcome to RPLY! A pure python parser generator, that also works with RPython. Welcome to RPLY! A pure python parser generator, that also works with RPython.
It is a more-or-less direct port of David Beazley's awesome PLY, with a new It is a more-or-less direct port of David Beazley's awesome PLY, with a new
......
...@@ -15,4 +15,5 @@ rply/utils.py ...@@ -15,4 +15,5 @@ rply/utils.py
rply.egg-info/PKG-INFO rply.egg-info/PKG-INFO
rply.egg-info/SOURCES.txt rply.egg-info/SOURCES.txt
rply.egg-info/dependency_links.txt rply.egg-info/dependency_links.txt
rply.egg-info/requires.txt
rply.egg-info/top_level.txt rply.egg-info/top_level.txt
\ No newline at end of file
...@@ -2,12 +2,12 @@ import hashlib ...@@ -2,12 +2,12 @@ import hashlib
import json import json
import os import os
import random import random
import stat
import string import string
import sys import sys
import tempfile
import warnings import warnings
from appdirs import AppDirs
from rply.errors import ParserGeneratorError, ParserGeneratorWarning from rply.errors import ParserGeneratorError, ParserGeneratorWarning
from rply.grammar import Grammar from rply.grammar import Grammar
from rply.parser import LRParser from rply.parser import LRParser
...@@ -175,44 +175,28 @@ class ParserGenerator(object): ...@@ -175,44 +175,28 @@ class ParserGenerator(object):
g.compute_first() g.compute_first()
g.compute_follow() g.compute_follow()
# win32 temp directories are already per-user cache_dir = AppDirs("rply").user_cache_dir
if os.name == "nt": cache_file = os.path.join(
cache_file = os.path.join( cache_dir,
tempfile.gettempdir(), "%s-%s-%s.json" % (
"rply-%s-%s-%s.json" % ( self.cache_id, self.VERSION, self.compute_grammar_hash(g)
self.VERSION, self.cache_id, self.compute_grammar_hash(g)
)
)
else:
cache_file = os.path.join(
tempfile.gettempdir(),
"rply-%s-%s-%s-%s.json" % (
self.VERSION,
os.getuid(),
self.cache_id,
self.compute_grammar_hash(g)
)
) )
)
table = None table = None
if os.path.exists(cache_file): if os.path.exists(cache_file):
with open(cache_file) as f: with open(cache_file) as f:
data = json.load(f) data = json.load(f)
stat_result = os.fstat(f.fileno()) if self.data_is_valid(g, data):
if ( table = LRTable.from_cache(g, data)
os.name == "nt" or (
stat_result.st_uid == os.getuid() and
stat.S_IMODE(stat_result.st_mode) == 0o0600
)
):
if self.data_is_valid(g, data):
table = LRTable.from_cache(g, data)
if table is None: if table is None:
table = LRTable.from_grammar(g) table = LRTable.from_grammar(g)
fd = os.open( if not os.path.exists(cache_dir):
cache_file, os.O_RDWR | os.O_CREAT | os.O_EXCL, 0o0600 os.makedirs(cache_dir, mode=0o0700)
)
with os.fdopen(fd, "w") as f: with open(cache_file, "w") as f:
json.dump(self.serialize_table(table), f) json.dump(self.serialize_table(table), f)
if table.sr_conflicts: if table.sr_conflicts:
warnings.warn( warnings.warn(
"%d shift/reduce conflict%s" % ( "%d shift/reduce conflict%s" % (
......
...@@ -9,8 +9,9 @@ setup( ...@@ -9,8 +9,9 @@ setup(
description="A pure Python Lex/Yacc that works with RPython", description="A pure Python Lex/Yacc that works with RPython",
long_description=readme, long_description=readme,
# duplicated in docs/conf.py # duplicated in docs/conf.py
version="0.7.3", version="0.7.4",
author="Alex Gaynor", author="Alex Gaynor",
author_email="alex.gaynor@gmail.com", author_email="alex.gaynor@gmail.com",
packages=["rply"], packages=["rply"],
install_requires=["appdirs"],
) )
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment