Skip to content

Commit 11b4b94

Browse files
committed
Small rewords
1 parent 83900f3 commit 11b4b94

2 files changed

Lines changed: 15 additions & 11 deletions

File tree

docs/source/faq.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ UnicodeEncodeError: '<encoding>' codec can't encode …
255255
Where ``<encoding>`` might be *ascii*, *cp932*, *charmap* or anything else other than **utf-8**. This error usually
256256
shows up when you try to print something and has very little to do with Pyrogram itself as it is strictly related to
257257
your own terminal. To fix it, either find a way to change the encoding settings of your terminal to UTF-8 or switch to a
258-
better one.
258+
better terminal altogether.
259259

260260
My verification code expires immediately!
261261
-----------------------------------------

docs/source/topics/storage-engines.rst

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ File Storage
3131
^^^^^^^^^^^^
3232

3333
This is the most common storage engine. It is implemented by using **SQLite**, which will store the session and peers
34-
details. The database will be saved to disk as a single portable file and is designed to efficiently save and retrieve
34+
details. The database will be saved to disk as a single portable file and is designed to efficiently store and retrieve
3535
peers whenever they are needed.
3636

3737
To use this type of engine, simply pass any name of your choice to the ``session_name`` parameter of the
@@ -51,7 +51,7 @@ session database will be automatically loaded.
5151
Memory Storage
5252
^^^^^^^^^^^^^^
5353

54-
In case you don't want to have any session file saved on disk, you can use an in-memory storage by passing the special
54+
In case you don't want to have any session file saved to disk, you can use an in-memory storage by passing the special
5555
session name "**:memory:**" to the ``session_name`` parameter of the :obj:`~pyrogram.Client` constructor:
5656

5757
.. code-block:: python
@@ -61,16 +61,12 @@ session name "**:memory:**" to the ``session_name`` parameter of the :obj:`~pyro
6161
with Client(":memory:") as app:
6262
print(app.get_me())
6363
64-
This database is still backed by SQLite, but exists purely in memory. However, once you stop a client, the entire
65-
database is discarded and the session details used for logging in again will be lost forever.
64+
This storage engine is still backed by SQLite, but the database exists purely in memory. This means that, once you stop a
65+
client, the entire database is discarded and the session details used for logging in again will be lost forever.
6666

6767
Session Strings
6868
---------------
6969

70-
Session strings are useful when you want to run authorized Pyrogram clients on platforms like
71-
`Heroku <https://www.heroku.com/>`_, where their ephemeral filesystems makes it much harder for a file-based storage
72-
engine to properly work as intended.
73-
7470
In case you want to use an in-memory storage, but also want to keep access to the session you created, call
7571
:meth:`~pyrogram.Client.export_session_string` anytime before stopping the client...
7672

@@ -81,8 +77,8 @@ In case you want to use an in-memory storage, but also want to keep access to th
8177
with Client(":memory:") as app:
8278
print(app.export_session_string())
8379
84-
...and save the resulting string somewhere. You can use this string as session name the next time you want to login
85-
using the same session; the storage used will still be completely in-memory:
80+
...and save the resulting (quite long) string somewhere. You can use this string as session name the next time you want
81+
to login using the same session; the storage used will still be completely in-memory:
8682

8783
.. code-block:: python
8884
@@ -93,3 +89,11 @@ using the same session; the storage used will still be completely in-memory:
9389
with Client(session_string) as app:
9490
print(app.get_me())
9591
92+
Session strings are useful when you want to run authorized Pyrogram clients on platforms like
93+
`Heroku <https://www.heroku.com/>`_, where their ephemeral filesystems makes it much harder for a file-based storage
94+
engine to properly work as intended.
95+
96+
But, why is the session string so long? Can't it be shorter? No, it can't. The session string already packs the bare
97+
minimum data Pyrogram needs to successfully reconnect to an authorized session, and the 2048-bits auth key is the major
98+
contributor to the overall length. Needless to repeat that this string, as well as any other session storage, represent
99+
strictly personal data. Keep them safe.

0 commit comments

Comments
 (0)