<feed xmlns='http://www.w3.org/2005/Atom'>
<title>delta/python-json-patch.git/bin, branch test-pypy</title>
<subtitle>github.com: stefankoegl/python-json-patch.git
</subtitle>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/python-json-patch.git/'/>
<entry>
<title>Add support for preserving Unicode characters in jsonpatch CLI</title>
<updated>2021-03-03T07:54:40+00:00</updated>
<author>
<name>Genzer Hawker</name>
<email>genzers@gmail.com</email>
</author>
<published>2021-03-03T07:24:31+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/python-json-patch.git/commit/?id=974d54f393de78ce21bee9897cee8f1ace5813ee'/>
<id>974d54f393de78ce21bee9897cee8f1ace5813ee</id>
<content type='text'>
If the JSON content contains some Unicode characters, the jsonpatch
final output will encode the Unicode character using ASCII (i.e
`\u0394`). This behaviour comes from the module `json.dump()` governed
by a flag `ensure_ascii`[1].

For example:

```json
/* patch.json */
[{
  "op": "add",
  "path": "/SomeUnicodeSamples",
  "value": "𝒞𝘋𝙴𝓕ĢȞỈ𝕵 đ áê 🤩 äÄöÖüÜß"
}]
```

After applying the patch on an empty source file `{}`, this is the
output:

```json
{"SomeUnicodeSamples": "\ud835\udc9e\ud835\ude0b...\u00fc\u00dc\u00df"}
```

This commit adds a flag `-u|--preserve-unicode` in the jsonpatch CLI
to configure the behaviour of `json.dump`'s `ensure_ascii` flag.

Using the `--preserve-unicode` flag, the cli will print the Unicode
characters as-is without any encoding.

[1]: https://docs.python.org/3/library/json.html#basic-usage
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
If the JSON content contains some Unicode characters, the jsonpatch
final output will encode the Unicode character using ASCII (i.e
`\u0394`). This behaviour comes from the module `json.dump()` governed
by a flag `ensure_ascii`[1].

For example:

```json
/* patch.json */
[{
  "op": "add",
  "path": "/SomeUnicodeSamples",
  "value": "𝒞𝘋𝙴𝓕ĢȞỈ𝕵 đ áê 🤩 äÄöÖüÜß"
}]
```

After applying the patch on an empty source file `{}`, this is the
output:

```json
{"SomeUnicodeSamples": "\ud835\udc9e\ud835\ude0b...\u00fc\u00dc\u00df"}
```

This commit adds a flag `-u|--preserve-unicode` in the jsonpatch CLI
to configure the behaviour of `json.dump`'s `ensure_ascii` flag.

Using the `--preserve-unicode` flag, the cli will print the Unicode
characters as-is without any encoding.

[1]: https://docs.python.org/3/library/json.html#basic-usage
</pre>
</div>
</content>
</entry>
<entry>
<title>Remove ununsed imports and variables</title>
<updated>2018-01-16T12:24:29+00:00</updated>
<author>
<name>Hugo</name>
<email>hugovk@users.noreply.github.com</email>
</author>
<published>2018-01-16T12:24:29+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/python-json-patch.git/commit/?id=d5a7aed0debac7f08265b0f1bf745bfaadc6e719'/>
<id>d5a7aed0debac7f08265b0f1bf745bfaadc6e719</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>If there is no diff print nothing; exit 1 if a diff is found (#53)</title>
<updated>2016-10-02T14:41:55+00:00</updated>
<author>
<name>Greg Cockburn</name>
<email>gergnz@gmail.com</email>
</author>
<published>2016-10-02T14:41:55+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/python-json-patch.git/commit/?id=4e95310faedaab387bd1068411232cddcd3bb216'/>
<id>4e95310faedaab387bd1068411232cddcd3bb216</id>
<content type='text'>
if there is no diff print nothing, and exit 1 if a diff is found</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
if there is no diff print nothing, and exit 1 if a diff is found</pre>
</div>
</content>
</entry>
<entry>
<title>note why we use the same directory</title>
<updated>2014-02-05T02:11:49+00:00</updated>
<author>
<name>Matt Behrens</name>
<email>matt@zigg.com</email>
</author>
<published>2014-02-05T02:11:49+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/python-json-patch.git/commit/?id=d0ec2690b47e3f674f997b8093f839e92d0111a6'/>
<id>d0ec2690b47e3f674f997b8093f839e92d0111a6</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>add commentary and replace tabs with spaces</title>
<updated>2014-02-05T01:29:47+00:00</updated>
<author>
<name>Matt Behrens</name>
<email>matt@zigg.com</email>
</author>
<published>2014-02-05T01:29:47+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/python-json-patch.git/commit/?id=506730a1be916711b8f5a34a2a9cc11f6cc09e45'/>
<id>506730a1be916711b8f5a34a2a9cc11f6cc09e45</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>add --backup flag and attempt to address various exceptions that may be raised</title>
<updated>2014-01-15T01:08:38+00:00</updated>
<author>
<name>Matt Behrens</name>
<email>matt@zigg.com</email>
</author>
<published>2014-01-15T00:53:41+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/python-json-patch.git/commit/?id=1d285a80286e92bf1f90202032b6b24ecbdd015f'/>
<id>1d285a80286e92bf1f90202032b6b24ecbdd015f</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>add in-place patching and patch read from stdin.  enables use of</title>
<updated>2013-12-12T16:48:07+00:00</updated>
<author>
<name>Matt Behrens</name>
<email>matt@zigg.com</email>
</author>
<published>2013-12-12T16:48:07+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/python-json-patch.git/commit/?id=c06e7871b849ae7486656b14331eb7fc32d44396'/>
<id>c06e7871b849ae7486656b14331eb7fc32d44396</id>
<content type='text'>
jsonpatch in a shell script like so:

cat &lt;&lt;EOT | jsonpatch -i a.json
[{"path": "/foo", "value": "baz", "op": "replace"}]
EOT

which will edit a.json in-place and leave a backup in a.json.orig.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
jsonpatch in a shell script like so:

cat &lt;&lt;EOT | jsonpatch -i a.json
[{"path": "/foo", "value": "baz", "op": "replace"}]
EOT

which will edit a.json in-place and leave a backup in a.json.orig.
</pre>
</div>
</content>
</entry>
<entry>
<title>typo</title>
<updated>2013-10-12T10:21:41+00:00</updated>
<author>
<name>Stefan Kögl</name>
<email>stefan@skoegl.net</email>
</author>
<published>2013-10-12T10:21:41+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/python-json-patch.git/commit/?id=1fbd5eccf61665eb4c13dc0164440472c8a790ef'/>
<id>1fbd5eccf61665eb4c13dc0164440472c8a790ef</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>add "jsonpatch" commandline utility</title>
<updated>2013-10-11T18:43:20+00:00</updated>
<author>
<name>Stefan Kögl</name>
<email>stefan@skoegl.net</email>
</author>
<published>2013-10-11T18:43:20+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/python-json-patch.git/commit/?id=9290130d30fbd4ef8ecc4c313a10dbfc37276b93'/>
<id>9290130d30fbd4ef8ecc4c313a10dbfc37276b93</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>add "jsondiff" commandline utility</title>
<updated>2013-10-11T18:33:29+00:00</updated>
<author>
<name>Stefan Kögl</name>
<email>stefan@skoegl.net</email>
</author>
<published>2013-10-11T18:33:29+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/python-json-patch.git/commit/?id=3b841b3ffc54f4e1ea65320c80dcc4ce0b139a36'/>
<id>3b841b3ffc54f4e1ea65320c80dcc4ce0b139a36</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
</feed>
