Python3 Compatibility and unresolved references
See original GitHub issueCould you consider Python 3 compatibility like the following code? I tried to fix the code, but Python 2 dependencies was too deep so I gave up. Also I found some unresolved references in transform_rows(refers idx) and migrate(refers destination) functions.
import six
import decimal
import datetime
def _generate_literal_value_for_csv(value, dialect):
dialect_name = dialect.name.lower()
if isinstance(value, six.string_types):
if dialect_name in ['sqlite', 'mssql']:
# No support for 'quote' enclosed strings
return "%s" % value
else:
value = value.replace('"', '""')
return "\"%s\"" % value
elif value is None:
return "NULL"
elif isinstance(value, bool):
return str(int(value))
elif isinstance(value, six.integer_types):
return str(value)
elif isinstance(value, float):
return str(value)
elif isinstance(value, decimal.Decimal):
return str(value)
<bountysource-plugin>
Want to back this issue? Post a bounty on it! We accept bounties via Bountysource. </bountysource-plugin>
Issue Analytics
- State:
- Created 6 years ago
- Comments:6 (4 by maintainers)
Top Results From Across the Web
Unresolved Reference with Global Variables in Python 3
I did read through this thread: Unresolved reference issue in PyCharm. It doesn't appear to match my particular case.
Read more >unresolved references to built-ins
unresolved references to built-ins Follow pycharm is marking things like "enumerate", "sorted", and "zip" as unresolved. pycharm 1.0b2 (96.1063 ...
Read more >What's New In Python 3.7 — Python 3.11.1 documentation
Usability-wise, annotations now support forward references, making the following syntax valid: class C: @classmethod def from_string(cls ...
Read more >Python Unresolved Reference - MindMajix Community
Answers · Search for __init__.py file within the src folder. · Next, add the src folder as a root of the source. ·...
Read more >31 SWIG and Python
SWIG is compatible with most recent Python versions including Python 3.0 and ... Sometimes unresolved symbols occur because a wrapper has been created...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I’ve got the code about 50% ported to Python3, just need a day or 2 to finish up.
Are you saying that the undefined references were only breaking in Python3? And it Python2.7?
@gb-ita @tpow if you guys can both continue to work on @tpow’s great start to unit tests, I will take a stab at setting some functional tests up (I need to get clever with Docker and licensing when trying to deploy Oracle and SQL Server for testing).