From 2ca1e59bb60e27abc858fc271b91ef5ba4f6b6a6 Mon Sep 17 00:00:00 2001 From: Brian Cain Date: Fri, 24 Jul 2020 23:06:49 -0500 Subject: [PATCH 01/11] Hexagon libstd: update type defs --- library/std/src/os/linux/raw.rs | 48 ++++++++++++++++----------------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/library/std/src/os/linux/raw.rs b/library/std/src/os/linux/raw.rs index eb8589eb58f..1950ffcb21b 100644 --- a/library/std/src/os/linux/raw.rs +++ b/library/std/src/os/linux/raw.rs @@ -170,63 +170,63 @@ mod arch { #[cfg(target_arch = "hexagon")] mod arch { - use crate::os::raw::{c_int, c_long, c_longlong, c_ulonglong}; + use crate::os::raw::{c_int, c_long, c_uint}; #[stable(feature = "raw_ext", since = "1.1.0")] - pub type blkcnt_t = c_longlong; + pub type blkcnt_t = i64; #[stable(feature = "raw_ext", since = "1.1.0")] pub type blksize_t = c_long; #[stable(feature = "raw_ext", since = "1.1.0")] - pub type ino_t = c_ulonglong; + pub type ino_t = u64; #[stable(feature = "raw_ext", since = "1.1.0")] pub type nlink_t = c_uint; #[stable(feature = "raw_ext", since = "1.1.0")] - pub type off_t = c_longlong; + pub type off_t = i64; #[stable(feature = "raw_ext", since = "1.1.0")] - pub type time_t = c_long; + pub type time_t = i64; #[repr(C)] #[derive(Clone)] #[stable(feature = "raw_ext", since = "1.1.0")] pub struct stat { #[stable(feature = "raw_ext", since = "1.1.0")] - pub st_dev: ::dev_t, + pub st_dev: u64, #[stable(feature = "raw_ext", since = "1.1.0")] - pub st_ino: ::c_ulonglong, + pub st_ino: u64, #[stable(feature = "raw_ext", since = "1.1.0")] - pub st_mode: ::c_uint, + pub st_mode: u32, #[stable(feature = "raw_ext", since = "1.1.0")] - pub st_nlink: ::c_uint, + pub st_nlink: u32, #[stable(feature = "raw_ext", since = "1.1.0")] - pub st_uid: ::c_uint, + pub st_uid: u32, #[stable(feature = "raw_ext", since = "1.1.0")] - pub st_gid: ::c_uint, + pub st_gid: u32, #[stable(feature = "raw_ext", since = "1.1.0")] - pub st_rdev: ::c_ulonglong, + pub st_rdev: u64, #[stable(feature = "raw_ext", since = "1.1.0")] - pub __pad1: ::c_ulong, + pub __pad1: u32, #[stable(feature = "raw_ext", since = "1.1.0")] - pub st_size: ::c_longlong, + pub st_size: i64, #[stable(feature = "raw_ext", since = "1.1.0")] - pub st_blksize: ::blksize_t, + pub st_blksize: i32, #[stable(feature = "raw_ext", since = "1.1.0")] - pub __pad2: ::c_int, + pub __pad2: i32, #[stable(feature = "raw_ext", since = "1.1.0")] - pub st_blocks: ::blkcnt_t, + pub st_blocks: i64, #[stable(feature = "raw_ext", since = "1.1.0")] - pub st_atime: ::time_t, + pub st_atime: i64, #[stable(feature = "raw_ext", since = "1.1.0")] - pub st_atime_nsec: ::c_long, + pub st_atime_nsec: c_long, #[stable(feature = "raw_ext", since = "1.1.0")] - pub st_mtime: ::time_t, + pub st_mtime: i64, #[stable(feature = "raw_ext", since = "1.1.0")] - pub st_mtime_nsec: ::c_long, + pub st_mtime_nsec: c_long, #[stable(feature = "raw_ext", since = "1.1.0")] - pub st_ctime: ::time_t, + pub st_ctime: i64, #[stable(feature = "raw_ext", since = "1.1.0")] - pub st_ctime_nsec: ::c_long, + pub st_ctime_nsec: c_long, #[stable(feature = "raw_ext", since = "1.1.0")] - pub __pad3: [::c_int; 2], + pub __pad3: [c_int; 2], } } From 57e7e2875b3bb571703cbaa11aac92efea434f04 Mon Sep 17 00:00:00 2001 From: Oliver Middleton Date: Sat, 22 Aug 2020 22:00:33 +0100 Subject: [PATCH 02/11] Update docs for SystemTime Windows implementation Windows now uses `GetSystemTimePreciseAsFileTime` on versions of Windows that support it. --- library/std/src/time.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/library/std/src/time.rs b/library/std/src/time.rs index 02161ecb4c8..c8aee1da39b 100644 --- a/library/std/src/time.rs +++ b/library/std/src/time.rs @@ -159,7 +159,7 @@ pub struct Instant(time::Instant); /// | DARWIN | [gettimeofday] | /// | VXWorks | [clock_gettime (Realtime Clock)] | /// | WASI | [__wasi_clock_time_get (Realtime Clock)] | -/// | Windows | [GetSystemTimeAsFileTime] | +/// | Windows | [GetSystemTimePreciseAsFileTime] / [GetSystemTimeAsFileTime] | /// /// [clock_time_get (Realtime Clock)]: https://nuxi.nl/cloudabi/#clock_time_get /// [`insecure_time` usercall]: https://edp.fortanix.com/docs/api/fortanix_sgx_abi/struct.Usercalls.html#method.insecure_time @@ -167,6 +167,7 @@ pub struct Instant(time::Instant); /// [gettimeofday]: http://man7.org/linux/man-pages/man2/gettimeofday.2.html /// [clock_gettime (Realtime Clock)]: https://linux.die.net/man/3/clock_gettime /// [__wasi_clock_time_get (Realtime Clock)]: https://github.com/WebAssembly/WASI/blob/master/phases/snapshot/docs.md#clock_time_get +/// [GetSystemTimePreciseAsFileTime]: https://docs.microsoft.com/en-us/windows/win32/api/sysinfoapi/nf-sysinfoapi-getsystemtimepreciseasfiletime /// [GetSystemTimeAsFileTime]: https://docs.microsoft.com/en-us/windows/win32/api/sysinfoapi/nf-sysinfoapi-getsystemtimeasfiletime /// /// **Disclaimer:** These system calls might change over time. From 6cb364cda47d960d08b8e7fb03d0df0e9bdbd190 Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Sat, 22 Aug 2020 16:49:56 +0200 Subject: [PATCH 03/11] Prevent automatic page change when using history --- src/librustdoc/html/static/main.js | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/librustdoc/html/static/main.js b/src/librustdoc/html/static/main.js index 462a696dee6..f465228b749 100644 --- a/src/librustdoc/html/static/main.js +++ b/src/librustdoc/html/static/main.js @@ -1576,14 +1576,18 @@ function defocusSearchBar() { } function showResults(results) { - if (results.others.length === 1 && - getCurrentValue("rustdoc-go-to-only-result") === "true") { + var search = getSearchElement(); + if (results.others.length === 1 + && getCurrentValue("rustdoc-go-to-only-result") === "true" + && (!search.firstChild || search.firstChild.innerText !== getSearchLoadingText())) + { var elem = document.createElement("a"); elem.href = results.others[0].href; elem.style.display = "none"; // For firefox, we need the element to be in the DOM so it can be clicked. document.body.appendChild(elem); elem.click(); + return; } var query = getQuery(search_input.value); @@ -1602,7 +1606,6 @@ function defocusSearchBar() { "
" + ret_others[0] + ret_in_args[0] + ret_returned[0] + "
"; - var search = getSearchElement(); search.innerHTML = output; showSearchResults(search); var tds = search.getElementsByTagName("td"); @@ -2679,6 +2682,10 @@ function defocusSearchBar() { } } + function getSearchLoadingText() { + return "Loading search results..."; + } + if (search_input) { search_input.onfocus = function() { putBackSearch(this); @@ -2688,7 +2695,7 @@ function defocusSearchBar() { var params = getQueryStringParams(); if (params && params.search) { var search = getSearchElement(); - search.innerHTML = "

Loading search results...

"; + search.innerHTML = "

" + getSearchLoadingText() + "

"; showSearchResults(search); } From 5041aeef3d4155ac28245419193280491552fd35 Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Sun, 23 Aug 2020 15:17:50 +0200 Subject: [PATCH 04/11] Fix font color for help button in ayu and dark themes --- src/librustdoc/html/static/themes/ayu.css | 1 + src/librustdoc/html/static/themes/dark.css | 1 + 2 files changed, 2 insertions(+) diff --git a/src/librustdoc/html/static/themes/ayu.css b/src/librustdoc/html/static/themes/ayu.css index 6e8db1e9eb7..c8d4ec60352 100644 --- a/src/librustdoc/html/static/themes/ayu.css +++ b/src/librustdoc/html/static/themes/ayu.css @@ -495,6 +495,7 @@ kbd { #theme-picker, #settings-menu, .help-button { border-color: #5c6773; background-color: #0f1419; + color: #fff; } #theme-picker > img, #settings-menu > img { diff --git a/src/librustdoc/html/static/themes/dark.css b/src/librustdoc/html/static/themes/dark.css index eeb1f0a3d4a..f5a85337768 100644 --- a/src/librustdoc/html/static/themes/dark.css +++ b/src/librustdoc/html/static/themes/dark.css @@ -389,6 +389,7 @@ kbd { #theme-picker, #settings-menu, .help-button { border-color: #e0e0e0; background: #f0f0f0; + color: #000; } #theme-picker:hover, #theme-picker:focus, From efef159c555125501e4b64b7caa6a9ee892a8fad Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Mon, 24 Aug 2020 10:38:28 +0200 Subject: [PATCH 05/11] Unify theme choices border color in ayu theme --- src/librustdoc/html/static/themes/ayu.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/librustdoc/html/static/themes/ayu.css b/src/librustdoc/html/static/themes/ayu.css index 6e8db1e9eb7..5f6ba5b875f 100644 --- a/src/librustdoc/html/static/themes/ayu.css +++ b/src/librustdoc/html/static/themes/ayu.css @@ -513,7 +513,7 @@ kbd { } #theme-choices > button:not(:first-child) { - border-top-color: #c5c5c5; + border-top-color: #5c6773; } #theme-choices > button:hover, #theme-choices > button:focus { From 76bd5b3852d39e624999e6f3dd16cd2b02657333 Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Mon, 24 Aug 2020 12:59:16 +0200 Subject: [PATCH 06/11] Add explanations on the results search element check --- src/librustdoc/html/static/main.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/librustdoc/html/static/main.js b/src/librustdoc/html/static/main.js index f465228b749..57c8d5bff76 100644 --- a/src/librustdoc/html/static/main.js +++ b/src/librustdoc/html/static/main.js @@ -1579,6 +1579,9 @@ function defocusSearchBar() { var search = getSearchElement(); if (results.others.length === 1 && getCurrentValue("rustdoc-go-to-only-result") === "true" + // By default, the search DOM element is "empty" (meaning it has no children not + // text content). Once a search has been run, it won't be empty, even if you press + // ESC or empty the search input (which also "cancels" the search). && (!search.firstChild || search.firstChild.innerText !== getSearchLoadingText())) { var elem = document.createElement("a"); From daa6620c95f0c3817b1a344a607edce1faa3e48f Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Fri, 21 Aug 2020 19:48:29 +0200 Subject: [PATCH 07/11] Unconfuse Unpin docs a bit * Don't say that Unpin is used to prevent moves, because it is used to *allow* moves * Be more precise about kindedness of things, it is `Pin>`, rather than just `Pin`. --- library/core/src/marker.rs | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/library/core/src/marker.rs b/library/core/src/marker.rs index 9326aaf5684..b44ca95b002 100644 --- a/library/core/src/marker.rs +++ b/library/core/src/marker.rs @@ -728,23 +728,23 @@ unsafe impl Freeze for &mut T {} /// Types that can be safely moved after being pinned. /// -/// Since Rust itself has no notion of immovable types, and considers moves -/// (e.g., through assignment or [`mem::replace`]) to always be safe, -/// this trait cannot prevent types from moving by itself. +/// Rust itself has no notion of immovable types, and considers moves (e.g., +/// through assignment or [`mem::replace`]) to always be safe. /// -/// Instead it is used to prevent moves through the type system, -/// by controlling the behavior of pointers `P` wrapped in the [`Pin

`] wrapper, -/// which "pin" the type in place by not allowing it to be moved out of them. -/// See the [`pin module`] documentation for more information on pinning. +/// The [`Pin`][Pin] type is used instead to prevent moves through the type +/// system. Pointers `P` wrapped in the [`Pin>`][Pin] wrapper can't be +/// moved out of. See the [`pin module`] documentation for more information on +/// pinning. /// -/// Implementing this trait lifts the restrictions of pinning off a type, -/// which then allows it to move out with functions such as [`mem::replace`]. +/// Implementing the `Unpin` trait for `T` lifts the restrictions of pinning off +/// the type, which then allows moving `T` out of [`Pin>`][Pin] with +/// functions such as [`mem::replace`]. /// /// `Unpin` has no consequence at all for non-pinned data. In particular, /// [`mem::replace`] happily moves `!Unpin` data (it works for any `&mut T`, not -/// just when `T: Unpin`). However, you cannot use -/// [`mem::replace`] on data wrapped inside a [`Pin

`] because you cannot get the -/// `&mut T` you need for that, and *that* is what makes this system work. +/// just when `T: Unpin`). However, you cannot use [`mem::replace`] on data +/// wrapped inside a [`Pin>`][Pin] because you cannot get the `&mut T` you +/// need for that, and *that* is what makes this system work. /// /// So this, for example, can only be done on types implementing `Unpin`: /// @@ -765,8 +765,8 @@ unsafe impl Freeze for &mut T {} /// This trait is automatically implemented for almost every type. /// /// [`mem::replace`]: ../../std/mem/fn.replace.html -/// [`Pin

`]: ../pin/struct.Pin.html -/// [`pin module`]: ../../std/pin/index.html +/// [Pin]: crate::pin::Pin +/// [`pin module`]: crate::pin #[stable(feature = "pin", since = "1.33.0")] #[rustc_on_unimplemented( on(_Self = "std::future::Future", note = "consider using `Box::pin`",), From adc492573e351bd0ba51053a459e465834d6212a Mon Sep 17 00:00:00 2001 From: Ivan Tham Date: Mon, 24 Aug 2020 20:52:41 +0800 Subject: [PATCH 08/11] Shorten liballoc vec resize intra-doc link --- library/alloc/src/vec.rs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/library/alloc/src/vec.rs b/library/alloc/src/vec.rs index 058a06e1326..b4ad238680f 100644 --- a/library/alloc/src/vec.rs +++ b/library/alloc/src/vec.rs @@ -1456,9 +1456,9 @@ impl Vec { /// If `new_len` is less than `len`, the `Vec` is simply truncated. /// /// This method uses a closure to create new values on every push. If - /// you'd rather [`Clone`] a given value, use [`resize`]. If you want - /// to use the [`Default`] trait to generate values, you can pass - /// [`Default::default()`] as the second argument. + /// you'd rather [`Clone`] a given value, use [`Vec::resize`]. If you + /// want to use the [`Default`] trait to generate values, you can + /// pass [`Default::default`] as the second argument. /// /// # Examples /// @@ -1472,8 +1472,6 @@ impl Vec { /// vec.resize_with(4, || { p *= 2; p }); /// assert_eq!(vec, [2, 4, 8, 16]); /// ``` - /// - /// [`resize`]: Vec::resize #[stable(feature = "vec_resize_with", since = "1.33.0")] pub fn resize_with(&mut self, new_len: usize, f: F) where From 079baafdf1fc90805373ff2ef7d57eea3a7f15ce Mon Sep 17 00:00:00 2001 From: "Pang, Baoshan" Date: Fri, 7 Aug 2020 16:55:15 -0700 Subject: [PATCH 09/11] For VxWorks: fix building errors use wr-c++ as linker --- library/std/src/sys/vxworks/fd.rs | 2 +- .../std/src/sys/vxworks/process/process_common.rs | 15 +++------------ library/std/src/sys/vxworks/thread_local_dtor.rs | 2 +- src/bootstrap/cc_detect.rs | 3 ++- src/bootstrap/lib.rs | 4 ++++ 5 files changed, 11 insertions(+), 15 deletions(-) diff --git a/library/std/src/sys/vxworks/fd.rs b/library/std/src/sys/vxworks/fd.rs index ea186846929..d58468ad539 100644 --- a/library/std/src/sys/vxworks/fd.rs +++ b/library/std/src/sys/vxworks/fd.rs @@ -53,7 +53,7 @@ impl FileDesc { } #[inline] - fn is_read_vectored(&self) -> bool { + pub fn is_read_vectored(&self) -> bool { true } diff --git a/library/std/src/sys/vxworks/process/process_common.rs b/library/std/src/sys/vxworks/process/process_common.rs index bbbd5eda773..6473a0c3cec 100644 --- a/library/std/src/sys/vxworks/process/process_common.rs +++ b/library/std/src/sys/vxworks/process/process_common.rs @@ -351,8 +351,7 @@ impl ExitStatus { } fn exited(&self) -> bool { - /*unsafe*/ - { libc::WIFEXITED(self.0) } + libc::WIFEXITED(self.0) } pub fn success(&self) -> bool { @@ -360,19 +359,11 @@ impl ExitStatus { } pub fn code(&self) -> Option { - if self.exited() { - Some(/*unsafe*/ { libc::WEXITSTATUS(self.0) }) - } else { - None - } + if self.exited() { Some(libc::WEXITSTATUS(self.0)) } else { None } } pub fn signal(&self) -> Option { - if !self.exited() { - Some(/*unsafe*/ { libc::WTERMSIG(self.0) }) - } else { - None - } + if !self.exited() { Some(libc::WTERMSIG(self.0)) } else { None } } } diff --git a/library/std/src/sys/vxworks/thread_local_dtor.rs b/library/std/src/sys/vxworks/thread_local_dtor.rs index 3f73f6c4903..5391ed83ebc 100644 --- a/library/std/src/sys/vxworks/thread_local_dtor.rs +++ b/library/std/src/sys/vxworks/thread_local_dtor.rs @@ -2,6 +2,6 @@ #![unstable(feature = "thread_local_internals", issue = "none")] pub unsafe fn register_dtor(t: *mut u8, dtor: unsafe extern "C" fn(*mut u8)) { - use crate::sys_common::thread_local::register_dtor_fallback; + use crate::sys_common::thread_local_dtor::register_dtor_fallback; register_dtor_fallback(t, dtor); } diff --git a/src/bootstrap/cc_detect.rs b/src/bootstrap/cc_detect.rs index 7ff00d85dd2..d50e4cf5269 100644 --- a/src/bootstrap/cc_detect.rs +++ b/src/bootstrap/cc_detect.rs @@ -132,7 +132,8 @@ pub fn find(build: &mut Build) { false }; - if cxx_configured { + // for VxWorks, record CXX compiler which will be used in lib.rs:linker() + if cxx_configured || target.contains("vxworks") { let compiler = cfg.get_compiler(); build.cxx.insert(target, compiler); } diff --git a/src/bootstrap/lib.rs b/src/bootstrap/lib.rs index 77820ef87e3..c93df8d5149 100644 --- a/src/bootstrap/lib.rs +++ b/src/bootstrap/lib.rs @@ -857,6 +857,10 @@ impl Build { if let Some(linker) = self.config.target_config.get(&target).and_then(|c| c.linker.as_ref()) { Some(linker) + } else if target.contains("vxworks") { + // need to use CXX compiler as linker to resolve the exception functions + // that are only existed in CXX libraries + Some(self.cxx[&target].path()) } else if target != self.config.build && util::use_host_linker(target) && !target.contains("msvc") From 29399fad5f961f0e235d28ed2f4c68e7a1ae5062 Mon Sep 17 00:00:00 2001 From: Joshua Nelson Date: Wed, 26 Aug 2020 15:13:57 -0400 Subject: [PATCH 10/11] Fix swapped stability attributes This fixes a regression introduced in https://github.com/rust-lang/rust/pull/74855. --- src/librustdoc/passes/doc_test_lints.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/librustdoc/passes/doc_test_lints.rs b/src/librustdoc/passes/doc_test_lints.rs index a465a5f681f..367f93cfd38 100644 --- a/src/librustdoc/passes/doc_test_lints.rs +++ b/src/librustdoc/passes/doc_test_lints.rs @@ -1,7 +1,7 @@ //! This pass is overloaded and runs two different lints. //! -//! - MISSING_DOC_CODE_EXAMPLES: this looks for public items missing doc-tests -//! - PRIVATE_DOC_TESTS: this looks for private items with doc-tests. +//! - MISSING_DOC_CODE_EXAMPLES: this lint is **UNSTABLE** and looks for public items missing doc-tests +//! - PRIVATE_DOC_TESTS: this lint is **STABLE** and looks for private items with doc-tests. use super::{span_of_attrs, Pass}; use crate::clean; @@ -89,7 +89,9 @@ pub fn look_for_tests<'tcx>(cx: &DocContext<'tcx>, dox: &str, item: &Item) { find_testable_code(&dox, &mut tests, ErrorCodes::No, false, None); - if tests.found_tests == 0 { + if tests.found_tests == 0 + && rustc_feature::UnstableFeatures::from_environment().is_nightly_build() + { if should_have_doc_example(&item.inner) { debug!("reporting error for {:?} (hir_id={:?})", item, hir_id); let sp = span_of_attrs(&item.attrs).unwrap_or(item.source.span()); @@ -100,9 +102,7 @@ pub fn look_for_tests<'tcx>(cx: &DocContext<'tcx>, dox: &str, item: &Item) { |lint| lint.build("missing code example in this documentation").emit(), ); } - } else if rustc_feature::UnstableFeatures::from_environment().is_nightly_build() - && tests.found_tests > 0 - && !cx.renderinfo.borrow().access_levels.is_public(item.def_id) + } else if tests.found_tests > 0 && !cx.renderinfo.borrow().access_levels.is_public(item.def_id) { cx.tcx.struct_span_lint_hir( lint::builtin::PRIVATE_DOC_TESTS, From c8b240241a94a3a5badcbdcbe1b642a0dd440119 Mon Sep 17 00:00:00 2001 From: Mark Rousskov Date: Wed, 26 Aug 2020 17:22:13 -0400 Subject: [PATCH 11/11] Avoid function-scoping global variables In 2e6f2e885506ee4, we added a main function to the publish_toolstate.py script. Unfortunately, we missed that the Python program implicitly declares global variables in that code, which means that adding a function changes variable scoping and breaks other code. This commit avoids introducing that function and adds a warning to future editors of the code. --- src/tools/publish_toolstate.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/tools/publish_toolstate.py b/src/tools/publish_toolstate.py index 51416c8ce63..9cfde0c232b 100755 --- a/src/tools/publish_toolstate.py +++ b/src/tools/publish_toolstate.py @@ -275,7 +275,12 @@ def update_latest( return message -def main(): +# Warning: Do not try to add a function containing the body of this try block. +# There are variables declared within that are implicitly global; it is unknown +# which ones precisely but at least this is true for `github_token`. +try: + if __name__ != '__main__': + exit(0) repo = os.environ.get('TOOLSTATE_VALIDATE_MAINTAINERS_REPO') if repo: github_token = os.environ.get('TOOLSTATE_REPO_ACCESS_TOKEN') @@ -342,11 +347,6 @@ def main(): } )) response.read() - - -if __name__ == '__main__': - try: - main() - except urllib2.HTTPError as e: - print("HTTPError: %s\n%s" % (e, e.read())) - raise +except urllib2.HTTPError as e: + print("HTTPError: %s\n%s" % (e, e.read())) + raise