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

Imported Debian patch 0.7.4-1

Metadata-Version: 1.0
Name: rply
Version: 0.7.3
Version: 0.7.4
Summary: A pure Python Lex/Yacc that works with RPython
Home-page: UNKNOWN
Author: Alex Gaynor
......@@ -10,7 +10,7 @@ Description: RPLY
====
.. 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.
It is a more-or-less direct port of David Beazley's awesome PLY, with a new
......
......@@ -2,7 +2,7 @@ RPLY
====
.. 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.
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
* Drop 2001_dont_use_setuptools.patch as pypy-setuptools now exists.
......
......@@ -13,8 +13,11 @@ Build-Depends: cdbs (>= 0.4.97~),
pypy,
dh-python,
python-setuptools,
python-appdirs,
python3-setuptools,
pypy-setuptools
python3-appdirs,
pypy-setuptools,
pypy-appdirs
Standards-Version: 3.9.6
Homepage: https://github.com/alex/rply
Vcs-Svn: svn://anonscm.debian.org/python-modules/packages/python-rply/trunk/
......
appdirs pypy-appdirs; PEP386
Metadata-Version: 1.0
Name: rply
Version: 0.7.3
Version: 0.7.4
Summary: A pure Python Lex/Yacc that works with RPython
Home-page: UNKNOWN
Author: Alex Gaynor
......@@ -10,7 +10,7 @@ Description: RPLY
====
.. 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.
It is a more-or-less direct port of David Beazley's awesome PLY, with a new
......
......@@ -15,4 +15,5 @@ rply/utils.py
rply.egg-info/PKG-INFO
rply.egg-info/SOURCES.txt
rply.egg-info/dependency_links.txt
rply.egg-info/requires.txt
rply.egg-info/top_level.txt
\ No newline at end of file
......@@ -2,12 +2,12 @@ import hashlib
import json
import os
import random
import stat
import string
import sys
import tempfile
import warnings
from appdirs import AppDirs
from rply.errors import ParserGeneratorError, ParserGeneratorWarning
from rply.grammar import Grammar
from rply.parser import LRParser
......@@ -175,44 +175,28 @@ class ParserGenerator(object):
g.compute_first()
g.compute_follow()
# win32 temp directories are already per-user
if os.name == "nt":
cache_file = os.path.join(
tempfile.gettempdir(),
"rply-%s-%s-%s.json" % (
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)
)
cache_dir = AppDirs("rply").user_cache_dir
cache_file = os.path.join(
cache_dir,
"%s-%s-%s.json" % (
self.cache_id, self.VERSION, self.compute_grammar_hash(g)
)
)
table = None
if os.path.exists(cache_file):
with open(cache_file) as f:
data = json.load(f)
stat_result = os.fstat(f.fileno())
if (
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 self.data_is_valid(g, data):
table = LRTable.from_cache(g, data)
if table is None:
table = LRTable.from_grammar(g)
fd = os.open(
cache_file, os.O_RDWR | os.O_CREAT | os.O_EXCL, 0o0600
)
with os.fdopen(fd, "w") as f:
if not os.path.exists(cache_dir):
os.makedirs(cache_dir, mode=0o0700)
with open(cache_file, "w") as f:
json.dump(self.serialize_table(table), f)
if table.sr_conflicts:
warnings.warn(
"%d shift/reduce conflict%s" % (
......
......@@ -9,8 +9,9 @@ setup(
description="A pure Python Lex/Yacc that works with RPython",
long_description=readme,
# duplicated in docs/conf.py
version="0.7.3",
version="0.7.4",
author="Alex Gaynor",
author_email="alex.gaynor@gmail.com",
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