Skip to content

Commit 39ceec0

Browse files
authored
docs: Fix Python Actor configuration property naming (#2091)
Updates Python code examples to use the correct `Actor.configuration` property instead of `Actor.config` that got removed in the Python SDK v3 (see https://docs.apify.com/sdk/python/docs/upgrading/upgrading-to-v3#removed-actorconfig-property). <!-- CURSOR_SUMMARY --> --- > [!NOTE] > Updates Python code samples to use Actor.configuration (web_server_port, standby_port, meta_origin, token) instead of removed Actor.config across Standby and environment variables docs. > > - **Docs (Python examples)**: > - **Standby mode (`sources/platform/actors/development/programming_interface/actor_standby.md`)**: > - Use `Actor.configuration.web_server_port` and `Actor.configuration.standby_port` in HTTP server examples. > - Check `Actor.configuration.meta_origin` for Standby mode detection. > - **Environment variables (`sources/platform/actors/development/programming_interface/environment_variables.md`)**: > - Access and set token via `Actor.configuration.token` instead of `Actor.config.token`. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit b3f5d0d. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
1 parent 6d0e6cb commit 39ceec0

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

sources/platform/actors/development/programming_interface/actor_standby.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ class GetHandler(SimpleHTTPRequestHandler):
6262

6363
async def main() -> None:
6464
async with Actor:
65-
with HTTPServer(('', Actor.config.web_server_port), GetHandler) as http_server:
65+
with HTTPServer(('', Actor.configuration.web_server_port), GetHandler) as http_server:
6666
http_server.serve_forever()
6767
```
6868

@@ -131,7 +131,7 @@ class GetHandler(SimpleHTTPRequestHandler):
131131

132132
async def main() -> None:
133133
async with Actor:
134-
with HTTPServer(('', Actor.config.standby_port), GetHandler) as http_server:
134+
with HTTPServer(('', Actor.configuration.standby_port), GetHandler) as http_server:
135135
http_server.serve_forever()
136136
```
137137

@@ -167,7 +167,7 @@ from apify import Actor
167167

168168
async def main() -> None:
169169
async with Actor:
170-
if Actor.config.meta_origin == 'STANDBY':
170+
if Actor.configuration.meta_origin == 'STANDBY':
171171
# Start your Standby server here
172172
else:
173173
# Perform the standard Actor operations here

sources/platform/actors/development/programming_interface/environment_variables.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -198,13 +198,13 @@ from apify import Actor
198198

199199
async def main():
200200
async with Actor:
201-
old_token = Actor.config.token
201+
old_token = Actor.configuration.token
202202
Actor.log.info(f'old_token = {old_token}')
203203

204204
# use different token
205-
Actor.config.token = 's0m3n3wt0k3n'
205+
Actor.configuration.token = 's0m3n3wt0k3n'
206206

207-
new_token = Actor.config.token
207+
new_token = Actor.configuration.token
208208
Actor.log.info(f'new_token = {new_token}')
209209
```
210210

0 commit comments

Comments
 (0)