Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

spurious i8 in src/objects/string.rs #93

Closed
itdaniher opened this issue Nov 27, 2017 · 2 comments
Closed

spurious i8 in src/objects/string.rs #93

itdaniher opened this issue Nov 27, 2017 · 2 comments

Comments

@itdaniher
Copy link

(tokio) rocklobster:~/python/tokio $ python setup.py build
running build
running build_py
running egg_info
writing tokio.egg-info/PKG-INFO
writing dependency_links to tokio.egg-info/dependency_links.txt
error[E0308]: mismatched typesio.egg-info/top_level.txt
  --> /home/name/.cargo/git/checkouts/pyo3-a22e69bc62b9f0fd/68937db/src/objects/string.rs:54:21
   |> /home/name/.cargo/git/checkouts/pyo3-a22e69bc62b9f0fd/68937db/src/objects/string.rs:53:21
   = note: expected type `*const u8`tr() as *const i8)) pyo3/python3 pyo3/extension-module --release -- --crate-type cderror: aborting due to 2 previous errors^^^^^^^^^^^^^ expected u8, found i8
error: cargo failed with code: 101^^^^^^^^^^^^^^^^^^^^^ expected u8, found i8
To learn more, run the command again with --verbose.

Python 3.6.3
rustc 1.23.0-nightly (827cb0d61 2017-11-26)
aarch64
PyO3 e7a7b3d
see also: PyO3/tokio#77

solved via:

diff --git a/src/objects/string.rs b/src/objects/string.rs
index ca5c5e7..8599244 100644
--- a/src/objects/string.rs
+++ b/src/objects/string.rs
@@ -50,8 +50,8 @@ impl PyString {
             src.py().from_owned_ptr_or_err::<PyString>(
                 ffi::PyUnicode_FromEncodedObject(
                     src.as_ptr(),
-                    encoding.as_ptr() as *const i8,
-                    errors.as_ptr() as *const i8))
+                    encoding.as_ptr() as *const u8,
+                    errors.as_ptr() as *const u8))
         }
     }
fafhrd91 added a commit that referenced this issue Nov 27, 2017
@fafhrd91
Copy link
Contributor

should be fixed

@fafhrd91
Copy link
Contributor

could you check master? reopen if error persists

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants