[2.7] bpo-31107: Fix copyreg mangled slot names calculation. (GH-2989). (#3004)

(cherry picked from commit c4c9866064f03646c686d7e08b00aeb203c35c19)
diff --git a/Misc/ACKS b/Misc/ACKS
index 662db9f..229a874 100644
--- a/Misc/ACKS
+++ b/Misc/ACKS
@@ -543,6 +543,7 @@
 Brian Harring
 Jonathan Hartley
 Travis B. Hartwell
+Shane Harvey
 Larry Hastings
 Tim Hatch
 Shane Hathaway
diff --git a/Misc/NEWS.d/next/Library/2017-08-02-12-48-15.bpo-31107.1t2hn5.rst b/Misc/NEWS.d/next/Library/2017-08-02-12-48-15.bpo-31107.1t2hn5.rst
new file mode 100644
index 0000000..0980705
--- /dev/null
+++ b/Misc/NEWS.d/next/Library/2017-08-02-12-48-15.bpo-31107.1t2hn5.rst
@@ -0,0 +1,2 @@
+Fix `copy_reg._slotnames()` mangled attribute calculation for classes whose
+name begins with an underscore. Patch by Shane Harvey.