[issue44743] asyncio DatagramProtocol stops calling callbacks after OSError

2021-11-14 Thread Szymon


Szymon  added the comment:

I'm experiencing the same exact issue. The bug manifests with all combinations: 
SelectorEventLoop and ProactorEventLoop, python 3.9 and 3.10, on Windows 10. 
Python 3.8 on Linux seems to not be affected. Can we get a fix or at least an 
update?

--
nosy: +sim1234

___
Python tracker 
<https://bugs.python.org/issue44743>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43315] Decimal.__str__ has no way to force exact decimal representation

2021-02-24 Thread Szymon


New submission from Szymon :

str(Decimal("0.0001")) always returns "1E-8" and there is no way to 
directly get the "0.0001" string back without writting custom method for 
converting DecimalTuple to string. This is caused by arbitrary choice of `and 
leftdigits > -6` condition in 
https://github.com/python/cpython/blob/master/Lib/_pydecimal.py#L1052 .
The hardcoded value of -6 should be parametrizable. This can be done by adding 
it as argument to the __str__ method or maybe by adding it to the decimal 
context.

--
messages: 387618
nosy: sim1234
priority: normal
severity: normal
status: open
title: Decimal.__str__ has no way to force exact decimal representation
type: enhancement
versions: Python 3.10, Python 3.6, Python 3.7, Python 3.8, Python 3.9

___
Python tracker 
<https://bugs.python.org/issue43315>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43315] Decimal.__str__ has no way to force exact decimal representation

2021-02-24 Thread Szymon


Szymon  added the comment:

Thanks for the replies. The use of format works great. Maybe it's worth 
mentioning in the documentation because using "%f" % Decimal("0.0001") leds 
to loosing precision (cast to float64 I guess) while using 
f"{"Decimal('0.0001'):f}" does the thing correctly.

--

___
Python tracker 
<https://bugs.python.org/issue43315>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43315] Decimal.__str__ has no way to force exact decimal representation

2021-02-26 Thread Szymon


Szymon  added the comment:

One more thing: It's worth mentioning that by default, you'll get only 28 
significant digits of precision, so doing 
f"{Decimal('1234567890123456789012.12345678').normalize():f}" will produce 
'1234567890123456789012.123457' (two last digits got rounded).

--

___
Python tracker 
<https://bugs.python.org/issue43315>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue19770] NNTP.post broken

2013-11-25 Thread Szymon Sobik

New submission from Szymon Sobik:

post method fails because string methods have bytesrting arguments

ie.
line = line.rstrip(b"\r\n") + _CRLF

--
components: Library (Lib)
messages: 204331
nosy: sobczyk
priority: normal
severity: normal
status: open
title: NNTP.post broken
type: behavior
versions: Python 3.2, Python 3.3, Python 3.4

___
Python tracker 
<http://bugs.python.org/issue19770>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue19770] NNTP.post broken

2013-11-25 Thread Szymon Sobik

Szymon Sobik added the comment:

Traceback (most recent call last):
  File "./nntp_test.py", line 23, in 
s.post(msg)
  File "/usr/lib/python3.3/nntplib.py", line 909, in post
return self._post('POST', data)
  File "/usr/lib/python3.3/nntplib.py", line 895, in _post
if not line.endswith(_CRLF):
TypeError: endswith first arg must be str or a tuple of str, not bytes

--
Added file: http://bugs.python.org/file32836/nntp_test.py

___
Python tracker 
<http://bugs.python.org/issue19770>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue19770] NNTP.post broken

2013-11-25 Thread Szymon Sobik

Szymon Sobik added the comment:

Ok I found this out too on my own.

It might be better to add examples using the MIME* classes to nntplib 
documentation.

--

___
Python tracker 
<http://bugs.python.org/issue19770>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue25479] Increase unit test coverage for abc.py

2015-10-25 Thread Szymon Trapp

New submission from Szymon Trapp:

Added a new function to unit tests for abc.py to increase the test coverage, 
specifically for the usage of __subclasshook__.

This will cover lines 209-214.

Note: this is my first submission to Python and I'm following the advice to 
start with the unit tests coverage.

--
components: Tests
files: mywork.patch
keywords: patch
messages: 253453
nosy: szymon
priority: normal
severity: normal
status: open
title: Increase unit test coverage for abc.py
type: enhancement
versions: Python 3.6
Added file: http://bugs.python.org/file40860/mywork.patch

___
Python tracker 
<http://bugs.python.org/issue25479>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue26694] Disasembler fall with Key Error while disassemble obfuscated code.

2016-04-05 Thread Szymon Kuliński

New submission from Szymon Kuliński:

Many obfuscators use simple technice for block disasemblation. Add broken 
instructions (for example unknown op codes) and use flow control (SETUP_EXCEPT 
or JUMP_FORWARD) to skip broken instructions. Interpreter work in right way 
skipping broken instruction or catch error and go to except instructions but 
disasembler iterate over all instructions and every where assume that code is 
correct and doing something like :

elif op in hasname:
print '(' + co.co_names[oparg] + ')',


Which fails because variable oparg not in co_names table or refer to not 
existing name or const. Why dis lib not assume that code can be broken and try 
disassemble it as good as it can any way. 

   15 JUMP_IF_TRUE 3 (to 19)
   18   ()
   19 LOAD_NAME1 (b)

Or if we rely on the assumption that if code disasseblation done with no 
problem this mean that code is good. We can add flag where we can disassemble 
unsteady code or even add other method like dis_unsafe or something like that. 

Include: obfuscated and unobfuscated pyc files for testing. 

Change proposition:

Cherry-pick code dis module from 3.5 python with some changes required to 
normal working. Working example included.

--
components: Library (Lib)
files: example.zip
messages: 262895
nosy: Szymon.Kuliński
priority: normal
severity: normal
status: open
title: Disasembler fall with Key Error while disassemble obfuscated code.
type: behavior
versions: Python 2.7
Added file: http://bugs.python.org/file42371/example.zip

___
Python tracker 
<http://bugs.python.org/issue26694>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com