user1592772
user1592772

Reputation: 293

Pyparsing behaves differently on different machines

I want the following program to behave identically on my Ubuntu x86_64 desktop and Raspberry Pi, excluding the call to platform.machine().

test.py:

from pyparsing import QuotedString
import platform
print platform.machine()
string = QuotedString("'", escChar='\\')
print string.parseString(r"'abcd\\'")

On Ubuntu x86_64 desktop:

$ cat /etc/issue
Ubuntu 12.04.4 LTS

$ python --version
Python 2.7.3

$ python test.py
x86_64
['abcd\\']

On Raspberry Pi:

$ cat /etc/issue
Raspbian GNU/Linux 7

$ python --version
Python 2.7.3

$ python test.py
armv6l
['abcd\\\\']

Thanks.

Upvotes: 2

Views: 103

Answers (1)

pdw
pdw

Reputation: 8851

Pyparsing is not part of the standard Python distribution, it is a separate library. It seems like Ubuntu LTS 12.04 has pyparsing 1.5.2 and Raspbian has 2.0.2 (check using pyparsing.__version__). The pyparsing library probably changed behavior at some point.

Upvotes: 2

Related Questions