question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Python3 Compatibility and unresolved references

See original GitHub issue

Could 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:open
  • Created 6 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
seanharr11commented, Apr 7, 2017

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?

0reactions
seanharr11commented, Jan 4, 2019

@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).

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found