scaramallion: Yeah, I can restart Travis but not appveyor
darcymason: Apparently closing and re-opening a pull request will re-trigger builds... I'll see if I can re-open after the close...
diff --git a/doc/release_notes/v2.0.0.rst b/doc/release_notes/v2.0.0.rst
index 17443d11e..4c137b142 100644
--- a/doc/release_notes/v2.0.0.rst
+++ b/doc/release_notes/v2.0.0.rst
@@ -30,3 +30,4 @@ Fixes
 * Fixed :func:`~pydicom.pixel_data_handlers.util.apply_voi_lut` and
   :func:`~pydicom.pixel_data_handlers.util.apply_modality_lut` not handling
   (0028,3006) *LUT Data* with a VR of **OW** (:issue:`1073`)
+* Fixed access to private creator tag in raw datasets (:issue:`1078`)
diff --git a/pydicom/dataset.py b/pydicom/dataset.py
index c69c15b4d..de741cb89 100644
--- a/pydicom/dataset.py
+++ b/pydicom/dataset.py
@@ -929,7 +929,7 @@ class Dataset(dict):
                     return new_block()
                 else:
                     break
-            if self._dict[private_creator_tag].value == private_creator:
+            if self[private_creator_tag].value == private_creator:
                 return new_block()
 
         raise KeyError(
@@ -972,7 +972,7 @@ class Dataset(dict):
             private_creator_tag = Tag(group, element)
             if private_creator_tag not in self._dict:
                 break
-            private_creators.append(self._dict[private_creator_tag].value)
+            private_creators.append(self[private_creator_tag].value)
         return private_creators
 
     def get_private_item(self, group, element_offset, private_creator):

Dataset.private_block inconsistent behavior with create=True
Using Dataset.private_block to get a private block for an available private creator with the flag create=True yields inconsistent behavior. Sometimes it recognizes the available private creator and sometimes it does not and adds a new tag for it.  

I [expect](https://pydicom.github.io/pydicom/dev/reference/generated/pydicom.dataset.Dataset.html#pydicom.dataset.Dataset.private_block) Dataset.private_block(group_number, private_creator, create=True) would recognize an available private_creator if present in a dicom file and would not add a new tag for it. 

Reproduction code:

```
from pydicom import dcmread
from pydicom.data import get_testdata_files

ct_filename = get_testdata_files("CT_small")[0]
ds = dcmread(ct_filename)
block = ds.private_block(0x11, 'GEMS_PATI_01', create=True)

ds.private_creators(0x11)
ds.private_creators(0x11)[0] == ds.private_creators(0x11)[1]
```

Output is:
```
['GEMS_PATI_01', 'GEMS_PATI_01']
True
```

Working with other files, I've seen this behavior is not consistent. Sometimes I would get the expected results. I have not tested it enough for the specific file above.

My environment (Running with docker from PyCharm):
Linux-4.15.0-74-generic-x86_64-with-debian-buster-sid
Python  3.6.9 |Anaconda, Inc.| (default, Jul 30 2019, 19:07:31)
[GCC 7.3.0]
pydicom  1.4.2
diff --git a/pydicom/tests/test_dataset.py b/pydicom/tests/test_dataset.py
index f28171e85..daad7f952 100644
--- a/pydicom/tests/test_dataset.py
+++ b/pydicom/tests/test_dataset.py
@@ -955,6 +955,17 @@ class TestDataset(object):
         item = ds.get_private_item(0x0009, 0x02, 'Creator 2.0')
         assert 2 == item.value
 
+    def test_private_creator_from_raw_ds(self):
+        # regression test for #1078
+        ct_filename = get_testdata_files("CT_small")[0]
+        ds = dcmread(ct_filename)
+        ds.private_block(0x11, 'GEMS_PATI_01', create=True)
+        assert ['GEMS_PATI_01'] == ds.private_creators(0x11)
+
+        assert [] == ds.private_creators(0x13)
+        ds.private_block(0x13, 'GEMS_PATI_01', create=True)
+        assert ['GEMS_PATI_01'] == ds.private_creators(0x13)
+
     def test_add_new_private_tag(self):
         ds = Dataset()
         ds.add_new(0x00080005, 'CS', 'ISO_IR 100')

pip install -e .[dev]
parse_log_pytest
requirements.txt
numpy>=1.16.0 pytest pytest-cov
apt-get update apt-get install -y gcc
3.7
requirements/base.txt
pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning
certifi @ file:///croot/certifi_1671487769961/work/certifi
coverage==7.2.7
exceptiongroup==1.2.2
importlib-metadata==6.7.0
iniconfig==2.0.0
numpy==1.21.6
packaging==24.0
pluggy==1.2.0
-e git+https://github.com/pydicom/pydicom.git@269a48c7fe54384adf01136a80e0fc372e78e3bc#egg=pydicom
pytest==7.4.4
pytest-cov==4.1.0
tomli==2.0.1
typing_extensions==4.7.1
zipp==3.15.0

name: pydicom
channels:
  - defaults
  - https://repo.anaconda.com/pkgs/main
  - https://repo.anaconda.com/pkgs/r
  - conda-forge
dependencies:
  - _libgcc_mutex=0.1=main
  - _openmp_mutex=5.1=1_gnu
  - ca-certificates=2025.2.25=h06a4308_0
  - certifi=2022.12.7=py37h06a4308_0
  - ld_impl_linux-64=2.40=h12ee557_0
  - libffi=3.4.4=h6a678d5_1
  - libgcc-ng=11.2.0=h1234567_1
  - libgomp=11.2.0=h1234567_1
  - libstdcxx-ng=11.2.0=h1234567_1
  - ncurses=6.4=h6a678d5_0
  - openssl=1.1.1w=h7f8727e_0
  - pip=22.3.1=py37h06a4308_0
  - python=3.7.16=h7a1cb2a_0
  - readline=8.2=h5eee18b_0
  - setuptools=65.6.3=py37h06a4308_0
  - sqlite=3.45.3=h5eee18b_0
  - tk=8.6.14=h39e8969_0
  - wheel=0.38.4=py37h06a4308_0
  - xz=5.6.4=h5eee18b_1
  - zlib=1.2.13=h5eee18b_1
  - pip:
      - coverage==7.2.7
      - exceptiongroup==1.2.2
      - importlib-metadata==6.7.0
      - iniconfig==2.0.0
      - numpy==1.21.6
      - packaging==24.0
      - pluggy==1.2.0
      - pytest==7.4.4
      - pytest-cov==4.1.0
      - tomli==2.0.1
      - typing-extensions==4.7.1
      - zipp==3.15.0
prefix: /opt/conda/envs/pydicom

pydicom/tests/test_dataset.py::TestDataset::test_private_creator_from_raw_ds
pydicom/tests/test_dataset.py::TestDataset::test_attribute_error_in_property pydicom/tests/test_dataset.py::TestDataset::test_for_stray_raw_data_element pydicom/tests/test_dataset.py::TestDataset::test_attribute_error_in_property_correct_debug pydicom/tests/test_dataset.py::TestDataset::test_tag_exception_print pydicom/tests/test_dataset.py::TestDataset::test_tag_exception_walk pydicom/tests/test_dataset.py::TestDataset::test_set_new_data_element_by_name pydicom/tests/test_dataset.py::TestDataset::test_set_existing_data_element_by_name pydicom/tests/test_dataset.py::TestDataset::test_set_non_dicom pydicom/tests/test_dataset.py::TestDataset::test_membership pydicom/tests/test_dataset.py::TestDataset::test_contains pydicom/tests/test_dataset.py::TestDataset::test_clear pydicom/tests/test_dataset.py::TestDataset::test_pop pydicom/tests/test_dataset.py::TestDataset::test_pop_using_tuple pydicom/tests/test_dataset.py::TestDataset::test_pop_using_keyword pydicom/tests/test_dataset.py::TestDataset::test_popitem pydicom/tests/test_dataset.py::TestDataset::test_setdefault pydicom/tests/test_dataset.py::TestDataset::test_setdefault_tuple pydicom/tests/test_dataset.py::TestDataset::test_setdefault_use_value pydicom/tests/test_dataset.py::TestDataset::test_setdefault_keyword pydicom/tests/test_dataset.py::TestDataset::test_get_exists1 pydicom/tests/test_dataset.py::TestDataset::test_get_exists2 pydicom/tests/test_dataset.py::TestDataset::test_get_exists3 pydicom/tests/test_dataset.py::TestDataset::test_get_exists4 pydicom/tests/test_dataset.py::TestDataset::test_get_default1 pydicom/tests/test_dataset.py::TestDataset::test_get_default2 pydicom/tests/test_dataset.py::TestDataset::test_get_default3 pydicom/tests/test_dataset.py::TestDataset::test_get_default4 pydicom/tests/test_dataset.py::TestDataset::test_get_raises pydicom/tests/test_dataset.py::TestDataset::test_get_from_raw pydicom/tests/test_dataset.py::TestDataset::test__setitem__ pydicom/tests/test_dataset.py::TestDataset::test_matching_tags pydicom/tests/test_dataset.py::TestDataset::test_named_member_updated pydicom/tests/test_dataset.py::TestDataset::test_update pydicom/tests/test_dataset.py::TestDataset::test_dir_subclass pydicom/tests/test_dataset.py::TestDataset::test_dir pydicom/tests/test_dataset.py::TestDataset::test_dir_filter pydicom/tests/test_dataset.py::TestDataset::test_delete_dicom_attr pydicom/tests/test_dataset.py::TestDataset::test_delete_dicom_command_group_length pydicom/tests/test_dataset.py::TestDataset::test_delete_other_attr pydicom/tests/test_dataset.py::TestDataset::test_delete_dicom_attr_we_dont_have pydicom/tests/test_dataset.py::TestDataset::test_delete_item_long pydicom/tests/test_dataset.py::TestDataset::test_delete_item_tuple pydicom/tests/test_dataset.py::TestDataset::test_delete_non_existing_item pydicom/tests/test_dataset.py::TestDataset::test_equality_no_sequence pydicom/tests/test_dataset.py::TestDataset::test_equality_private pydicom/tests/test_dataset.py::TestDataset::test_equality_sequence pydicom/tests/test_dataset.py::TestDataset::test_equality_not_dataset pydicom/tests/test_dataset.py::TestDataset::test_equality_unknown pydicom/tests/test_dataset.py::TestDataset::test_equality_inheritance pydicom/tests/test_dataset.py::TestDataset::test_equality_elements pydicom/tests/test_dataset.py::TestDataset::test_inequality pydicom/tests/test_dataset.py::TestDataset::test_hash pydicom/tests/test_dataset.py::TestDataset::test_property pydicom/tests/test_dataset.py::TestDataset::test_add_repeater_elem_by_keyword pydicom/tests/test_dataset.py::TestDataset::test_setitem_slice_raises pydicom/tests/test_dataset.py::TestDataset::test_getitem_slice_raises pydicom/tests/test_dataset.py::TestDataset::test_empty_slice pydicom/tests/test_dataset.py::TestDataset::test_getitem_slice pydicom/tests/test_dataset.py::TestDataset::test_getitem_slice_ffff pydicom/tests/test_dataset.py::TestDataset::test_delitem_slice pydicom/tests/test_dataset.py::TestDataset::test_group_dataset pydicom/tests/test_dataset.py::TestDataset::test_get_item pydicom/tests/test_dataset.py::TestDataset::test_get_item_slice pydicom/tests/test_dataset.py::TestDataset::test_get_private_item pydicom/tests/test_dataset.py::TestDataset::test_private_block pydicom/tests/test_dataset.py::TestDataset::test_add_new_private_tag pydicom/tests/test_dataset.py::TestDataset::test_delete_private_tag pydicom/tests/test_dataset.py::TestDataset::test_private_creators pydicom/tests/test_dataset.py::TestDataset::test_is_original_encoding pydicom/tests/test_dataset.py::TestDataset::test_remove_private_tags pydicom/tests/test_dataset.py::TestDataset::test_data_element pydicom/tests/test_dataset.py::TestDataset::test_iterall pydicom/tests/test_dataset.py::TestDataset::test_save_as pydicom/tests/test_dataset.py::TestDataset::test_save_as_compressed_no_encaps pydicom/tests/test_dataset.py::TestDataset::test_save_as_compressed_encaps pydicom/tests/test_dataset.py::TestDataset::test_save_as_no_pixel_data pydicom/tests/test_dataset.py::TestDataset::test_save_as_no_file_meta pydicom/tests/test_dataset.py::TestDataset::test_save_as_private_transfer_syntax pydicom/tests/test_dataset.py::TestDataset::test_save_as_set_little_implicit_with_tsyntax pydicom/tests/test_dataset.py::TestDataset::test_save_as_undefined pydicom/tests/test_dataset.py::TestDataset::test_save_as_undefined_private pydicom/tests/test_dataset.py::TestDataset::test_save_as_undefined_no_tsyntax pydicom/tests/test_dataset.py::TestDataset::test_with pydicom/tests/test_dataset.py::TestDataset::test_exit_exception pydicom/tests/test_dataset.py::TestDataset::test_pixel_array_already_have pydicom/tests/test_dataset.py::TestDataset::test_pixel_array_id_changed pydicom/tests/test_dataset.py::TestDataset::test_pixel_array_unknown_syntax pydicom/tests/test_dataset.py::TestDataset::test_formatted_lines pydicom/tests/test_dataset.py::TestDataset::test_formatted_lines_known_uid pydicom/tests/test_dataset.py::TestDataset::test_set_convert_private_elem_from_raw pydicom/tests/test_dataset.py::TestDataset::test_top pydicom/tests/test_dataset.py::TestDataset::test_trait_names pydicom/tests/test_dataset.py::TestDataset::test_walk pydicom/tests/test_dataset.py::TestDataset::test_update_with_dataset pydicom/tests/test_dataset.py::TestDatasetElements::test_sequence_assignment pydicom/tests/test_dataset.py::TestDatasetElements::test_ensure_file_meta pydicom/tests/test_dataset.py::TestDatasetElements::test_fix_meta_info pydicom/tests/test_dataset.py::TestDatasetElements::test_validate_and_correct_file_meta pydicom/tests/test_dataset.py::TestFileDataset::test_pickle pydicom/tests/test_dataset.py::TestFileDataset::test_pickle_modified pydicom/tests/test_dataset.py::TestFileDataset::test_equality_file_meta pydicom/tests/test_dataset.py::TestFileDataset::test_creation_with_container pydicom/tests/test_dataset.py::TestFileDataset::test_works_as_expected_within_numpy_array pydicom/tests/test_dataset.py::TestFileDataset::test_dataset_overrides_all_dict_attributes pydicom/tests/test_dataset.py::TestDatasetOverlayArray::test_no_possible pydicom/tests/test_dataset.py::TestDatasetOverlayArray::test_possible_not_available pydicom/tests/test_dataset.py::TestDatasetOverlayArray::test_possible_available pydicom/tests/test_dataset.py::TestDatasetOverlayArray::test_handler_raises
pydicom/dataset.py doc/release_notes/v2.0.0.rst
pydicom/dataset.py doc/release_notes/v2.0.0.rst