Repository: python-telegram-bot/python-telegram-bot

Issue:
_trigger_timeout() missing 1 required positional argument: 'job'
### Steps to reproduce
1. Create a `ConversationalHandler` and use `conversation_timeout=10`
2. Launch the bot
3. Trigger command to enter conversation
4. Wait for 10sec
5. Error appears

### Expected behaviour
The conversation should timeout

### Actual behaviour
From the chat, nothing happens. If i respond normally after the supposed timeout should have taken place, the bot responds to me as if no timeout has taken place.

### Configuration
**Operating System:**
```
ProductName:	Mac OS X
ProductVersion:	10.14.3
BuildVersion:	18D109
```

**Version of Python, python-telegram-bot & dependencies:**
```
python-telegram-bot 12.0.0b1
certifi 2019.03.09
future 0.17.1
Python 3.7.2 (default, Feb 12 2019, 08:15:36)  [Clang 10.0.0 (clang-1000.11.45.5)]
```

### Logs
```
2019-03-18 10:33:52,327 - JobQueue - DEBUG - Ticking jobs with t=1552876432.327480
2019-03-18 10:33:52,329 - JobQueue - DEBUG - Peeked at _trigger_timeout with t=1552876432.325519
2019-03-18 10:33:52,331 - JobQueue - DEBUG - Running job _trigger_timeout
2019-03-18 10:33:52,332 - JobQueue - ERROR - An uncaught error was raised while executing job _trigger_timeout
Traceback (most recent call last):
  File "/venv/lib/python3.7/site-packages/telegram/ext/jobqueue.py", line 260, in tick
    job.run(self._dispatcher)
  File "/venv/lib/python3.7/site-packages/telegram/ext/jobqueue.py", line 388, in run
    self.callback(CallbackContext.from_job(self, dispatcher))
TypeError: _trigger_timeout() missing 1 required positional argument: 'job'
2019-03-18 10:33:52,338 - JobQueue - DEBUG - Dropping non-repeating or removed job _trigger_timeout
```


Discussion:
It looks like we missed the _trigger_timeout callback when we went through the codebase updating to context based handlers. Thanks for the report, we'll get it fixed when we can :)

Resolving patch:
diff --git a/telegram/ext/conversationhandler.py b/telegram/ext/conversationhandler.py
--- a/telegram/ext/conversationhandler.py
+++ b/telegram/ext/conversationhandler.py
@@ -23,7 +23,7 @@
 
 from telegram import Update
 from telegram.ext import (Handler, CallbackQueryHandler, InlineQueryHandler,
-                          ChosenInlineResultHandler)
+                          ChosenInlineResultHandler, CallbackContext)
 from telegram.utils.promise import Promise
 
 
@@ -354,12 +354,19 @@ def update_state(self, new_state, key):
             if self.persistent:
                 self.persistence.update_conversation(self.name, key, new_state)
 
-    def _trigger_timeout(self, bot, job):
+    def _trigger_timeout(self, context, job=None):
         self.logger.debug('conversation timeout was triggered!')
-        del self.timeout_jobs[job.context.conversation_key]
+        
+        # Backward compatibility with bots that do not use CallbackContext
+        if isinstance(context, CallbackContext):
+            context = context.job.context
+        else:
+            context = job.context
+        
+        del self.timeout_jobs[context.conversation_key]
         handlers = self.states.get(self.TIMEOUT, [])
         for handler in handlers:
-            check = handler.check_update(job.context.update)
+            check = handler.check_update(context.update)
             if check is not None and check is not False:
-                handler.handle_update(job.context.update, job.context.dispatcher, check)
-        self.update_state(self.END, job.context.conversation_key)
+                handler.handle_update(context.update, context.dispatcher, check)
+        self.update_state(self.END, context.conversation_key)


Test patch: