<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Dec 12, 2019 at 9:14 AM Raphaël Gomès <<a href="mailto:raphael.gomes@octobus.net">raphael.gomes@octobus.net</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"># HG changeset patch<br>
# User Raphaël Gomès <<a href="mailto:rgomes@octobus.net" target="_blank">rgomes@octobus.net</a>><br>
# Date 1574095079 -3600<br>
#      Mon Nov 18 17:37:59 2019 +0100<br>
# Branch stable<br>
# Node ID 2f084275a6435092058eaf9cb1a46cc6d7b0821a<br>
# Parent  697e5119ce5d2ae8c7ef048a8a18e2b15c7af17a<br>
py3: send bytes from Rust-created warning patterns<br>
<br>
Python code expects bytes in both Python 2 and Python 3, so we should send<br>
bytes.<br>
<br>
Differential Revision: <a href="https://phab.mercurial-scm.org/D7454" rel="noreferrer" target="_blank">https://phab.mercurial-scm.org/D7454</a></blockquote><div><br></div><div>delete?</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><br>
<br>
diff -r 697e5119ce5d -r 2f084275a643 rust/hg-cpython/src/<a href="http://filepatterns.rs" rel="noreferrer" target="_blank">filepatterns.rs</a><br>
--- a/rust/hg-cpython/src/<a href="http://filepatterns.rs" rel="noreferrer" target="_blank">filepatterns.rs</a>       Mon Nov 18 17:34:44 2019 +0100<br>
+++ b/rust/hg-cpython/src/<a href="http://filepatterns.rs" rel="noreferrer" target="_blank">filepatterns.rs</a>       Mon Nov 18 17:37:59 2019 +0100<br>
@@ -13,8 +13,7 @@<br>
 //!<br>
 use crate::exceptions::{PatternError, PatternFileError};<br>
 use cpython::{<br>
-    PyBytes, PyDict, PyModule, PyObject, PyResult, PyString, PyTuple, Python,<br>
-    ToPyObject,<br>
+    PyBytes, PyDict, PyModule, PyObject, PyResult, PyTuple, Python, ToPyObject,<br>
 };<br>
 use hg::{<br>
     build_single_regex, read_pattern_file, utils::files::get_path_from_bytes,<br>
@@ -66,12 +65,12 @@<br>
 fn warnings_to_py_bytes(<br>
     py: Python,<br>
     warnings: &[(PathBuf, Vec<u8>)],<br>
-) -> Vec<(PyString, PyBytes)> {<br>
+) -> Vec<(PyBytes, PyBytes)> {<br>
     warnings<br>
         .iter()<br>
         .map(|(path, syn)| {<br>
             (<br>
-                PyString::new(py, &path.to_string_lossy()),<br>
+                PyBytes::new(py, &path.to_string_lossy().as_bytes()),<br>
                 PyBytes::new(py, syn),<br>
             )<br>
         })<br>
_______________________________________________<br>
Mercurial-devel mailing list<br>
<a href="mailto:Mercurial-devel@mercurial-scm.org" target="_blank">Mercurial-devel@mercurial-scm.org</a><br>
<a href="https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel" rel="noreferrer" target="_blank">https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel</a><br>
</blockquote></div></div>