Modify

Ticket #203 (new defect)

Opened 3 years ago

Last modified 3 years ago

reading yaml from socket may block in determine_encoding()

Reported by: socketpair@… Owned by: xi
Priority: normal Component: pyyaml
Severity: major Keywords:
Cc:

Description

The problem here:

reader.py:

determine_encoding():

  1. call self.update_raw() until receive needed length. Suppose it receives all data from the kernel buffer, i.e. in my case - full document (--- xxxxxxxx\n...\n) self.eof will not be set
  2. call update(1) which have the code: if not self.eof:

self.update_raw()

as the self.eof is False (we never receive empty string) we will hang for any (uneeded here) data.

############################### How to fix: just remove


if not self.eof:

self.update_raw()


Attachments

z.patch Download (381 bytes) - added by socketpair@… 3 years ago.
solution for the problem

Change History

comment:1 Changed 3 years ago by anonymous

for files - is not sensible, because reading plain file never block.

Changed 3 years ago by socketpair@…

solution for the problem

comment:2 Changed 3 years ago by anonymous

sorry, first solution was completely wrong. I have the tested patch. (attached)

View

Add a comment

Modify Ticket

Change Properties
<Author field>
Action
as new
as The resolution will be set. Next status will be 'closed'
to The owner will be changed from xi. Next status will be 'new'
The owner will be changed from xi to anonymous. Next status will be 'assigned'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.