BUG: Fixed msgpack roundtrip with PeriodIndex
State: closed

Closes https://github.com/pandas-dev/pandas/issues/24135

Labels:

Comments:
Hello @TomAugspurger! Thanks for submitting the PR.

 - There are no PEP8 issues in the file [`pandas/core/indexes/period.py`](https://github.com/TomAugspurger/pandas/blob/1638807277b0a9cc663ec9e5bf4b015065afd837/pandas/core/indexes/period.py) !

 - There are no PEP8 issues in the file [`pandas/io/packers.py`](https://github.com/TomAugspurger/pandas/blob/1638807277b0a9cc663ec9e5bf4b015065afd837/pandas/io/packers.py) !

 - There are no PEP8 issues in the file [`pandas/tests/io/test_packers.py`](https://github.com/TomAugspurger/pandas/blob/1638807277b0a9cc663ec9e5bf4b015065afd837/pandas/tests/io/test_packers.py) !


lgtm.
# [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/24335?src=pr&el=h1) Report
> Merging [#24335](https://codecov.io/gh/pandas-dev/pandas/pull/24335?src=pr&el=desc) into [master](https://codecov.io/gh/pandas-dev/pandas/commit/216986d4691297d5cfec33b5c62be7890b9a54d7?src=pr&el=desc) will **increase** coverage by `<.01%`.
> The diff coverage is `100%`.

[![Impacted file tree graph](https://codecov.io/gh/pandas-dev/pandas/pull/24335/graphs/tree.svg?width=650&token=eZ4WkYLtcO&height=150&src=pr)](https://codecov.io/gh/pandas-dev/pandas/pull/24335?src=pr&el=tree)

```diff
@@            Coverage Diff             @@
##           master   #24335      +/-   ##
==========================================
+ Coverage   92.28%   92.28%   +<.01%     
==========================================
  Files         162      162              
  Lines       51831    51833       +2     
==========================================
+ Hits        47830    47833       +3     
+ Misses       4001     4000       -1
```

| Flag | Coverage Δ | |
|---|---|---|
| #multiple | `90.68% <100%> (ø)` | :arrow_up: |
| #single | `43% <66.66%> (-0.01%)` | :arrow_down: |

| [Impacted Files](https://codecov.io/gh/pandas-dev/pandas/pull/24335?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [pandas/io/packers.py](https://codecov.io/gh/pandas-dev/pandas/pull/24335/diff?src=pr&el=tree#diff-cGFuZGFzL2lvL3BhY2tlcnMucHk=) | `88.08% <100%> (ø)` | :arrow_up: |
| [pandas/core/indexes/period.py](https://codecov.io/gh/pandas-dev/pandas/pull/24335/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvaW5kZXhlcy9wZXJpb2QucHk=) | `93.09% <100%> (+0.03%)` | :arrow_up: |
| [pandas/util/testing.py](https://codecov.io/gh/pandas-dev/pandas/pull/24335/diff?src=pr&el=tree#diff-cGFuZGFzL3V0aWwvdGVzdGluZy5weQ==) | `87.58% <0%> (+0.09%)` | :arrow_up: |

------

[Continue to review full report at Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/24335?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/24335?src=pr&el=footer). Last update [216986d...71a7f3d](https://codecov.io/gh/pandas-dev/pandas/pull/24335?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).

# [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/24335?src=pr&el=h1) Report
> Merging [#24335](https://codecov.io/gh/pandas-dev/pandas/pull/24335?src=pr&el=desc) into [master](https://codecov.io/gh/pandas-dev/pandas/commit/216986d4691297d5cfec33b5c62be7890b9a54d7?src=pr&el=desc) will **increase** coverage by `<.01%`.
> The diff coverage is `100%`.

[![Impacted file tree graph](https://codecov.io/gh/pandas-dev/pandas/pull/24335/graphs/tree.svg?width=650&token=eZ4WkYLtcO&height=150&src=pr)](https://codecov.io/gh/pandas-dev/pandas/pull/24335?src=pr&el=tree)

```diff
@@            Coverage Diff             @@
##           master   #24335      +/-   ##
==========================================
+ Coverage   92.28%   92.28%   +<.01%     
==========================================
  Files         162      162              
  Lines       51831    51833       +2     
==========================================
+ Hits        47830    47833       +3     
+ Misses       4001     4000       -1
```

| Flag | Coverage Δ | |
|---|---|---|
| #multiple | `90.68% <100%> (ø)` | :arrow_up: |
| #single | `43% <66.66%> (-0.01%)` | :arrow_down: |

| [Impacted Files](https://codecov.io/gh/pandas-dev/pandas/pull/24335?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [pandas/io/packers.py](https://codecov.io/gh/pandas-dev/pandas/pull/24335/diff?src=pr&el=tree#diff-cGFuZGFzL2lvL3BhY2tlcnMucHk=) | `88.08% <100%> (ø)` | :arrow_up: |
| [pandas/core/indexes/period.py](https://codecov.io/gh/pandas-dev/pandas/pull/24335/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvaW5kZXhlcy9wZXJpb2QucHk=) | `93.09% <100%> (+0.03%)` | :arrow_up: |
| [pandas/util/testing.py](https://codecov.io/gh/pandas-dev/pandas/pull/24335/diff?src=pr&el=tree#diff-cGFuZGFzL3V0aWwvdGVzdGluZy5weQ==) | `87.58% <0%> (+0.09%)` | :arrow_up: |

------

[Continue to review full report at Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/24335?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/24335?src=pr&el=footer). Last update [216986d...71a7f3d](https://codecov.io/gh/pandas-dev/pandas/pull/24335?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).

thanks