diff --git a/canvasapi/canvas.py b/canvasapi/canvas.py
index 0e3f030..687649c 100644
--- a/canvasapi/canvas.py
+++ b/canvasapi/canvas.py
@@ -164,8 +164,9 @@ class Canvas(object):
         :rtype: :class:`canvasapi.user.User`
         """
         if id_type:
-            user_id = user
-            uri = 'users/{}:{}'.format(id_type, user_id)
+            uri = 'users/{}:{}'.format(id_type, user)
+        elif user == 'self':
+            uri = 'users/self'
         else:
             user_id = obj_or_id(user, "user", (User,))
             uri = 'users/{}'.format(user_id)

Canvas.get_user() no longer accepts 'self' argument
_(Note: this issue only affects the current version of `develop`)_

Previously, it was possible to pass `'self'` as an argument to `Canvas.get_user()` (`canvas.get_user('self')`) instead of an ID.

Somewhere along the line (likely in the wider adoption of `obj_or_id`, #96), this functionality was broken.

Restore this functionality and add a test explicitly testing `'self'` to prevent future regressions.

When #108 is finished, we may ultimately remove this behavior but at that time there will be an adequate replacement for the functionality.
diff --git a/tests/fixtures/user.json b/tests/fixtures/user.json
index bc71d63..2aa9773 100644
--- a/tests/fixtures/user.json
+++ b/tests/fixtures/user.json
@@ -226,6 +226,14 @@
 			"name": "John Doe"
 		}
 	},
+	"get_by_id_self": {
+		"method": "GET",
+		"endpoint": "users/self",
+		"data": {
+			"id": 1,
+			"name": "John Doe"
+		}
+	},
 	"get_file": {
 		"method": "GET",
 		"endpoint": "users/1/files/1",
diff --git a/tests/test_canvas.py b/tests/test_canvas.py
index e8331ab..dc5ec34 100644
--- a/tests/test_canvas.py
+++ b/tests/test_canvas.py
@@ -149,6 +149,14 @@ class TestCanvas(unittest.TestCase):
         self.assertIsInstance(user, User)
         self.assertTrue(hasattr(user, 'name'))
 
+    def test_get_user_self(self, m):
+        register_uris({'user': ['get_by_id_self']}, m)
+
+        user = self.canvas.get_user('self')
+
+        self.assertIsInstance(user, User)
+        self.assertTrue(hasattr(user, 'name'))
+
     def test_get_user_fail(self, m):
         register_uris({'generic': ['not_found']}, m)
 

pip install -e .[dev]
parse_log_pytest
requirements.txt
pytest pytest-cov pytest-xdist pytest-mock pytest-asyncio
apt-get update apt-get install -y gcc
3.6
requirements.txt dev_requirements.txt
pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning
alabaster==0.7.13
attrs==22.2.0
Babel==2.11.0
-e git+https://github.com/ucfopen/canvasapi.git@f24904ff3e8275ba1f134692b1e7cc08e6972eda#egg=canvasapi
certifi==2021.5.30
charset-normalizer==2.0.12
coverage==6.2
docutils==0.17.1
execnet==1.9.0
flake8==5.0.4
idna==3.10
imagesize==1.4.1
importlib-metadata==4.2.0
iniconfig==1.1.1
Jinja2==3.0.3
MarkupSafe==2.0.1
mccabe==0.7.0
packaging==21.3
pluggy==1.0.0
py==1.11.0
pycodestyle==2.9.1
pyflakes==2.5.0
Pygments==2.14.0
pyparsing==3.1.4
pytest==7.0.1
pytest-asyncio==0.16.0
pytest-cov==4.0.0
pytest-mock==3.6.1
pytest-xdist==3.0.2
pytz==2025.2
requests==2.27.1
requests-mock==1.12.1
six==1.17.0
snowballstemmer==2.2.0
Sphinx==4.3.2
sphinx-rtd-theme==1.3.0
sphinxcontrib-applehelp==1.0.2
sphinxcontrib-devhelp==1.0.2
sphinxcontrib-htmlhelp==2.0.0
sphinxcontrib-jquery==4.1
sphinxcontrib-jsmath==1.0.1
sphinxcontrib-qthelp==1.0.3
sphinxcontrib-serializinghtml==1.1.5
tomli==1.2.3
typing_extensions==4.1.1
urllib3==1.26.20
zipp==3.6.0

name: canvasapi
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=2021.5.30=py36h06a4308_0
  - ld_impl_linux-64=2.40=h12ee557_0
  - libffi=3.3=he6710b0_2
  - 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=21.2.2=py36h06a4308_0
  - python=3.6.13=h12debd9_1
  - readline=8.2=h5eee18b_0
  - setuptools=58.0.4=py36h06a4308_0
  - sqlite=3.45.3=h5eee18b_0
  - tk=8.6.14=h39e8969_0
  - wheel=0.37.1=pyhd3eb1b0_0
  - xz=5.6.4=h5eee18b_1
  - zlib=1.2.13=h5eee18b_1
  - pip:
      - alabaster==0.7.13
      - attrs==22.2.0
      - babel==2.11.0
      - charset-normalizer==2.0.12
      - coverage==6.2
      - docutils==0.17.1
      - execnet==1.9.0
      - flake8==5.0.4
      - idna==3.10
      - imagesize==1.4.1
      - importlib-metadata==4.2.0
      - iniconfig==1.1.1
      - jinja2==3.0.3
      - markupsafe==2.0.1
      - mccabe==0.7.0
      - packaging==21.3
      - pluggy==1.0.0
      - py==1.11.0
      - pycodestyle==2.9.1
      - pyflakes==2.5.0
      - pygments==2.14.0
      - pyparsing==3.1.4
      - pytest==7.0.1
      - pytest-asyncio==0.16.0
      - pytest-cov==4.0.0
      - pytest-mock==3.6.1
      - pytest-xdist==3.0.2
      - pytz==2025.2
      - requests==2.27.1
      - requests-mock==1.12.1
      - six==1.17.0
      - snowballstemmer==2.2.0
      - sphinx==4.3.2
      - sphinx-rtd-theme==1.3.0
      - sphinxcontrib-applehelp==1.0.2
      - sphinxcontrib-devhelp==1.0.2
      - sphinxcontrib-htmlhelp==2.0.0
      - sphinxcontrib-jquery==4.1
      - sphinxcontrib-jsmath==1.0.1
      - sphinxcontrib-qthelp==1.0.3
      - sphinxcontrib-serializinghtml==1.1.5
      - tomli==1.2.3
      - typing-extensions==4.1.1
      - urllib3==1.26.20
      - zipp==3.6.0
prefix: /opt/conda/envs/canvasapi

tests/test_canvas.py::TestCanvas::test_get_user_self
tests/test_canvas.py::TestCanvas::test_clear_course_nicknames tests/test_canvas.py::TestCanvas::test_conversations_batch_update tests/test_canvas.py::TestCanvas::test_conversations_batch_updated_fail_on_event tests/test_canvas.py::TestCanvas::test_conversations_batch_updated_fail_on_ids tests/test_canvas.py::TestCanvas::test_conversations_get_running_batches tests/test_canvas.py::TestCanvas::test_conversations_mark_all_as_read tests/test_canvas.py::TestCanvas::test_conversations_unread_count tests/test_canvas.py::TestCanvas::test_create_account tests/test_canvas.py::TestCanvas::test_create_appointment_group tests/test_canvas.py::TestCanvas::test_create_appointment_group_fail_on_context_codes tests/test_canvas.py::TestCanvas::test_create_appointment_group_fail_on_title tests/test_canvas.py::TestCanvas::test_create_calendar_event tests/test_canvas.py::TestCanvas::test_create_calendar_event_fail tests/test_canvas.py::TestCanvas::test_create_conversation tests/test_canvas.py::TestCanvas::test_create_group tests/test_canvas.py::TestCanvas::test_get_account tests/test_canvas.py::TestCanvas::test_get_account_fail tests/test_canvas.py::TestCanvas::test_get_account_sis_id tests/test_canvas.py::TestCanvas::test_get_accounts tests/test_canvas.py::TestCanvas::test_get_activity_stream_summary tests/test_canvas.py::TestCanvas::test_get_appointment_group tests/test_canvas.py::TestCanvas::test_get_calendar_event tests/test_canvas.py::TestCanvas::test_get_conversation tests/test_canvas.py::TestCanvas::test_get_conversations tests/test_canvas.py::TestCanvas::test_get_course tests/test_canvas.py::TestCanvas::test_get_course_accounts tests/test_canvas.py::TestCanvas::test_get_course_fail tests/test_canvas.py::TestCanvas::test_get_course_nickname tests/test_canvas.py::TestCanvas::test_get_course_nickname_fail tests/test_canvas.py::TestCanvas::test_get_course_nicknames tests/test_canvas.py::TestCanvas::test_get_course_non_unicode_char tests/test_canvas.py::TestCanvas::test_get_course_sis_id tests/test_canvas.py::TestCanvas::test_get_course_with_start_date tests/test_canvas.py::TestCanvas::test_get_courses tests/test_canvas.py::TestCanvas::test_get_file tests/test_canvas.py::TestCanvas::test_get_group tests/test_canvas.py::TestCanvas::test_get_group_category tests/test_canvas.py::TestCanvas::test_get_group_sis_id tests/test_canvas.py::TestCanvas::test_get_outcome tests/test_canvas.py::TestCanvas::test_get_outcome_group tests/test_canvas.py::TestCanvas::test_get_root_outcome_group tests/test_canvas.py::TestCanvas::test_get_section tests/test_canvas.py::TestCanvas::test_get_section_sis_id tests/test_canvas.py::TestCanvas::test_get_todo_items tests/test_canvas.py::TestCanvas::test_get_upcoming_events tests/test_canvas.py::TestCanvas::test_get_user tests/test_canvas.py::TestCanvas::test_get_user_by_id_type tests/test_canvas.py::TestCanvas::test_get_user_fail tests/test_canvas.py::TestCanvas::test_list_appointment_groups tests/test_canvas.py::TestCanvas::test_list_calendar_events tests/test_canvas.py::TestCanvas::test_list_group_participants tests/test_canvas.py::TestCanvas::test_list_user_participants tests/test_canvas.py::TestCanvas::test_reserve_time_slot tests/test_canvas.py::TestCanvas::test_reserve_time_slot_by_participant_id tests/test_canvas.py::TestCanvas::test_search_accounts tests/test_canvas.py::TestCanvas::test_search_all_courses tests/test_canvas.py::TestCanvas::test_search_recipients tests/test_canvas.py::TestCanvas::test_set_course_nickname
canvasapi/canvas.py
canvasapi/canvas.py